diff options
Diffstat (limited to 'lld/COFF/Driver.h')
-rw-r--r-- | lld/COFF/Driver.h | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/lld/COFF/Driver.h b/lld/COFF/Driver.h index 1e9353118a6..6100c3ca0c9 100644 --- a/lld/COFF/Driver.h +++ b/lld/COFF/Driver.h @@ -30,7 +30,7 @@ namespace lld { namespace coff { class LinkerDriver; -extern LinkerDriver *Driver; +extern LinkerDriver *driver; using llvm::COFF::MachineTypes; using llvm::COFF::WindowsSubsystem; @@ -44,71 +44,71 @@ public: class ArgParser { public: // Concatenate LINK environment variable and given arguments and parse them. - llvm::opt::InputArgList parseLINK(std::vector<const char *> Args); + llvm::opt::InputArgList parseLINK(std::vector<const char *> args); // Tokenizes a given string and then parses as command line options. - llvm::opt::InputArgList parse(StringRef S) { return parse(tokenize(S)); } + llvm::opt::InputArgList parse(StringRef s) { return parse(tokenize(s)); } // Tokenizes a given string and then parses as command line options in // .drectve section. /EXPORT options are returned in second element // to be processed in fastpath. std::pair<llvm::opt::InputArgList, std::vector<StringRef>> - parseDirectives(StringRef S); + parseDirectives(StringRef s); private: // Parses command line options. - llvm::opt::InputArgList parse(llvm::ArrayRef<const char *> Args); + llvm::opt::InputArgList parse(llvm::ArrayRef<const char *> args); - std::vector<const char *> tokenize(StringRef S); + std::vector<const char *> tokenize(StringRef s); - COFFOptTable Table; + COFFOptTable table; }; class LinkerDriver { public: - void link(llvm::ArrayRef<const char *> Args); + void link(llvm::ArrayRef<const char *> args); // Used by the resolver to parse .drectve section contents. - void parseDirectives(InputFile *File); + void parseDirectives(InputFile *file); // Used by ArchiveFile to enqueue members. - void enqueueArchiveMember(const Archive::Child &C, StringRef SymName, - StringRef ParentName); + void enqueueArchiveMember(const Archive::Child &c, StringRef symName, + StringRef parentName); - MemoryBufferRef takeBuffer(std::unique_ptr<MemoryBuffer> MB); + MemoryBufferRef takeBuffer(std::unique_ptr<MemoryBuffer> mb); - void enqueuePath(StringRef Path, bool WholeArchive); + void enqueuePath(StringRef path, bool wholeArchive); private: - std::unique_ptr<llvm::TarWriter> Tar; // for /linkrepro + std::unique_ptr<llvm::TarWriter> tar; // for /linkrepro // Opens a file. Path has to be resolved already. - MemoryBufferRef openFile(StringRef Path); + MemoryBufferRef openFile(StringRef path); // Searches a file from search paths. - Optional<StringRef> findFile(StringRef Filename); - Optional<StringRef> findLib(StringRef Filename); - StringRef doFindFile(StringRef Filename); - StringRef doFindLib(StringRef Filename); - StringRef doFindLibMinGW(StringRef Filename); + Optional<StringRef> findFile(StringRef filename); + Optional<StringRef> findLib(StringRef filename); + StringRef doFindFile(StringRef filename); + StringRef doFindLib(StringRef filename); + StringRef doFindLibMinGW(StringRef filename); // Parses LIB environment which contains a list of search paths. void addLibSearchPaths(); // Library search path. The first element is always "" (current directory). - std::vector<StringRef> SearchPaths; + std::vector<StringRef> searchPaths; - void maybeExportMinGWSymbols(const llvm::opt::InputArgList &Args); + void maybeExportMinGWSymbols(const llvm::opt::InputArgList &args); // We don't want to add the same file more than once. // Files are uniquified by their filesystem and file number. - std::set<llvm::sys::fs::UniqueID> VisitedFiles; + std::set<llvm::sys::fs::UniqueID> visitedFiles; - std::set<std::string> VisitedLibs; + std::set<std::string> visitedLibs; - Symbol *addUndefined(StringRef Sym); + Symbol *addUndefined(StringRef sym); - StringRef mangleMaybe(Symbol *S); + StringRef mangleMaybe(Symbol *s); // Windows specific -- "main" is not the only main function in Windows. // You can choose one from these four -- {w,}{WinMain,main}. @@ -120,36 +120,36 @@ private: StringRef findDefaultEntry(); WindowsSubsystem inferSubsystem(); - void addBuffer(std::unique_ptr<MemoryBuffer> MB, bool WholeArchive); - void addArchiveBuffer(MemoryBufferRef MBRef, StringRef SymName, - StringRef ParentName, uint64_t OffsetInArchive); + void addBuffer(std::unique_ptr<MemoryBuffer> mb, bool wholeArchive); + void addArchiveBuffer(MemoryBufferRef mbref, StringRef symName, + StringRef parentName, uint64_t offsetInArchive); - void enqueueTask(std::function<void()> Task); + void enqueueTask(std::function<void()> task); bool run(); - std::list<std::function<void()>> TaskQueue; - std::vector<StringRef> FilePaths; - std::vector<MemoryBufferRef> Resources; + std::list<std::function<void()>> taskQueue; + std::vector<StringRef> filePaths; + std::vector<MemoryBufferRef> resources; - llvm::StringSet<> DirectivesExports; + llvm::StringSet<> directivesExports; }; // Functions below this line are defined in DriverUtils.cpp. -void printHelp(const char *Argv0); +void printHelp(const char *argv0); // Parses a string in the form of "<integer>[,<integer>]". -void parseNumbers(StringRef Arg, uint64_t *Addr, uint64_t *Size = nullptr); +void parseNumbers(StringRef arg, uint64_t *addr, uint64_t *size = nullptr); -void parseGuard(StringRef Arg); +void parseGuard(StringRef arg); // Parses a string in the form of "<integer>[.<integer>]". // Minor's default value is 0. -void parseVersion(StringRef Arg, uint32_t *Major, uint32_t *Minor); +void parseVersion(StringRef arg, uint32_t *major, uint32_t *minor); // Parses a string in the form of "<subsystem>[,<integer>[.<integer>]]". -void parseSubsystem(StringRef Arg, WindowsSubsystem *Sys, uint32_t *Major, - uint32_t *Minor); +void parseSubsystem(StringRef arg, WindowsSubsystem *sys, uint32_t *major, + uint32_t *minor); void parseAlternateName(StringRef); void parseMerge(StringRef); @@ -157,23 +157,23 @@ void parseSection(StringRef); void parseAligncomm(StringRef); // Parses a string in the form of "[:<integer>]" -void parseFunctionPadMin(llvm::opt::Arg *A, llvm::COFF::MachineTypes Machine); +void parseFunctionPadMin(llvm::opt::Arg *a, llvm::COFF::MachineTypes machine); // Parses a string in the form of "EMBED[,=<integer>]|NO". -void parseManifest(StringRef Arg); +void parseManifest(StringRef arg); // Parses a string in the form of "level=<string>|uiAccess=<string>" -void parseManifestUAC(StringRef Arg); +void parseManifestUAC(StringRef arg); // Parses a string in the form of "cd|net[,(cd|net)]*" -void parseSwaprun(StringRef Arg); +void parseSwaprun(StringRef arg); // Create a resource file containing a manifest XML. std::unique_ptr<MemoryBuffer> createManifestRes(); void createSideBySideManifest(); // Used for dllexported symbols. -Export parseExport(StringRef Arg); +Export parseExport(StringRef arg); void fixupExports(); void assignExportOrdinals(); @@ -181,12 +181,12 @@ void assignExportOrdinals(); // if value matches previous values for the key. // This feature used in the directive section to reject // incompatible objects. -void checkFailIfMismatch(StringRef Arg, InputFile *Source); +void checkFailIfMismatch(StringRef arg, InputFile *source); // Convert Windows resource files (.res files) to a .obj file. -MemoryBufferRef convertResToCOFF(ArrayRef<MemoryBufferRef> MBs); +MemoryBufferRef convertResToCOFF(ArrayRef<MemoryBufferRef> mbs); -void runMSVCLinker(std::string Rsp, ArrayRef<StringRef> Objects); +void runMSVCLinker(std::string rsp, ArrayRef<StringRef> objects); // Create enum with OPT_xxx values for each option in Options.td enum { |