[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp
Chris Lattner
clattner at apple.com
Mon Apr 16 09:00:44 PDT 2007
> -unsigned Function::getIntrinsicID() const {
> +unsigned Function::getIntrinsicID(bool noAssert) const {
> const ValueName *ValName = this->getValueName();
> unsigned Len = ValName->getKeyLength();
> const char *Name = ValName->getKeyData();
>
> - if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
> + if (Len <= 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
I don't think this is right. It will incorrectly return 0 for
"llvm." even if noAssert is false.
-Chris
> || Name[2] != 'v' || Name[3] != 'm')
> return 0; // All intrinsics start with 'llvm.'
>
> - assert(Len != 5 && "'llvm.' is an invalid intrinsic name!");
> + assert((Len != 5 || noAssert) && "'llvm.' is an invalid
> intrinsic name!");
>
> #define GET_FUNCTION_RECOGNIZER
> #include "llvm/Intrinsics.gen"
> #undef GET_FUNCTION_RECOGNIZER
> + assert(noAssert && "Invalid LLVM intrinsic name");
> return 0;
> }
>
>
>
>
> _______________________________________________
> 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