Hold the LLVMContext by reference rather than by pointer.
[oota-llvm.git] / lib / Debugger / Debugger.cpp
index dbfbbed1dc5491ad3d623eec830b33044ccdb52d..61d8358d08d57a8d6a312fa35c2e25db2c69d040 100644 (file)
@@ -46,7 +46,8 @@ std::string Debugger::getProgramPath() const {
 }
 
 static Module *
-getMaterializedModuleProvider(const std::string &Filename, LLVMContext* C) {
+getMaterializedModuleProvider(const std::string &Filename,
+                              const LLVMContext& C) {
   std::auto_ptr<MemoryBuffer> Buffer;
   Buffer.reset(MemoryBuffer::getFileOrSTDIN(Filename.c_str()));
   if (Buffer.get())
@@ -58,7 +59,7 @@ getMaterializedModuleProvider(const std::string &Filename, LLVMContext* C) {
 /// 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, LLVMContext* C) {
+void Debugger::loadProgram(const std::string &Filename, const LLVMContext& C) {
   if ((Program = getMaterializedModuleProvider(Filename, C)) ||
       (Program = getMaterializedModuleProvider(Filename+".bc", C)))
     return;   // Successfully loaded the program.