diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Module/RaiseAsm.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp index acb7d0cf..3de28f4d 100644 --- a/lib/Module/RaiseAsm.cpp +++ b/lib/Module/RaiseAsm.cpp @@ -10,14 +10,15 @@ #include "Passes.h" #include "klee/Config/Version.h" #include "klee/Support/ErrorHandling.h" + +#include "llvm/IR/Function.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/InlineAsm.h" -#include "llvm/IR/LLVMContext.h" #include "llvm/IR/Instructions.h" - -#include "llvm/Support/raw_ostream.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/Support/Host.h" #include "llvm/Support/TargetRegistry.h" +#include "llvm/Support/raw_ostream.h" #if LLVM_VERSION_CODE >= LLVM_VERSION(6, 0) #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" @@ -63,7 +64,8 @@ bool RaiseAsmPass::runOnInstruction(Module &M, Instruction *I) { triple.getOS() == llvm::Triple::Darwin || triple.getOS() == llvm::Triple::FreeBSD)) { - if (ia->getAsmString() == "" && ia->hasSideEffects()) { + if (ia->getAsmString() == "" && ia->hasSideEffects() && + ia->getFunctionType()->getReturnType()->isVoidTy()) { IRBuilder<> Builder(I); #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent); |