Fix big-endian codegen bug. We're splitting up
[oota-llvm.git] / lib / VMCore / Function.cpp
index bda2eff4c99c3b48140e1ac7938f8e6fa225f742..cff4457a41804559cc234545082c87896f011424 100644 (file)
@@ -175,7 +175,7 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
     ParentModule->getFunctionList().push_back(this);
 
   // Ensure intrinsics have the right parameter attributes.
-  if (unsigned IID = getIntrinsicID(true))
+  if (unsigned IID = getIntrinsicID())
     setAttributes(Intrinsic::getAttributes(Intrinsic::ID(IID)));
 
 }
@@ -304,7 +304,7 @@ void Function::copyAttributesFrom(const GlobalValue *Src) {
 /// particular intrinsic functions which correspond to this value are defined in
 /// llvm/Intrinsics.h.
 ///
-unsigned Function::getIntrinsicID(bool noAssert) const {
+unsigned Function::getIntrinsicID() const {
   const ValueName *ValName = this->getValueName();
   if (!ValName)
     return 0;
@@ -315,12 +315,9 @@ unsigned Function::getIntrinsicID(bool noAssert) const {
       || 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;
 }
 
@@ -359,6 +356,16 @@ const FunctionType *Intrinsic::getType(ID id, const Type **Tys,
   return FunctionType::get(ResultTy, ArgTys, IsVarArg); 
 }
 
+bool Intrinsic::isOverloaded(ID id) {
+  const bool OTable[] = {
+    false,
+#define GET_INTRINSIC_OVERLOAD_TABLE
+#include "llvm/Intrinsics.gen"
+#undef GET_INTRINSIC_OVERLOAD_TABLE
+  };
+  return OTable[id];
+}
+
 /// This defines the "Intrinsic::getAttributes(ID id)" method.
 #define GET_INTRINSIC_ATTRIBUTES
 #include "llvm/Intrinsics.gen"
@@ -373,4 +380,9 @@ Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
                                           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