Fix "existant" typos
[oota-llvm.git] / lib / CodeGen / IntrinsicLowering.cpp
index 16e7968eb45b0cb35de754025b3dc03a0f6bfd6d..d894f664dcb3dd19c2abd33e0c3dd8a54f2704fb 100644 (file)
@@ -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
@@ -461,6 +453,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
     CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
     break;
 
+  case Intrinsic::annotation:
+  case Intrinsic::ptr_annotation:
+    // Just drop the annotation, but forward the value
+    CI->replaceAllUsesWith(CI->getOperand(0));
+    break;
+
   case Intrinsic::var_annotation:
     break;   // Strip out annotate intrinsic