aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-18 00:25:38 +0000
committerChris Lattner <sabre@nondot.org>2007-12-18 00:25:38 +0000
commit7acda7c4a0e4aec6c003b3169ca45a5f3bc7e033 (patch)
tree51c00d9ff14a1c0324d1f1af826875e65f3cf234 /CodeGen/CodeGenModule.cpp
parent8d54bf2e280bdfc917e7faacbf99ae477d8aa6db (diff)
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
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r--CodeGen/CodeGenModule.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index 76bf40353a..a09932e141 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -570,6 +570,11 @@ llvm::Function *CodeGenModule::getBuiltinLibFunction(unsigned BuiltinID) {
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 @@ llvm::Function *CodeGenModule::getMemCpyFn() {
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 =