[PATCH] D20542: [esan|cfrag] Adds struct CacheFragType
Qin Zhao via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 09:37:34 PDT 2016
zhaoqin updated this revision to Diff 58250.
zhaoqin added a comment.
Rename CacheFragType to CacheFragTy for consistency.
http://reviews.llvm.org/D20542
Files:
lib/esan/cache_frag.cpp
test/esan/TestCases/struct-simple.cpp
Index: test/esan/TestCases/struct-simple.cpp
===================================================================
--- test/esan/TestCases/struct-simple.cpp
+++ test/esan/TestCases/struct-simple.cpp
@@ -28,17 +28,17 @@
// CHECK: in esan::initializeLibrary
// CHECK-NEXT: in esan::initializeCacheFrag
// CHECK: in esan::processCompilationUnitInit
- // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit
+ // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit: {{.*}}struct-simple.cpp
// CHECK-NEXT: in esan::processCompilationUnitInit
- // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit
+ // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit: {{.*}}struct-simple.cpp
part();
return 0;
// CHECK: in esan::finalizeLibrary
// CHECK-NEXT: in esan::finalizeCacheFrag
// CHECK-NEXT: {{.*}}EfficiencySanitizer is not finished: nothing yet to report
// CHECK-NEXT: in esan::processCompilationUnitExit
- // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit
+ // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp
// CHECK-NEXT: in esan::processCompilationUnitExit
- // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit
+ // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp
}
#endif // MAIN
Index: lib/esan/cache_frag.cpp
===================================================================
--- lib/esan/cache_frag.cpp
+++ lib/esan/cache_frag.cpp
@@ -16,14 +16,27 @@
namespace __esan {
+// This should be kept consistent with LLVM's EfficiencySanitizer CacheFragType.
+// The tool-specific information per compilation unit (module).
+struct CacheFragTy {
+ ToolType WhichTool;
+ const char *UnitName;
+};
+
//===-- Init/exit functions -----------------------------------------------===//
void processCacheFragCompilationUnitInit(void *Ptr) {
- VPrintf(2, "in esan::%s\n", __FUNCTION__);
+ CacheFragTy *CacheFrag = (CacheFragTy *)Ptr;
+ if (CacheFrag->WhichTool != WhichTool)
+ return;
+ VPrintf(2, "in esan::%s: %s\n", __FUNCTION__, CacheFrag->UnitName);
}
void processCacheFragCompilationUnitExit(void *Ptr) {
- VPrintf(2, "in esan::%s\n", __FUNCTION__);
+ CacheFragTy *CacheFrag = (CacheFragTy *)Ptr;
+ if (CacheFrag->WhichTool != WhichTool)
+ return;
+ VPrintf(2, "in esan::%s: %s\n", __FUNCTION__, CacheFrag->UnitName);
}
void initializeCacheFrag() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20542.58250.patch
Type: text/x-patch
Size: 2439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160524/ec03f3a9/attachment.bin>
More information about the llvm-commits
mailing list