[llvm-commits] [PATCH] [msan] Heuristic handling of unknown intrinsics

Alexander Potapenko glider at google.com
Wed Dec 12 04:23:24 PST 2012



================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1022
@@ +1021,3 @@
+    Value* V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits));
+    Value* V2 = IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), false);
+    return IRB.CreateBitCast(V2, dstTy);
----------------
Please add a comment for "false"

================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1229
@@ +1228,3 @@
+    const int OnlyReadsArgumentPointees = IK_OnlyReadsMemory;
+    const int OnlyReadsMemory = IK_OnlyReadsMemory;
+    const int OnlyAccessesArgumentPointees = IK_WritesMemory;
----------------
Are these constants used anywhere?

================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1318
@@ +1317,3 @@
+
+    DEBUG(dbgs() << (ReadsMemory ? "read" : (WritesMemory ? "write" :
+          "nomem")) << " intrinsic: " << I << "\n");
----------------
Please do not break "(WritesMemory ? "write" : "nomem")" to the next line.

================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1317
@@ +1316,3 @@
+    Type* MemAccessShadowTy = getShadowTy(MemAccessType);
+
+    DEBUG(dbgs() << (ReadsMemory ? "read" : (WritesMemory ? "write" :
----------------
Nit: spare newline
Or maybe not


http://llvm-reviews.chandlerc.com/D184



More information about the llvm-commits mailing list