[PATCH] D20661: [esan|cfrag] Extend ToolInfo for the cache-fragmentation tool

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 15:13:08 PDT 2016


aizatsky added inline comments.

================
Comment at: lib/Transforms/Instrumentation/EfficiencySanitizer.cpp:293
@@ +292,3 @@
+  for (auto &StructTy : Vec) {
+    if (shouldIgnoreStructType(StructTy))
+      continue;
----------------
Do you need a counter for ignored structs?

================
Comment at: lib/Transforms/Instrumentation/EfficiencySanitizer.cpp:299
@@ +298,3 @@
+    SmallString<MaxStructCounterNameSize> NameStr;
+    StringRef NameRef = createStructCounterName(StructTy, NameStr);
+    GlobalVariable *StructCounterName = createPrivateGlobalForString(
----------------
CounterNameRef

================
Comment at: lib/Transforms/Instrumentation/EfficiencySanitizer.cpp:343
@@ +342,3 @@
+  // Structs: StructInfo array
+  ArrayTy = ArrayType::get(StructInfoTy, NumOfStructs);
+  GlobalVariable *StructInfo = new GlobalVariable(
----------------
Please don't reuse the local. There's absolutely no need, but will make reading/breaking this code more difficult.


http://reviews.llvm.org/D20661





More information about the llvm-commits mailing list