summaryrefslogtreecommitdiff
path: root/ELF/Driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Driver.h')
-rw-r--r--ELF/Driver.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/ELF/Driver.h b/ELF/Driver.h
index 81d7f608e588f..3115e28d16698 100644
--- a/ELF/Driver.h
+++ b/ELF/Driver.h
@@ -1,15 +1,15 @@
//===- Driver.h -------------------------------------------------*- C++ -*-===//
//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLD_ELF_DRIVER_H
#define LLD_ELF_DRIVER_H
+#include "LTO.h"
#include "SymbolTable.h"
#include "lld/Common/LLVM.h"
#include "lld/Common/Reproduce.h"
@@ -22,34 +22,37 @@
namespace lld {
namespace elf {
-extern class LinkerDriver *Driver;
+extern class LinkerDriver *driver;
class LinkerDriver {
public:
- void main(ArrayRef<const char *> Args);
- void addFile(StringRef Path, bool WithLOption);
- void addLibrary(StringRef Name);
+ void main(ArrayRef<const char *> args);
+ void addFile(StringRef path, bool withLOption);
+ void addLibrary(StringRef name);
private:
- void readConfigs(llvm::opt::InputArgList &Args);
- void createFiles(llvm::opt::InputArgList &Args);
+ void createFiles(llvm::opt::InputArgList &args);
void inferMachineType();
- template <class ELFT> void link(llvm::opt::InputArgList &Args);
+ template <class ELFT> void link(llvm::opt::InputArgList &args);
+ template <class ELFT> void compileBitcodeFiles();
// True if we are in --whole-archive and --no-whole-archive.
- bool InWholeArchive = false;
+ bool inWholeArchive = false;
// True if we are in --start-lib and --end-lib.
- bool InLib = false;
+ bool inLib = false;
+
+ // For LTO.
+ std::unique_ptr<BitcodeCompiler> lto;
- std::vector<InputFile *> Files;
+ std::vector<InputFile *> files;
};
// Parses command line options.
class ELFOptTable : public llvm::opt::OptTable {
public:
ELFOptTable();
- llvm::opt::InputArgList parse(ArrayRef<const char *> Argv);
+ llvm::opt::InputArgList parse(ArrayRef<const char *> argv);
};
// Create enum with OPT_xxx values for each option in Options.td
@@ -61,11 +64,12 @@ enum {
};
void printHelp();
-std::string createResponseFile(const llvm::opt::InputArgList &Args);
+std::string createResponseFile(const llvm::opt::InputArgList &args);
-llvm::Optional<std::string> findFromSearchPaths(StringRef Path);
-llvm::Optional<std::string> searchScript(StringRef Path);
-llvm::Optional<std::string> searchLibrary(StringRef Path);
+llvm::Optional<std::string> findFromSearchPaths(StringRef path);
+llvm::Optional<std::string> searchScript(StringRef path);
+llvm::Optional<std::string> searchLibraryBaseName(StringRef path);
+llvm::Optional<std::string> searchLibrary(StringRef path);
} // namespace elf
} // namespace lld