diff options
Diffstat (limited to 'lib/Debugger')
-rw-r--r-- | lib/Debugger/Debugger.cpp | 17 | ||||
-rw-r--r-- | lib/Debugger/ProgramInfo.cpp | 6 |
2 files changed, 11 insertions, 12 deletions
diff --git a/lib/Debugger/Debugger.cpp b/lib/Debugger/Debugger.cpp index b12d90ac9db0..77fd2ac96bea 100644 --- a/lib/Debugger/Debugger.cpp +++ b/lib/Debugger/Debugger.cpp @@ -46,11 +46,12 @@ std::string Debugger::getProgramPath() const { } static Module * -getMaterializedModuleProvider(const std::string &Filename) { +getMaterializedModuleProvider(const std::string &Filename, + LLVMContext& C) { std::auto_ptr<MemoryBuffer> Buffer; Buffer.reset(MemoryBuffer::getFileOrSTDIN(Filename.c_str())); if (Buffer.get()) - return ParseBitcodeFile(Buffer.get()); + return ParseBitcodeFile(Buffer.get(), C); return 0; } @@ -58,9 +59,9 @@ getMaterializedModuleProvider(const std::string &Filename) { /// the PATH for the specified program, loading it when found. If the /// specified program cannot be found, an exception is thrown to indicate the /// error. -void Debugger::loadProgram(const std::string &Filename) { - if ((Program = getMaterializedModuleProvider(Filename)) || - (Program = getMaterializedModuleProvider(Filename+".bc"))) +void Debugger::loadProgram(const std::string &Filename, LLVMContext& C) { + if ((Program = getMaterializedModuleProvider(Filename, C)) || + (Program = getMaterializedModuleProvider(Filename+".bc", C))) return; // Successfully loaded the program. // Search the program path for the file... @@ -69,9 +70,9 @@ void Debugger::loadProgram(const std::string &Filename) { std::string Directory = getToken(Path, ":"); while (!Directory.empty()) { - if ((Program = getMaterializedModuleProvider(Directory +"/"+ Filename)) || - (Program = getMaterializedModuleProvider(Directory +"/"+ Filename - + ".bc"))) + if ((Program = getMaterializedModuleProvider(Directory +"/"+ Filename, C)) + || (Program = getMaterializedModuleProvider(Directory +"/"+ Filename + + ".bc", C))) return; // Successfully loaded the program. Directory = getToken(Path, ":"); diff --git a/lib/Debugger/ProgramInfo.cpp b/lib/Debugger/ProgramInfo.cpp index 125ff556dd50..e58b3d58e6d1 100644 --- a/lib/Debugger/ProgramInfo.cpp +++ b/lib/Debugger/ProgramInfo.cpp @@ -271,8 +271,7 @@ ProgramInfo::getSourceFiles(bool RequiresCompleteMap) { // should be on the use list of the llvm.dbg.translation_units global. // GlobalVariable *Units = - M->getGlobalVariable("llvm.dbg.translation_units", - StructType::get(std::vector<const Type*>())); + M->getGlobalVariable("llvm.dbg.translation_units", StructType::get()); if (Units == 0) throw "Program contains no debugging information!"; @@ -354,8 +353,7 @@ ProgramInfo::getSourceFunctions(bool RequiresCompleteMap) { // should be on the use list of the llvm.dbg.translation_units global. // GlobalVariable *Units = - M->getGlobalVariable("llvm.dbg.globals", - StructType::get(std::vector<const Type*>())); + M->getGlobalVariable("llvm.dbg.globals", StructType::get()); if (Units == 0) throw "Program contains no debugging information!"; |