diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-11-29 14:32:03 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-11-29 14:32:03 +0000 |
commit | 7ad7e830316df2c12cef9e58c3d10d2abeda4e08 (patch) | |
tree | 1f7644f6d5ab0a603d73ab8aca291066c43229ff | |
parent | 0ac49bf846325c471908b39c70c25446cdb3f16f (diff) | |
download | bcm5719-llvm-7ad7e830316df2c12cef9e58c3d10d2abeda4e08.tar.gz bcm5719-llvm-7ad7e830316df2c12cef9e58c3d10d2abeda4e08.zip |
[msan] Basic handling of inline asm.
llvm-svn: 168884
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 46d22aacf95..d745a0c47af 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1065,10 +1065,19 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { 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)) { |