summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-03-22 22:24:29 +0000
committerJustin Bogner <mail@justinbogner.com>2016-03-22 22:24:29 +0000
commit8809c4027092bcce5d0588cc2a907fd99fba9a01 (patch)
tree1b8c656ba444dfd02790afd0bb5d9204adc475e0 /llvm/lib/MC/MCContext.cpp
parentbfb75e9bbceae6e872107df5c4e8c367291fdd53 (diff)
downloadbcm5719-llvm-8809c4027092bcce5d0588cc2a907fd99fba9a01.tar.gz
bcm5719-llvm-8809c4027092bcce5d0588cc2a907fd99fba9a01.zip
MC: Don't access the filesystem in MCContext's constructor
MCContext shouldn't be accessing the filesystem - that's a gross layering violation and makes it awkward to use as a library or in a daemon where it may not even be allowed filesystem access. The CWD lookup here is normally redundant anyway, since the calling context either also looks up the CWD or sets this to something more specific. Here, we fix up the one caller that doesn't already set up a debug compilation dir and make it clear that the responsibility for such set up is in the users of MCContext. llvm-svn: 264109
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index c5243ef62c9..96e24de6b4d 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -44,11 +44,6 @@ MCContext::MCContext(const MCAsmInfo *mai, const MCRegisterInfo *mri,
GenDwarfForAssembly(false), GenDwarfFileNumber(0), DwarfVersion(4),
AllowTemporaryLabels(true), DwarfCompileUnitID(0),
AutoReset(DoAutoReset), HadError(false) {
-
- std::error_code EC = llvm::sys::fs::current_path(CompilationDir);
- if (EC)
- CompilationDir.clear();
-
SecureLogFile = getenv("AS_SECURE_LOG_FILE");
SecureLog = nullptr;
SecureLogUsed = false;
OpenPOWER on IntegriCloud