diff options
| author | Qin Zhao <zhaoqin@google.com> | 2016-06-10 02:10:34 +0000 |
|---|---|---|
| committer | Qin Zhao <zhaoqin@google.com> | 2016-06-10 02:10:34 +0000 |
| commit | a4a7220db1da747fdd231debe737cd7deb327ffe (patch) | |
| tree | 687568b02ea4a125059c4be2493d9c553de1cbfd /compiler-rt/lib/esan/cache_frag.cpp | |
| parent | 0b96aa71907e62350be08dbc5fe9f2e4e5fdae29 (diff) | |
| download | bcm5719-llvm-a4a7220db1da747fdd231debe737cd7deb327ffe.tar.gz bcm5719-llvm-a4a7220db1da747fdd231debe737cd7deb327ffe.zip | |
[esan|cfrag] Add the struct field offset array in StructInfo
Summary:
Adds the struct field offset array in the struct StructInfo.
Prints struct size and field offset info in the report.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits, kubabrecka
Differential Revision: http://reviews.llvm.org/D21191
llvm-svn: 272363
Diffstat (limited to 'compiler-rt/lib/esan/cache_frag.cpp')
| -rw-r--r-- | compiler-rt/lib/esan/cache_frag.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler-rt/lib/esan/cache_frag.cpp b/compiler-rt/lib/esan/cache_frag.cpp index 39dfcb1a06f..a68598f1f93 100644 --- a/compiler-rt/lib/esan/cache_frag.cpp +++ b/compiler-rt/lib/esan/cache_frag.cpp @@ -26,7 +26,9 @@ namespace __esan { // This should be kept consistent with LLVM's EfficiencySanitizer StructInfo. struct StructInfo { const char *StructName; + u32 Size; u32 NumFields; + u32 *FieldOffsets; u64 *FieldCounters; const char **FieldTypeNames; }; @@ -89,9 +91,11 @@ static void reportStructCounter(StructHashMap::Handle &Handle) { end = strchr(start, '#'); CHECK(end != nullptr); Report(" %s %.*s\n", type, end - start, start); - Report(" count = %llu, ratio = %llu\n", Handle->Count, Handle->Ratio); + Report(" size = %u, count = %llu, ratio = %llu\n", + Struct->Size, Handle->Count, Handle->Ratio); for (u32 i = 0; i < Struct->NumFields; ++i) { - Report(" #%2u: count = %llu,\t type = %s\n", i, Struct->FieldCounters[i], + Report(" #%2u: offset = %u,\t count = %llu,\t type = %s\n", i, + Struct->FieldOffsets[i], Struct->FieldCounters[i], Struct->FieldTypeNames[i]); } } |

