for assembly output as well. The integrated assembler can be disabled with
the ``-no-integrated-as`` option,
+* llvm-ar now handles IR files like regular object files. In particular, a
+ regular symbol table is created for symbols defined in IR files.
+
.. NOTE
For small 1-3 sentence descriptions, just add an entry at the end of
this list. If your description won't fit comfortably in one bullet
#include "llvm/Object/SymbolicFile.h"
namespace llvm {
+class Mangler;
class Module;
class GlobalValue;
namespace object {
class IRObjectFile : public SymbolicFile {
OwningPtr<Module> M;
+ OwningPtr<Mangler> Mang;
public:
IRObjectFile(MemoryBuffer *Object, error_code &EC, LLVMContext &Context,
bool BufferOwned);
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Mangler.h"
#include "llvm/IR/Module.h"
#include "llvm/Object/IRObjectFile.h"
#include "llvm/Support/raw_ostream.h"
return;
M.reset(MOrErr.get());
+
+ // If we have a DataLayout, setup a mangler.
+ const DataLayout *DL = M->getDataLayout();
+ if (!DL)
+ return;
+
+ Mang.reset(new Mangler(DL));
}
static const GlobalValue &getGV(DataRefImpl &Symb) {
error_code IRObjectFile::printSymbolName(raw_ostream &OS,
DataRefImpl Symb) const {
- // FIXME: This should use the Mangler.
const GlobalValue &GV = getGV(Symb);
- OS << GV.getName();
+
+ if (Mang)
+ Mang->getNameWithPrefix(OS, &GV, false);
+ else
+ OS << GV.getName();
+
return object_error::success;
}