projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for passing -main-file-name all the way through to
[oota-llvm.git]
/
lib
/
MC
/
MCContext.cpp
diff --git
a/lib/MC/MCContext.cpp
b/lib/MC/MCContext.cpp
index 29727ac8a6a4a8bfa238e12fd8fa73364dc920d3..d206dd9f5041d1f63df1d1ff4de163ae10d1cc26 100644
(file)
--- a/
lib/MC/MCContext.cpp
+++ b/
lib/MC/MCContext.cpp
@@
-21,6
+21,7
@@
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/SourceMgr.h"
using namespace llvm;
#include "llvm/Support/Signals.h"
#include "llvm/Support/SourceMgr.h"
using namespace llvm;
@@
-48,6
+49,11
@@
MCContext::MCContext(const MCAsmInfo &mai, const MCRegisterInfo &mri,
SecureLogFile = getenv("AS_SECURE_LOG_FILE");
SecureLog = 0;
SecureLogUsed = false;
SecureLogFile = getenv("AS_SECURE_LOG_FILE");
SecureLog = 0;
SecureLogUsed = false;
+
+ if (SrcMgr && SrcMgr->getNumBuffers() > 0)
+ MainFileName = SrcMgr->getMemoryBuffer(0)->getBufferIdentifier();
+ else
+ MainFileName = "";
}
MCContext::~MCContext() {
}
MCContext::~MCContext() {