summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2013-02-08 21:48:29 +0000
committerBob Wilson <bob.wilson@apple.com>2013-02-08 21:48:29 +0000
commit58446916b71c4ff79962081ea7c4df078c388b0e (patch)
treebcdb044c5d6910123197f8a861ca0b11d33874a0 /lib/CodeGen
parentb2d1275188c997e279293afc031a88e03871f9e0 (diff)
downloadexternal_llvm-58446916b71c4ff79962081ea7c4df078c388b0e.zip
external_llvm-58446916b71c4ff79962081ea7c4df078c388b0e.tar.gz
external_llvm-58446916b71c4ff79962081ea7c4df078c388b0e.tar.bz2
Revert "Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>"
This reverts r171041. This was a nice idea that didn't work out well. Clang warnings need to be associated with warning groups so that they can be selectively disabled, promoted to errors, etc. This simplistic patch didn't allow for that. Enhancing it to provide some way for the backend to specify a front-end warning type seems like overkill for the few uses of this, at least for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index 16e7968..07f0ccf 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -413,30 +413,22 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
}
case Intrinsic::stacksave:
+ case Intrinsic::stackrestore: {
if (!Warned)
- Context.emitWarning("this target does not support the "
- "llvm.stacksave intrinsic");
- Warned = true;
- CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
- break;
-
- case Intrinsic::stackrestore:
- if (!Warned)
- Context.emitWarning("this target does not support the "
- "llvm.stackrestore intrinsic");
+ errs() << "WARNING: this target does not support the llvm.stack"
+ << (Callee->getIntrinsicID() == Intrinsic::stacksave ?
+ "save" : "restore") << " intrinsic.\n";
Warned = true;
+ if (Callee->getIntrinsicID() == Intrinsic::stacksave)
+ CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
break;
+ }
case Intrinsic::returnaddress:
- Context.emitWarning("this target does not support the "
- "llvm.returnaddress intrinsic");
- CI->replaceAllUsesWith(ConstantPointerNull::get(
- cast<PointerType>(CI->getType())));
- break;
-
case Intrinsic::frameaddress:
- Context.emitWarning("this target does not support the "
- "llvm.frameaddress intrinsic");
+ errs() << "WARNING: this target does not support the llvm."
+ << (Callee->getIntrinsicID() == Intrinsic::returnaddress ?
+ "return" : "frame") << "address intrinsic.\n";
CI->replaceAllUsesWith(ConstantPointerNull::get(
cast<PointerType>(CI->getType())));
break;
@@ -446,12 +438,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::pcmarker:
break; // Simply strip out pcmarker on unsupported architectures
- case Intrinsic::readcyclecounter:
- Context.emitWarning("this target does not support the "
- "llvm.readcyclecounter intrinsic; "
- "it is being lowered to a constant 0");
+ case Intrinsic::readcyclecounter: {
+ errs() << "WARNING: this target does not support the llvm.readcyclecoun"
+ << "ter intrinsic. It is being lowered to a constant 0\n";
CI->replaceAllUsesWith(ConstantInt::get(Type::getInt64Ty(Context), 0));
break;
+ }
case Intrinsic::dbg_declare:
break; // Simply strip out debugging intrinsics