Index: lld/trunk/lib/Driver/DarwinLdDriver.cpp =================================================================== --- lld/trunk/lib/Driver/DarwinLdDriver.cpp +++ lld/trunk/lib/Driver/DarwinLdDriver.cpp @@ -69,9 +69,11 @@ DarwinLdOptTable() : OptTable(infoTable, llvm::array_lengthof(infoTable)){} }; +} // anonymous namespace + // Test may be running on Windows. Canonicalize the path // separator to '/' to get consistent outputs for tests. -std::string canonicalizePath(StringRef path) { +static std::string canonicalizePath(StringRef path) { char sep = llvm::sys::path::get_separator().front(); if (sep != '/') { std::string fixedPath = path; @@ -82,17 +84,17 @@ } } -void addFile(StringRef path, std::unique_ptr &inputGraph, - bool forceLoad) { +static void addFile(StringRef path, std::unique_ptr &inputGraph, + bool forceLoad) { inputGraph->addInputElement(std::unique_ptr( new MachOFileNode(path, forceLoad))); } // Export lists are one symbol per line. Blank lines are ignored. // Trailing comments start with #. -std::error_code parseExportsList(StringRef exportFilePath, - MachOLinkingContext &ctx, - raw_ostream &diagnostics) { +static std::error_code parseExportsList(StringRef exportFilePath, + MachOLinkingContext &ctx, + raw_ostream &diagnostics) { // Map in export list file. ErrorOr> mb = MemoryBuffer::getFileOrSTDIN(exportFilePath); @@ -124,10 +126,10 @@ // In this variant, the path is to a text file which contains a partial path // per line. The prefix is prepended to each partial path. // -std::error_code parseFileList(StringRef fileListPath, - std::unique_ptr &inputGraph, - MachOLinkingContext &ctx, bool forceLoad, - raw_ostream &diagnostics) { +static std::error_code parseFileList(StringRef fileListPath, + std::unique_ptr &inputGraph, + MachOLinkingContext &ctx, bool forceLoad, + raw_ostream &diagnostics) { // If there is a comma, split off . std::pair opt = fileListPath.split(','); StringRef filePath = opt.first; @@ -168,14 +170,12 @@ } /// Parse number assuming it is base 16, but allow 0x prefix. -bool parseNumberBase16(StringRef numStr, uint64_t &baseAddress) { +static bool parseNumberBase16(StringRef numStr, uint64_t &baseAddress) { if (numStr.startswith_lower("0x")) numStr = numStr.drop_front(2); return numStr.getAsInteger(16, baseAddress); } -} // namespace anonymous - namespace lld { bool DarwinLdDriver::linkMachO(int argc, const char *argv[],