From: Mike Stump Date: Thu, 7 Jan 2010 19:39:43 +0000 (+0000) Subject: Add a descriptive tag to each line to make the exact differences X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=365d638ba3d1c05c736e1b50c189000cdeea5e3c;p=clang 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 --- 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(this));"); + gl(" mix(\"real top v current top\", t - (char *)dynamic_cast(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(this))"); - g(" mix(t - (char *)dynamic_cast(this));"); - gl(" else mix(666);"); + g(" mix(\"base dyn cast\", t - (char *)dynamic_cast(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("");