From c94dad9d974b0f12417e17e05d77bcf05f4f720f Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 22 Feb 2019 23:59:43 +0000 Subject: [PATCH] Remove a function from header and move the implementation to a .cpp file. NFC. llvm-svn: 354703 --- lld/Common/Reproduce.cpp | 6 ------ lld/ELF/DriverUtils.cpp | 6 ++++++ lld/include/lld/Common/Reproduce.h | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lld/Common/Reproduce.cpp b/lld/Common/Reproduce.cpp index cae8512..ce33d36 100644 --- a/lld/Common/Reproduce.cpp +++ b/lld/Common/Reproduce.cpp @@ -48,12 +48,6 @@ std::string lld::quote(StringRef S) { return S; } -std::string lld::rewritePath(StringRef S) { - if (fs::exists(S)) - return relativeToRoot(S); - return S; -} - std::string lld::toString(const opt::Arg &Arg) { std::string K = Arg.getSpelling(); if (Arg.getNumValues() == 0) diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp index 4f2ef4d..3d62dd5 100644 --- a/lld/ELF/DriverUtils.cpp +++ b/lld/ELF/DriverUtils.cpp @@ -151,6 +151,12 @@ void elf::printHelp() { outs() << Config->ProgName << ": supported targets: elf\n"; } +static std::string rewritePath(StringRef S) { + if (fs::exists(S)) + return relativeToRoot(S); + return S; +} + // Reconstructs command line arguments so that so that you can re-run // the same command with the same inputs. This is for --reproduce. std::string elf::createResponseFile(const opt::InputArgList &Args) { diff --git a/lld/include/lld/Common/Reproduce.h b/lld/include/lld/Common/Reproduce.h index ac7a822..3ebd11d 100644 --- a/lld/include/lld/Common/Reproduce.h +++ b/lld/include/lld/Common/Reproduce.h @@ -27,10 +27,6 @@ std::string relativeToRoot(StringRef Path); // Quote a given string if it contains a space character. std::string quote(StringRef S); -// Rewrite the given path if a file exists with that pathname, otherwise -// returns the original path. -std::string rewritePath(StringRef S); - // Returns the string form of the given argument. std::string toString(const llvm::opt::Arg &Arg); } -- 2.7.4