[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y

Chris Lattner clattner at apple.com
Mon Apr 16 13:17:27 PDT 2007


> Use a more optimal way to get the name of a function. Thanks, Chris.

Cool, please check that the name is >= 5 chars long too :)

-Chris

>
> ---
> Diffs of the changes:  (+2 -1)
>
>  llvmAsmParser.y |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletion(-)
>
>
> Index: llvm/lib/AsmParser/llvmAsmParser.y
> diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.340 llvm/lib/AsmParser/ 
> llvmAsmParser.y:1.341
> --- llvm/lib/AsmParser/llvmAsmParser.y:1.340	Mon Apr 16 01:55:42 2007
> +++ llvm/lib/AsmParser/llvmAsmParser.y	Mon Apr 16 12:45:50 2007
> @@ -2823,7 +2823,8 @@
>
>      // 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() + "'");
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list