[llvm-commits] [llvm] r168884 - /llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Nov 29 06:32:03 PST 2012


Author: eugenis
Date: Thu Nov 29 08:32:03 2012
New Revision: 168884

URL: http://llvm.org/viewvc/llvm-project?rev=168884&view=rev
Log:
[msan] Basic handling of inline asm.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=168884&r1=168883&r2=168884&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Thu Nov 29 08:32:03 2012
@@ -1065,10 +1065,19 @@
     Instruction &I = *CS.getInstruction();
     assert((CS.isCall() || CS.isInvoke()) && "Unknown type of CallSite");
     if (CS.isCall()) {
+      CallInst *Call = cast<CallInst>(&I);
+
+      // For inline asm, do the usual thing: check argument shadow and mark all
+      // outputs as clean. Note that any side effects of the inline asm that are
+      // not immediately visible in its constraints are not handled.
+      if (Call->isInlineAsm()) {
+        visitInstruction(I);
+        return;
+      }
+
       // Allow only tail calls with the same types, otherwise
       // we may have a false positive: shadow for a non-void RetVal
       // will get propagated to a void RetVal.
-      CallInst *Call = cast<CallInst>(&I);
       if (Call->isTailCall() && Call->getType() != Call->getParent()->getType())
         Call->setTailCall(false);
       if (isa<IntrinsicInst>(&I)) {





More information about the llvm-commits mailing list