- IRObjectFile(MemoryBuffer *Object, error_code &EC, LLVMContext &Context,
- bool BufferOwned);
- void moveSymbolNext(DataRefImpl &Symb) const LLVM_OVERRIDE;
- error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const
- LLVM_OVERRIDE;
- uint32_t getSymbolFlags(DataRefImpl Symb) const LLVM_OVERRIDE;
- const GlobalValue &getSymbolGV(DataRefImpl Symb) const;
- basic_symbol_iterator symbol_begin_impl() const LLVM_OVERRIDE;
- basic_symbol_iterator symbol_end_impl() const LLVM_OVERRIDE;
+ IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> M);
+ ~IRObjectFile();
+ void moveSymbolNext(DataRefImpl &Symb) const override;
+ std::error_code printSymbolName(raw_ostream &OS,
+ DataRefImpl Symb) const override;
+ uint32_t getSymbolFlags(DataRefImpl Symb) const override;
+ GlobalValue *getSymbolGV(DataRefImpl Symb);
+ const GlobalValue *getSymbolGV(DataRefImpl Symb) const {
+ return const_cast<IRObjectFile *>(this)->getSymbolGV(Symb);
+ }
+ basic_symbol_iterator symbol_begin_impl() const override;
+ basic_symbol_iterator symbol_end_impl() const override;
+
+ const Module &getModule() const {
+ return const_cast<IRObjectFile*>(this)->getModule();
+ }
+ Module &getModule() {
+ return *M;
+ }
+ std::unique_ptr<Module> takeModule();