Implement rdar://6295824 and PR6724 with two tiny changes
[oota-llvm.git] / lib / Target / Blackfin / BlackfinIntrinsicInfo.cpp
index c8c592539513a9a78b6053bdaea46ea5bc455d02..34a8d3809ea23c0648738e3ae868c651aa4b0a72 100644 (file)
@@ -53,6 +53,10 @@ std::string BlackfinIntrinsicInfo::getName(unsigned IntrID, const Type **Tys,
 
 unsigned
 BlackfinIntrinsicInfo::lookupName(const char *Name, unsigned Len) const {
+  if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
+      || Name[2] != 'v' || Name[3] != 'm')
+    return 0;  // All intrinsics start with 'llvm.'
+
 #define GET_FUNCTION_RECOGNIZER
 #include "BlackfinGenIntrinsics.inc"
 #undef GET_FUNCTION_RECOGNIZER
@@ -62,7 +66,6 @@ BlackfinIntrinsicInfo::lookupName(const char *Name, unsigned Len) const {
 bool BlackfinIntrinsicInfo::isOverloaded(unsigned IntrID) const {
   // Overload Table
   const bool OTable[] = {
-    false,  // illegal intrinsic
 #define GET_INTRINSIC_OVERLOAD_TABLE
 #include "BlackfinGenIntrinsics.inc"
 #undef GET_INTRINSIC_OVERLOAD_TABLE