summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Debugger/Debugger.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-01 16:58:40 +0000
committerOwen Anderson <resistor@mac.com>2009-07-01 16:58:40 +0000
commit6773d388aadf0c8588e3cda343ab621397fde38c (patch)
tree3fb6f8744c4739dd948237725a958d247f3073ea /llvm/lib/Debugger/Debugger.cpp
parent1f50b61329f84977a95708f4aad76b5391768f30 (diff)
downloadbcm5719-llvm-6773d388aadf0c8588e3cda343ab621397fde38c.tar.gz
bcm5719-llvm-6773d388aadf0c8588e3cda343ab621397fde38c.zip
Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. llvm-svn: 74614
Diffstat (limited to 'llvm/lib/Debugger/Debugger.cpp')
-rw-r--r--llvm/lib/Debugger/Debugger.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Debugger/Debugger.cpp b/llvm/lib/Debugger/Debugger.cpp
index b12d90ac9db..dbfbbed1dc5 100644
--- a/llvm/lib/Debugger/Debugger.cpp
+++ b/llvm/lib/Debugger/Debugger.cpp
@@ -46,11 +46,11 @@ 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 +58,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 +69,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, ":");
OpenPOWER on IntegriCloud