diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2015-05-19 00:02:25 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2015-05-19 00:02:25 +0000 |
| commit | 212411356911f46df9e17331c0197f1cef7bc625 (patch) | |
| tree | 0f21c7a72178166fd0f849da2682b2cd5df11f2d /llvm/lib/IR/Function.cpp | |
| parent | 09e9079d5c73f19ed80095a5b9fcdd888cc89c56 (diff) | |
| download | llvm-212411356911f46df9e17331c0197f1cef7bc625.zip llvm-212411356911f46df9e17331c0197f1cef7bc625.tar.gz llvm-212411356911f46df9e17331c0197f1cef7bc625.tar.bz2 | |
Move Function::lookupIntrinsicID to a static method. NFC
llvm-svn: 237641
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
| -rw-r--r-- | llvm/lib/IR/Function.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index a5d4d1c..71e07ea 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -433,6 +433,19 @@ void Function::copyAttributesFrom(const GlobalValue *Src) { setPrologueData(nullptr); } +/// \brief This does the actual lookup of an intrinsic ID which +/// matches the given function name. +static Intrinsic::ID lookupIntrinsicID(const ValueName *ValName) { + unsigned Len = ValName->getKeyLength(); + const char *Name = ValName->getKeyData(); + +#define GET_FUNCTION_RECOGNIZER +#include "llvm/IR/Intrinsics.gen" +#undef GET_FUNCTION_RECOGNIZER + + return Intrinsic::not_intrinsic; +} + /// getIntrinsicID - This method returns the ID number of the specified /// function, or Intrinsic::not_intrinsic if the function is not an /// intrinsic, or if the pointer is null. This value is always defined to be @@ -449,27 +462,13 @@ unsigned Function::getIntrinsicID() const { LLVMContextImpl::IntrinsicIDCacheTy &IntrinsicIDCache = getContext().pImpl->IntrinsicIDCache; if (!IntrinsicIDCache.count(this)) { - unsigned Id = lookupIntrinsicID(); + unsigned Id = lookupIntrinsicID(ValName); IntrinsicIDCache[this]=Id; return Id; } return IntrinsicIDCache[this]; } -/// This private method does the actual lookup of an intrinsic ID when the query -/// could not be answered from the cache. -unsigned Function::lookupIntrinsicID() const { - const ValueName *ValName = this->getValueName(); - unsigned Len = ValName->getKeyLength(); - const char *Name = ValName->getKeyData(); - -#define GET_FUNCTION_RECOGNIZER -#include "llvm/IR/Intrinsics.gen" -#undef GET_FUNCTION_RECOGNIZER - - return 0; -} - /// Returns a stable mangling for the type specified for use in the name /// mangling scheme used by 'any' types in intrinsic signatures. The mangling /// of named types is simply their name. Manglings for unnamed types consist |
