llvm.org GIT mirror llvm / 2cb1ad9
teach this to read from bitcode files git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36843 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1414 #include "llvm/Module.h"
1515 #include "llvm/ModuleProvider.h"
1616 #include "llvm/Bytecode/Reader.h"
17 #include "llvm/Bitcode/ReaderWriter.h"
1718 #include "llvm/Debugger/InferiorProcess.h"
19 #include "llvm/Support/MemoryBuffer.h"
1820 #include "llvm/ADT/StringExtras.h"
1921 #include
2022 using namespace llvm;
23
24 static bool Bitcode = false;
2125
2226 /// Debugger constructor - Initialize the debugger to its initial, empty, state.
2327 ///
4448
4549 static Module *
4650 getMaterializedModuleProvider(const std::string &Filename) {
47 return ParseBytecodeFile(Filename);
51 if (Bitcode) {
52 return ParseBytecodeFile(Filename);
53 } else {
54 std::auto_ptr Buffer;
55 Buffer.reset(MemoryBuffer::getFileOrSTDIN(&Filename[0], Filename.size()));
56 if (Buffer.get())
57 return ParseBitcodeFile(Buffer.get());
58 return 0;
59 }
4860 }
4961
5062 /// loadProgram - If a program is currently loaded, unload it. Then search