[PATCH] D21445: Comprehensive static instrumentation (1/3): LLVM pass
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 16 14:35:11 PDT 2016
kcc added a comment.
(only have time for a shallow scan, may do another one tomorrow)
================
Comment at: lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp:38
@@ +37,3 @@
+ for (Instruction &Inst : BB) {
+ if (DILocation *Loc = Inst.getDebugLoc()) {
+ return Loc;
----------------
watch for redundant {}
================
Comment at: lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp:48
@@ +47,3 @@
+void setInstrumentationDebugLoc(Instruction *Instrumented, Instruction *Call) {
+ DISubprogram *Subprog = Instrumented->getFunction()->getSubprogram();
+ if (Subprog) {
----------------
if (DISubprogram *Subprog = ...) {
...
}
here and below
================
Comment at: lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp:340
@@ +339,3 @@
+ GlobalVariable *GV = M.getGlobalVariable("__csi_unit_filename", true);
+ if (GV == NULL) {
+ GV = new GlobalVariable(M, FileStrConstant->getType(),
----------------
nullptr
Repository:
rL LLVM
http://reviews.llvm.org/D21445
More information about the llvm-commits
mailing list