diff options
author | Mike Stump <mrs@apple.com> | 2010-01-07 19:39:43 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2010-01-07 19:39:43 +0000 |
commit | 365d638ba3d1c05c736e1b50c189000cdeea5e3c (patch) | |
tree | 02023ba6544a4e2d5331ee9c026a3d0d2f49871a /utils/VtableTest | |
parent | b67270724f3924ab7ffbc05ebbe06f83c3fed7e4 (diff) |
Add a descriptive tag to each line to make the exact differences
easier to understand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/VtableTest')
-rw-r--r-- | utils/VtableTest/gen.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/utils/VtableTest/gen.cc b/utils/VtableTest/gen.cc index be9a9a3808..ee426e49b2 100644 --- a/utils/VtableTest/gen.cc +++ b/utils/VtableTest/gen.cc @@ -124,7 +124,7 @@ void gs(int s) { for (int i = 0; i < n_funcs; ++i) { int fn = old_func + random() % FUNCSPACING + 1; funcs[i] = fn; - g(" virtual void fun"); g(fn); g("(char *t) { mix((char *)this - t); mix("); g(++vfn); gl("); }"); + g(" virtual void fun"); g(fn); g("(char *t) { mix(\"vfn this offset\", (char *)this - t); mix(\"vfn uuid\", "); g(++vfn); gl("); }"); old_func = fn; } @@ -132,16 +132,16 @@ void gs(int s) { gl(" void calc(char *t) {"); // mix in the type number - g(" mix("); g(s); gl(");"); + g(" mix(\"type num\", "); g(s); gl(");"); // mix in the size - g(" mix(sizeof (s"); g(s); gl("));"); + g(" mix(\"type size\", sizeof (s"); g(s); gl("));"); // mix in the this offset - gl(" mix((char *)this - t);"); + gl(" mix(\"subobject offset\", (char *)this - t);"); if (n_funcs) polymorphic = true; if (polymorphic) { // mix in offset to the complete object under construction - gl(" mix(t - (char *)dynamic_cast<void*>(this));"); + gl(" mix(\"real top v current top\", t - (char *)dynamic_cast<void*>(this));"); } /* check base layout and overrides */ @@ -153,24 +153,24 @@ void gs(int s) { /* check dynamic_cast to each direct base */ for (int i = 0; i < n_bases; ++i) { g(" if ((char *)dynamic_cast<s"); g(bases[i]); gl("*>(this))"); - g(" mix(t - (char *)dynamic_cast<s"); g(bases[i]); gl("*>(this));"); - gl(" else mix(666);"); + g(" mix(\"base dyn cast\", t - (char *)dynamic_cast<s"); g(bases[i]); gl("*>(this));"); + gl(" else mix(\"no dyncast\", 666);"); } } /* check field layout */ for (int i = 0; i < n_fields; ++i) { - g(" mix((char *)&field"); g(i); gl(" - (char *)this);"); + g(" mix(\"field offset\", (char *)&field"); g(i); gl(" - (char *)this);"); } if (n_fields == 0) - gl(" mix(42);"); + gl(" mix(\"no fields\", 42);"); /* check functions */ for (int i = 0; i < n_funcs; ++i) { g(" fun"); g(funcs[i]); gl("(t);"); } if (n_funcs == 0) - gl(" mix(13);"); + gl(" mix(\"no funcs\", 13);"); gl(" }"); @@ -204,10 +204,10 @@ main(int argc, char **argv) { gl("extern \"C\" int printf(const char *...);"); gl(""); gl("long long sum;"); - gl("void mix(long long i) {"); + gl("void mix(const char *desc, long long i) {"); // If this ever becomes too slow, we can remove this after we improve the // mixing function - gl(" printf(\"%llx\\n\", i);"); + gl(" printf(\"%s: %lld\\n\", desc, i);"); gl(" sum += ((sum ^ i) << 3) + (sum<<1) - i;"); gl("}"); gl(""); |