-/// 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
-/// zero to allow easy checking for whether a function is intrinsic or not. The
-/// particular intrinsic functions which correspond to this value are defined in
-/// llvm/Intrinsics.h. Results are cached in the LLVM context, subsequent
-/// requests for the same ID return results much faster from the cache.
-///
-unsigned Function::getIntrinsicID() const {
- const ValueName *ValName = this->getValueName();
- if (!ValName || !isIntrinsic())
- return 0;
-
- LLVMContextImpl::IntrinsicIDCacheTy &IntrinsicIDCache =
- getContext().pImpl->IntrinsicIDCache;
- if (!IntrinsicIDCache.count(this)) {
- unsigned Id = lookupIntrinsicID();
- 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();
+/// \brief This does the actual lookup of an intrinsic ID which
+/// matches the given function name.
+static Intrinsic::ID lookupIntrinsicID(const ValueName *ValName) {