Modified the check for intrinsic functions. All intrinsic functions have to
authorJohn Criswell <criswell@uiuc.edu>
Tue, 9 Sep 2003 16:36:09 +0000 (16:36 +0000)
committerJohn Criswell <criswell@uiuc.edu>
Tue, 9 Sep 2003 16:36:09 +0000 (16:36 +0000)
be at least 6 characters, since something must follow the "llvm." string in the
function name.
This seems to fix an assertion failure with the SingleSource tests, too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8418 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Function.cpp

index 74098ffc45ae1266e274a7bd2e5619b2980801d1..5ef4ce47a99e0bb39dd56c983b94356a44101be7 100644 (file)
@@ -159,7 +159,7 @@ void Function::dropAllReferences() {
 /// llvm/Intrinsics.h.
 ///
 unsigned Function::getIntrinsicID() const {
-  if (getName().size() <= 5 || getName()[4] != '.' || getName()[0] != 'l' ||
+  if (getName().size() <= 6 || getName()[4] != '.' || getName()[0] != 'l' ||
       getName()[1] != 'l' || getName()[2] != 'v' || getName()[3] != 'm')
     return 0;  // All intrinsics start with 'llvm.'