forked from OSchip/llvm-project
Add VMCore and code generator support for debugging intrinsics. By default
code generators completely ignore them. llvm-svn: 10691
This commit is contained in:
parent
53d7dcbee7
commit
3d903f0c0b
|
@ -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;
|
||||
|
|
|
@ -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() &&
|
||||
|
|
|
@ -549,6 +549,11 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
|||
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;
|
||||
case Intrinsic::alpha_ctpop: NumArgs = 1; break;
|
||||
|
|
Loading…
Reference in New Issue