]> git.llucax.com Git - software/druntime.git/blob - src/compiler/dmd/invariant_.d
Removed stdc directory. This was moved to core/stdc.
[software/druntime.git] / src / compiler / dmd / invariant_.d
1 /*
2  * Placed into the Public Domain
3  * written by Walter Bright
4  * www.digitalmars.com
5  */
6 module rt.invariant_;
7
8 extern (C) void _d_invariant(Object o)
9 {   ClassInfo c;
10
11     //printf("__d_invariant(%p)\n", o);
12
13     // BUG: needs to be filename/line of caller, not library routine
14     assert(o !is null); // just do null check, not invariant check
15
16     c = o.classinfo;
17     do
18     {
19         if (c.classInvariant)
20         {
21             (*c.classInvariant)(o);
22         }
23         c = c.base;
24     } while (c);
25 }