aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lto/LTOModule.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-01 21:22:36 +0000
committerOwen Anderson <resistor@mac.com>2009-07-01 21:22:36 +0000
commita148fdd8312c060c65bacf8fe61a6db5b2add6a5 (patch)
tree9e5f714db4af7dddfab061cb0016489f6d114c56 /tools/lto/LTOModule.cpp
parenta0619e843be1fcf8fba618ed93207cf5db42cc26 (diff)
downloadexternal_llvm-a148fdd8312c060c65bacf8fe61a6db5b2add6a5.zip
external_llvm-a148fdd8312c060c65bacf8fe61a6db5b2add6a5.tar.gz
external_llvm-a148fdd8312c060c65bacf8fe61a6db5b2add6a5.tar.bz2
Hold the LLVMContext by reference rather than by pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto/LTOModule.cpp')
-rw-r--r--tools/lto/LTOModule.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index 64e7950..3da095d 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -69,7 +69,7 @@ bool LTOModule::isBitcodeFileForTarget(const char* path,
bool LTOModule::isTargetMatch(MemoryBuffer* buffer, const char* triplePrefix)
{
OwningPtr<ModuleProvider> mp(getBitcodeModuleProvider(buffer,
- new LLVMContext()));
+ *new LLVMContext()));
// on success, mp owns buffer and both are deleted at end of this method
if ( !mp ) {
delete buffer;
@@ -86,7 +86,8 @@ LTOModule::LTOModule(Module* m, TargetMachine* t)
{
}
-LTOModule* LTOModule::makeLTOModule(const char* path, LLVMContext* Context,
+LTOModule* LTOModule::makeLTOModule(const char* path,
+ const LLVMContext& Context,
std::string& errMsg)
{
OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, &errMsg));
@@ -112,7 +113,7 @@ MemoryBuffer* LTOModule::makeBuffer(const void* mem, size_t length)
LTOModule* LTOModule::makeLTOModule(const void* mem, size_t length,
- LLVMContext* Context,
+ const LLVMContext& Context,
std::string& errMsg)
{
OwningPtr<MemoryBuffer> buffer(makeBuffer(mem, length));
@@ -140,7 +141,8 @@ std::string getFeatureString(const char *TargetTriple) {
return Features.getString();
}
-LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer, LLVMContext* Context,
+LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer,
+ const LLVMContext& Context,
std::string& errMsg)
{
// parse bitcode buffer