[arcmt] Remove some dead code.

Patch by Rafael Espíndola.

llvm-svn: 186462
This commit is contained in:
Argyrios Kyrtzidis 2013-07-16 22:24:06 +00:00
parent 57a113eb0d
commit 884bee86a6
2 changed files with 14 additions and 28 deletions

View File

@ -53,7 +53,6 @@ public:
StringRef outputDir = StringRef());
void remap(StringRef filePath, llvm::MemoryBuffer *memBuf);
void remap(StringRef filePath, StringRef newPath);
void applyMappings(PreprocessorOptions &PPOpts) const;

View File

@ -174,29 +174,22 @@ bool FileRemapper::overwriteOriginal(DiagnosticsEngine &Diag,
for (MappingsTy::iterator
I = FromToMappings.begin(), E = FromToMappings.end(); I != E; ++I) {
const FileEntry *origFE = I->first;
if (const FileEntry *newFE = I->second.dyn_cast<const FileEntry *>()) {
if (fs::copy_file(newFE->getName(), origFE->getName(),
fs::copy_option::overwrite_if_exists) != llvm::errc::success)
return report(StringRef("Could not copy file '") + newFE->getName() +
"' to file '" + origFE->getName() + "'", Diag);
} else {
assert(I->second.is<llvm::MemoryBuffer *>());
bool fileExists = false;
fs::exists(origFE->getName(), fileExists);
if (!fileExists)
return report(StringRef("File does not exist: ") + origFE->getName(),
Diag);
bool fileExists = false;
fs::exists(origFE->getName(), fileExists);
if (!fileExists)
return report(StringRef("File does not exist: ") + origFE->getName(),
Diag);
std::string errMsg;
llvm::raw_fd_ostream Out(origFE->getName(), errMsg,
llvm::sys::fs::F_Binary);
if (!errMsg.empty())
return report(errMsg, Diag);
std::string errMsg;
llvm::raw_fd_ostream Out(origFE->getName(), errMsg,
llvm::sys::fs::F_Binary);
if (!errMsg.empty())
return report(errMsg, Diag);
llvm::MemoryBuffer *mem = I->second.get<llvm::MemoryBuffer *>();
Out.write(mem->getBufferStart(), mem->getBufferSize());
Out.close();
}
llvm::MemoryBuffer *mem = I->second.get<llvm::MemoryBuffer *>();
Out.write(mem->getBufferStart(), mem->getBufferSize());
Out.close();
}
clear(outputDir);
@ -237,12 +230,6 @@ void FileRemapper::remap(StringRef filePath, llvm::MemoryBuffer *memBuf) {
remap(getOriginalFile(filePath), memBuf);
}
void FileRemapper::remap(StringRef filePath, StringRef newPath) {
const FileEntry *file = getOriginalFile(filePath);
const FileEntry *newfile = FileMgr->getFile(newPath);
remap(file, newfile);
}
void FileRemapper::remap(const FileEntry *file, llvm::MemoryBuffer *memBuf) {
assert(file);
Target &targ = FromToMappings[file];