introduce a new CodeGenModule::getIntrinsic method, which wraps 
Intrinsic::getDeclaration, allowing much more terse code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45136 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index 76bf403..a09932e 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -570,6 +570,11 @@
                                            Name, &getModule());
 }
 
+llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,const llvm::Type **Tys,
+                                            unsigned NumTys) {
+  return llvm::Intrinsic::getDeclaration(&getModule(),
+                                         (llvm::Intrinsic::ID)IID, Tys, NumTys);
+}
 
 llvm::Function *CodeGenModule::getMemCpyFn() {
   if (MemCpyFn) return MemCpyFn;
@@ -581,9 +586,10 @@
   case 32: IID = llvm::Intrinsic::memcpy_i32; break;
   case 64: IID = llvm::Intrinsic::memcpy_i64; break;
   }
-  return MemCpyFn = llvm::Intrinsic::getDeclaration(&TheModule, IID);
+  return MemCpyFn = getIntrinsic(IID);
 }
 
+
 llvm::Constant *CodeGenModule::
 GetAddrOfConstantCFString(const std::string &str) {
   llvm::StringMapEntry<llvm::Constant *> &Entry =