diff options
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 8 | ||||
-rw-r--r-- | lib/VMCore/Function.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/IntrinsicLowering.cpp | 8 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 5 |
4 files changed, 27 insertions, 0 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 4815be9..52faefd 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -48,6 +48,14 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { // Insert the call to abort new CallInst(M->getOrInsertFunction("abort", Type::VoidTy, 0), "", CI); break; + + case Intrinsic::dbg_stoppoint: + case Intrinsic::dbg_region_start: + case Intrinsic::dbg_region_end: + case Intrinsic::dbg_func_start: + if (CI->getType() != Type::VoidTy) + CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); + break; // Simply strip out debugging intrinsics } assert(CI->use_empty() && diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index b558672..f8d951b 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -207,6 +207,12 @@ unsigned Function::getIntrinsicID() const { if (getName() == alpha_intrinsics[i].name) return alpha_intrinsics[i].id; break; + case 'd': + if (getName() == "llvm.dbg.stoppoint") return Intrinsic::dbg_stoppoint; + if (getName() == "llvm.dbg.region.start")return Intrinsic::dbg_region_start; + if (getName() == "llvm.dbg.region.end") return Intrinsic::dbg_region_end; + if (getName() == "llvm.dbg.func.start") return Intrinsic::dbg_func_start; + break; case 'l': if (getName() == "llvm.longjmp") return Intrinsic::longjmp; break; diff --git a/lib/VMCore/IntrinsicLowering.cpp b/lib/VMCore/IntrinsicLowering.cpp index 4815be9..52faefd 100644 --- a/lib/VMCore/IntrinsicLowering.cpp +++ b/lib/VMCore/IntrinsicLowering.cpp @@ -48,6 +48,14 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { // Insert the call to abort new CallInst(M->getOrInsertFunction("abort", Type::VoidTy, 0), "", CI); break; + + case Intrinsic::dbg_stoppoint: + case Intrinsic::dbg_region_start: + case Intrinsic::dbg_region_end: + case Intrinsic::dbg_func_start: + if (CI->getType() != Type::VoidTy) + CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); + break; // Simply strip out debugging intrinsics } assert(CI->use_empty() && diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 98288f4..3e59e65 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -548,6 +548,11 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { case Intrinsic::longjmp: NumArgs = 2; break; case Intrinsic::sigsetjmp: NumArgs = 2; break; case Intrinsic::siglongjmp: NumArgs = 2; break; + + case Intrinsic::dbg_stoppoint: NumArgs = 4; break; + case Intrinsic::dbg_region_start:NumArgs = 1; break; + case Intrinsic::dbg_region_end: NumArgs = 1; break; + case Intrinsic::dbg_func_start: NumArgs = 1; break; case Intrinsic::alpha_ctlz: NumArgs = 1; break; case Intrinsic::alpha_cttz: NumArgs = 1; break; |