diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-12-18 00:25:38 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-12-18 00:25:38 +0000 |
| commit | b8be97e2391cf9c91a72a3de531c77a39f51ed61 (patch) | |
| tree | 4a6b5231f258f9e68ebd372715c865e580585b24 /clang/CodeGen/CodeGenModule.cpp | |
| parent | 2050b0d05abc60b72257297252f44ee6bf59a294 (diff) | |
| download | bcm5719-llvm-b8be97e2391cf9c91a72a3de531c77a39f51ed61.tar.gz bcm5719-llvm-b8be97e2391cf9c91a72a3de531c77a39f51ed61.zip | |
introduce a new CodeGenModule::getIntrinsic method, which wraps
Intrinsic::getDeclaration, allowing much more terse code.
llvm-svn: 45136
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index 76bf40353ae..a09932e141c 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/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 = |

