Reverting 63765. This broke the build of both clang
and llvm-gcc.
llvm-svn: 63786
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index bc3b611..bda2eff 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -175,7 +175,7 @@
ParentModule->getFunctionList().push_back(this);
// Ensure intrinsics have the right parameter attributes.
- if (unsigned IID = getIntrinsicID())
+ if (unsigned IID = getIntrinsicID(true))
setAttributes(Intrinsic::getAttributes(Intrinsic::ID(IID)));
}
@@ -304,7 +304,7 @@
/// particular intrinsic functions which correspond to this value are defined in
/// llvm/Intrinsics.h.
///
-unsigned Function::getIntrinsicID() const {
+unsigned Function::getIntrinsicID(bool noAssert) const {
const ValueName *ValName = this->getValueName();
if (!ValName)
return 0;
@@ -315,9 +315,12 @@
|| Name[2] != 'v' || Name[3] != 'm')
return 0; // All intrinsics start with 'llvm.'
+ assert((Len != 5 || noAssert) && "'llvm.' is an invalid intrinsic name!");
+
#define GET_FUNCTION_RECOGNIZER
#include "llvm/Intrinsics.gen"
#undef GET_FUNCTION_RECOGNIZER
+ assert(noAssert && "Invalid LLVM intrinsic name");
return 0;
}
@@ -370,9 +373,4 @@
getType(id, Tys, numTys)));
}
-// This defines the "Intrinsic::getIntrinsicForGCCBuiltin()" method.
-#define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
-#include "llvm/Intrinsics.gen"
-#undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
-
// vim: sw=2 ai