summaryrefslogtreecommitdiffstats
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-16 17:45:50 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-16 17:45:50 +0000
commit5b35fbe6b95fd4310cf46eeb9f3c403a67ade6d3 (patch)
treec9c2e18a75c67428e45dbf9fb03750287f7ce48d /lib/AsmParser
parenteb1d74e0c8b2c08b98e9175be137ec4ae617a8b7 (diff)
downloadexternal_llvm-5b35fbe6b95fd4310cf46eeb9f3c403a67ade6d3.zip
external_llvm-5b35fbe6b95fd4310cf46eeb9f3c403a67ade6d3.tar.gz
external_llvm-5b35fbe6b95fd4310cf46eeb9f3c403a67ade6d3.tar.bz2
Use a more optimal way to get the name of a function. Thanks, Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/llvmAsmParser.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 88cc7d3..5544008 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -2823,7 +2823,8 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
// Check for call to invalid intrinsic to avoid crashing later.
if (Function *theF = dyn_cast<Function>(V)) {
- if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&&
+ if (theF->hasName() &&
+ 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) &&
!theF->getIntrinsicID(true))
GEN_ERROR("Call to invalid LLVM intrinsic function '" +
theF->getName() + "'");