Reject "llvm." as a function name

llvm-svn: 8608
This commit is contained in:
Chris Lattner 2003-09-19 19:31:41 +00:00
parent 2da29177ba
commit 3284ed725a
1 changed files with 3 additions and 1 deletions

View File

@ -158,9 +158,11 @@ void Function::dropAllReferences() {
/// llvm/Intrinsics.h.
///
unsigned Function::getIntrinsicID() const {
if (getName().size() <= 5 || getName()[4] != '.' || getName()[0] != 'l' ||
if (getName().size() < 5 || getName()[4] != '.' || getName()[0] != 'l' ||
getName()[1] != 'l' || getName()[2] != 'v' || getName()[3] != 'm')
return 0; // All intrinsics start with 'llvm.'
assert(getName().size() != 5 && "'llvm.' is an invalid intrinsic name!");
// a table of all Alpha intrinsic functions
struct {