From 8809c4027092bcce5d0588cc2a907fd99fba9a01 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 22 Mar 2016 22:24:29 +0000 Subject: 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 --- llvm/lib/MC/MCContext.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'llvm/lib/MC/MCContext.cpp') diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index c5243ef..96e24de 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; -- cgit v1.1