summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/lld/Common/Args.h23
-rw-r--r--include/lld/Common/Driver.h27
-rw-r--r--include/lld/Common/ErrorHandler.h98
-rw-r--r--include/lld/Common/Filesystem.h20
-rw-r--r--include/lld/Common/LLVM.h9
-rw-r--r--include/lld/Common/Memory.h25
-rw-r--r--include/lld/Common/Reproduce.h17
-rw-r--r--include/lld/Common/Strings.h23
-rw-r--r--include/lld/Common/TargetOptionsCommandFlags.h15
-rw-r--r--include/lld/Common/Threads.h34
-rw-r--r--include/lld/Common/Timer.h29
-rw-r--r--include/lld/Common/Version.h7
-rw-r--r--include/lld/Core/AbsoluteAtom.h7
-rw-r--r--include/lld/Core/ArchiveLibraryFile.h7
-rw-r--r--include/lld/Core/Atom.h7
-rw-r--r--include/lld/Core/DefinedAtom.h7
-rw-r--r--include/lld/Core/Error.h7
-rw-r--r--include/lld/Core/File.h7
-rw-r--r--include/lld/Core/Instrumentation.h7
-rw-r--r--include/lld/Core/LinkingContext.h7
-rw-r--r--include/lld/Core/Node.h7
-rw-r--r--include/lld/Core/Pass.h7
-rw-r--r--include/lld/Core/PassManager.h7
-rw-r--r--include/lld/Core/Reader.h7
-rw-r--r--include/lld/Core/Reference.h7
-rw-r--r--include/lld/Core/Resolver.h7
-rw-r--r--include/lld/Core/SharedLibraryAtom.h7
-rw-r--r--include/lld/Core/SharedLibraryFile.h7
-rw-r--r--include/lld/Core/Simple.h7
-rw-r--r--include/lld/Core/SymbolTable.h7
-rw-r--r--include/lld/Core/UndefinedAtom.h7
-rw-r--r--include/lld/Core/Writer.h7
-rw-r--r--include/lld/ReaderWriter/MachOLinkingContext.h7
-rw-r--r--include/lld/ReaderWriter/YamlContext.h7
34 files changed, 240 insertions, 241 deletions
diff --git a/include/lld/Common/Args.h b/include/lld/Common/Args.h
index 769d4840cf065..b3c8686e57e22 100644
--- a/include/lld/Common/Args.h
+++ b/include/lld/Common/Args.h
@@ -1,9 +1,8 @@
//===- Args.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
//
//===----------------------------------------------------------------------===//
@@ -11,6 +10,7 @@
#define LLD_ARGS_H
#include "lld/Common/LLVM.h"
+#include "llvm/Support/CodeGen.h"
#include "llvm/Support/MemoryBuffer.h"
#include <vector>
@@ -22,15 +22,20 @@ class InputArgList;
namespace lld {
namespace args {
-int getInteger(llvm::opt::InputArgList &Args, unsigned Key, int Default);
-std::vector<StringRef> getStrings(llvm::opt::InputArgList &Args, int Id);
-uint64_t getZOptionValue(llvm::opt::InputArgList &Args, int Id, StringRef Key,
+llvm::CodeGenOpt::Level getCGOptLevel(int optLevelLTO);
+
+int64_t getInteger(llvm::opt::InputArgList &args, unsigned key,
+ int64_t Default);
+
+std::vector<StringRef> getStrings(llvm::opt::InputArgList &args, int id);
+
+uint64_t getZOptionValue(llvm::opt::InputArgList &args, int id, StringRef key,
uint64_t Default);
-std::vector<StringRef> getLines(MemoryBufferRef MB);
+std::vector<StringRef> getLines(MemoryBufferRef mb);
-StringRef getFilenameWithoutExe(StringRef Path);
+StringRef getFilenameWithoutExe(StringRef path);
} // namespace args
} // namespace lld
diff --git a/include/lld/Common/Driver.h b/include/lld/Common/Driver.h
index f6d92933af622..e5595952ad222 100644
--- a/include/lld/Common/Driver.h
+++ b/include/lld/Common/Driver.h
@@ -1,9 +1,8 @@
//===- lld/Common/Driver.h - Linker Driver Emulator -----------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
@@ -15,28 +14,28 @@
namespace lld {
namespace coff {
-bool link(llvm::ArrayRef<const char *> Args, bool CanExitEarly,
- llvm::raw_ostream &Diag = llvm::errs());
+bool link(llvm::ArrayRef<const char *> args, bool canExitEarly,
+ llvm::raw_ostream &diag = llvm::errs());
}
namespace mingw {
-bool link(llvm::ArrayRef<const char *> Args,
- llvm::raw_ostream &Diag = llvm::errs());
+bool link(llvm::ArrayRef<const char *> args,
+ llvm::raw_ostream &diag = llvm::errs());
}
namespace elf {
-bool link(llvm::ArrayRef<const char *> Args, bool CanExitEarly,
- llvm::raw_ostream &Diag = llvm::errs());
+bool link(llvm::ArrayRef<const char *> args, bool canExitEarly,
+ llvm::raw_ostream &diag = llvm::errs());
}
namespace mach_o {
-bool link(llvm::ArrayRef<const char *> Args, bool CanExitEarly,
- llvm::raw_ostream &Diag = llvm::errs());
+bool link(llvm::ArrayRef<const char *> args, bool canExitEarly,
+ llvm::raw_ostream &diag = llvm::errs());
}
namespace wasm {
-bool link(llvm::ArrayRef<const char *> Args, bool CanExitEarly,
- llvm::raw_ostream &Diag = llvm::errs());
+bool link(llvm::ArrayRef<const char *> args, bool canExitEarly,
+ llvm::raw_ostream &diag = llvm::errs());
}
}
diff --git a/include/lld/Common/ErrorHandler.h b/include/lld/Common/ErrorHandler.h
index c169f7b50de89..7126a7bf410ae 100644
--- a/include/lld/Common/ErrorHandler.h
+++ b/include/lld/Common/ErrorHandler.h
@@ -1,9 +1,8 @@
//===- ErrorHandler.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
//
//===----------------------------------------------------------------------===//
//
@@ -83,74 +82,75 @@ namespace lld {
class ErrorHandler {
public:
- uint64_t ErrorCount = 0;
- uint64_t ErrorLimit = 20;
- StringRef ErrorLimitExceededMsg = "too many errors emitted, stopping now";
- StringRef LogName = "lld";
- llvm::raw_ostream *ErrorOS = &llvm::errs();
- bool ColorDiagnostics = llvm::errs().has_colors();
- bool ExitEarly = true;
- bool FatalWarnings = false;
- bool Verbose = false;
-
- void error(const Twine &Msg);
- LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg);
- void log(const Twine &Msg);
- void message(const Twine &Msg);
- void warn(const Twine &Msg);
-
- std::unique_ptr<llvm::FileOutputBuffer> OutputBuffer;
+ uint64_t errorCount = 0;
+ uint64_t errorLimit = 20;
+ StringRef errorLimitExceededMsg = "too many errors emitted, stopping now";
+ StringRef logName = "lld";
+ llvm::raw_ostream *errorOS = &llvm::errs();
+ bool colorDiagnostics = llvm::errs().has_colors();
+ bool exitEarly = true;
+ bool fatalWarnings = false;
+ bool verbose = false;
+ bool vsDiagnostics = false;
+
+ void error(const Twine &msg);
+ LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &msg);
+ void log(const Twine &msg);
+ void message(const Twine &msg);
+ void warn(const Twine &msg);
+
+ std::unique_ptr<llvm::FileOutputBuffer> outputBuffer;
private:
- void print(StringRef S, raw_ostream::Colors C);
+ void printHeader(StringRef s, raw_ostream::Colors c, const Twine &msg);
};
/// Returns the default error handler.
ErrorHandler &errorHandler();
-inline void error(const Twine &Msg) { errorHandler().error(Msg); }
-inline LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg) {
- errorHandler().fatal(Msg);
+inline void error(const Twine &msg) { errorHandler().error(msg); }
+inline LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &msg) {
+ errorHandler().fatal(msg);
}
-inline void log(const Twine &Msg) { errorHandler().log(Msg); }
-inline void message(const Twine &Msg) { errorHandler().message(Msg); }
-inline void warn(const Twine &Msg) { errorHandler().warn(Msg); }
-inline uint64_t errorCount() { return errorHandler().ErrorCount; }
+inline void log(const Twine &msg) { errorHandler().log(msg); }
+inline void message(const Twine &msg) { errorHandler().message(msg); }
+inline void warn(const Twine &msg) { errorHandler().warn(msg); }
+inline uint64_t errorCount() { return errorHandler().errorCount; }
-LLVM_ATTRIBUTE_NORETURN void exitLld(int Val);
+LLVM_ATTRIBUTE_NORETURN void exitLld(int val);
-void diagnosticHandler(const llvm::DiagnosticInfo &DI);
-void checkError(Error E);
+void diagnosticHandler(const llvm::DiagnosticInfo &di);
+void checkError(Error e);
// check functions are convenient functions to strip errors
// from error-or-value objects.
-template <class T> T check(ErrorOr<T> E) {
- if (auto EC = E.getError())
- fatal(EC.message());
- return std::move(*E);
+template <class T> T check(ErrorOr<T> e) {
+ if (auto ec = e.getError())
+ fatal(ec.message());
+ return std::move(*e);
}
-template <class T> T check(Expected<T> E) {
- if (!E)
- fatal(llvm::toString(E.takeError()));
- return std::move(*E);
+template <class T> T check(Expected<T> e) {
+ if (!e)
+ fatal(llvm::toString(e.takeError()));
+ return std::move(*e);
}
template <class T>
-T check2(ErrorOr<T> E, llvm::function_ref<std::string()> Prefix) {
- if (auto EC = E.getError())
- fatal(Prefix() + ": " + EC.message());
- return std::move(*E);
+T check2(ErrorOr<T> e, llvm::function_ref<std::string()> prefix) {
+ if (auto ec = e.getError())
+ fatal(prefix() + ": " + ec.message());
+ return std::move(*e);
}
template <class T>
-T check2(Expected<T> E, llvm::function_ref<std::string()> Prefix) {
- if (!E)
- fatal(Prefix() + ": " + toString(E.takeError()));
- return std::move(*E);
+T check2(Expected<T> e, llvm::function_ref<std::string()> prefix) {
+ if (!e)
+ fatal(prefix() + ": " + toString(e.takeError()));
+ return std::move(*e);
}
-inline std::string toString(const Twine &S) { return S.str(); }
+inline std::string toString(const Twine &s) { return s.str(); }
// To evaluate the second argument lazily, we use C macro.
#define CHECK(E, S) check2((E), [&] { return toString(S); })
diff --git a/include/lld/Common/Filesystem.h b/include/lld/Common/Filesystem.h
new file mode 100644
index 0000000000000..63a0f554a06c5
--- /dev/null
+++ b/include/lld/Common/Filesystem.h
@@ -0,0 +1,20 @@
+//===- Filesystem.h ---------------------------------------------*- C++ -*-===//
+//
+// 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_FILESYSTEM_H
+#define LLD_FILESYSTEM_H
+
+#include "lld/Common/LLVM.h"
+#include <system_error>
+
+namespace lld {
+void unlinkAsync(StringRef path);
+std::error_code tryCreateFile(StringRef path);
+} // namespace lld
+
+#endif
diff --git a/include/lld/Common/LLVM.h b/include/lld/Common/LLVM.h
index 95a2aa903957d..f7ed1d793ca7b 100644
--- a/include/lld/Common/LLVM.h
+++ b/include/lld/Common/LLVM.h
@@ -1,9 +1,8 @@
//===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// 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
//
//===----------------------------------------------------------------------===//
//
@@ -30,6 +29,7 @@ class Twine;
class MemoryBuffer;
class MemoryBufferRef;
template <typename T> class ArrayRef;
+template <typename T> class MutableArrayRef;
template <unsigned InternalLen> class SmallString;
template <typename T, unsigned N> class SmallVector;
template <typename T> class ErrorOr;
@@ -63,6 +63,7 @@ using llvm::isa;
// ADT's.
using llvm::ArrayRef;
+using llvm::MutableArrayRef;
using llvm::Error;
using llvm::ErrorOr;
using llvm::Expected;
diff --git a/include/lld/Common/Memory.h b/include/lld/Common/Memory.h
index 699f7c1654cd3..41d8f15d7b34b 100644
--- a/include/lld/Common/Memory.h
+++ b/include/lld/Common/Memory.h
@@ -1,9 +1,8 @@
//===- Memory.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
//
//===----------------------------------------------------------------------===//
//
@@ -29,30 +28,30 @@
namespace lld {
// Use this arena if your object doesn't have a destructor.
-extern llvm::BumpPtrAllocator BAlloc;
-extern llvm::StringSaver Saver;
+extern llvm::BumpPtrAllocator bAlloc;
+extern llvm::StringSaver saver;
void freeArena();
// These two classes are hack to keep track of all
// SpecificBumpPtrAllocator instances.
struct SpecificAllocBase {
- SpecificAllocBase() { Instances.push_back(this); }
+ SpecificAllocBase() { instances.push_back(this); }
virtual ~SpecificAllocBase() = default;
virtual void reset() = 0;
- static std::vector<SpecificAllocBase *> Instances;
+ static std::vector<SpecificAllocBase *> instances;
};
template <class T> struct SpecificAlloc : public SpecificAllocBase {
- void reset() override { Alloc.DestroyAll(); }
- llvm::SpecificBumpPtrAllocator<T> Alloc;
+ void reset() override { alloc.DestroyAll(); }
+ llvm::SpecificBumpPtrAllocator<T> alloc;
};
// Use this arena if your object has a destructor.
// Your destructor will be invoked from freeArena().
-template <typename T, typename... U> T *make(U &&... Args) {
- static SpecificAlloc<T> Alloc;
- return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...);
+template <typename T, typename... U> T *make(U &&... args) {
+ static SpecificAlloc<T> alloc;
+ return new (alloc.alloc.Allocate()) T(std::forward<U>(args)...);
}
} // namespace lld
diff --git a/include/lld/Common/Reproduce.h b/include/lld/Common/Reproduce.h
index 0f425de269c7f..734d9e4011d19 100644
--- a/include/lld/Common/Reproduce.h
+++ b/include/lld/Common/Reproduce.h
@@ -1,9 +1,8 @@
//===- Reproduce.h - Utilities for creating reproducers ---------*- 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
//
//===----------------------------------------------------------------------===//
@@ -23,17 +22,13 @@ namespace lld {
// Makes a given pathname an absolute path first, and then remove
// beginning /. For example, "../foo.o" is converted to "home/john/foo.o",
// assuming that the current directory is "/home/john/bar".
-std::string relativeToRoot(StringRef Path);
+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);
+std::string quote(StringRef s);
// Returns the string form of the given argument.
-std::string toString(const llvm::opt::Arg &Arg);
+std::string toString(const llvm::opt::Arg &arg);
}
#endif
diff --git a/include/lld/Common/Strings.h b/include/lld/Common/Strings.h
index 566030e43aa64..ded22dd769bed 100644
--- a/include/lld/Common/Strings.h
+++ b/include/lld/Common/Strings.h
@@ -1,9 +1,8 @@
//===- Strings.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
//
//===----------------------------------------------------------------------===//
@@ -20,25 +19,25 @@
namespace lld {
// Returns a demangled C++ symbol name. If Name is not a mangled
// name, it returns Optional::None.
-llvm::Optional<std::string> demangleItanium(llvm::StringRef Name);
-llvm::Optional<std::string> demangleMSVC(llvm::StringRef S);
+llvm::Optional<std::string> demangleItanium(llvm::StringRef name);
+llvm::Optional<std::string> demangleMSVC(llvm::StringRef s);
-std::vector<uint8_t> parseHex(llvm::StringRef S);
-bool isValidCIdentifier(llvm::StringRef S);
+std::vector<uint8_t> parseHex(llvm::StringRef s);
+bool isValidCIdentifier(llvm::StringRef s);
// Write the contents of the a buffer to a file
-void saveBuffer(llvm::StringRef Buffer, const llvm::Twine &Path);
+void saveBuffer(llvm::StringRef buffer, const llvm::Twine &path);
// This class represents multiple glob patterns.
class StringMatcher {
public:
StringMatcher() = default;
- explicit StringMatcher(llvm::ArrayRef<llvm::StringRef> Pat);
+ explicit StringMatcher(llvm::ArrayRef<llvm::StringRef> pat);
- bool match(llvm::StringRef S) const;
+ bool match(llvm::StringRef s) const;
private:
- std::vector<llvm::GlobPattern> Patterns;
+ std::vector<llvm::GlobPattern> patterns;
};
} // namespace lld
diff --git a/include/lld/Common/TargetOptionsCommandFlags.h b/include/lld/Common/TargetOptionsCommandFlags.h
index 2eaecb72759e5..9345e616f9a96 100644
--- a/include/lld/Common/TargetOptionsCommandFlags.h
+++ b/include/lld/Common/TargetOptionsCommandFlags.h
@@ -1,9 +1,8 @@
//===-- TargetOptionsCommandFlags.h ----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// 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
//
//===----------------------------------------------------------------------===//
//
@@ -16,8 +15,8 @@
#include "llvm/Target/TargetOptions.h"
namespace lld {
-llvm::TargetOptions InitTargetOptionsFromCodeGenFlags();
-llvm::Optional<llvm::CodeModel::Model> GetCodeModelFromCMModel();
-std::string GetCPUStr();
-std::vector<std::string> GetMAttrs();
+llvm::TargetOptions initTargetOptionsFromCodeGenFlags();
+llvm::Optional<llvm::CodeModel::Model> getCodeModelFromCMModel();
+std::string getCPUStr();
+std::vector<std::string> getMAttrs();
}
diff --git a/include/lld/Common/Threads.h b/include/lld/Common/Threads.h
index 1425abd129224..7834130fdf726 100644
--- a/include/lld/Common/Threads.h
+++ b/include/lld/Common/Threads.h
@@ -1,9 +1,8 @@
//===- Threads.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
//
//===----------------------------------------------------------------------===//
//
@@ -64,21 +63,28 @@
namespace lld {
-extern bool ThreadsEnabled;
+extern bool threadsEnabled;
+
+template <typename R, class FuncTy> void parallelForEach(R &&range, FuncTy fn) {
+ if (threadsEnabled)
+ for_each(llvm::parallel::par, std::begin(range), std::end(range), fn);
+ else
+ for_each(llvm::parallel::seq, std::begin(range), std::end(range), fn);
+}
-template <typename R, class FuncTy> void parallelForEach(R &&Range, FuncTy Fn) {
- if (ThreadsEnabled)
- for_each(llvm::parallel::par, std::begin(Range), std::end(Range), Fn);
+inline void parallelForEachN(size_t begin, size_t end,
+ llvm::function_ref<void(size_t)> fn) {
+ if (threadsEnabled)
+ for_each_n(llvm::parallel::par, begin, end, fn);
else
- for_each(llvm::parallel::seq, std::begin(Range), std::end(Range), Fn);
+ for_each_n(llvm::parallel::seq, begin, end, fn);
}
-inline void parallelForEachN(size_t Begin, size_t End,
- llvm::function_ref<void(size_t)> Fn) {
- if (ThreadsEnabled)
- for_each_n(llvm::parallel::par, Begin, End, Fn);
+template <typename R, class FuncTy> void parallelSort(R &&range, FuncTy fn) {
+ if (threadsEnabled)
+ sort(llvm::parallel::par, std::begin(range), std::end(range), fn);
else
- for_each_n(llvm::parallel::seq, Begin, End, Fn);
+ sort(llvm::parallel::seq, std::begin(range), std::end(range), fn);
}
} // namespace lld
diff --git a/include/lld/Common/Timer.h b/include/lld/Common/Timer.h
index 6654af6269192..4a298b04a30b5 100644
--- a/include/lld/Common/Timer.h
+++ b/include/lld/Common/Timer.h
@@ -1,9 +1,8 @@
//===- Timer.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
//
//===----------------------------------------------------------------------===//
@@ -22,18 +21,18 @@ namespace lld {
class Timer;
struct ScopedTimer {
- explicit ScopedTimer(Timer &T);
+ explicit ScopedTimer(Timer &t);
~ScopedTimer();
void stop();
- Timer *T = nullptr;
+ Timer *t = nullptr;
};
class Timer {
public:
- Timer(llvm::StringRef Name, Timer &Parent);
+ Timer(llvm::StringRef name, Timer &parent);
static Timer &root();
@@ -44,14 +43,14 @@ public:
double millis() const;
private:
- explicit Timer(llvm::StringRef Name);
- void print(int Depth, double TotalDuration, bool Recurse = true) const;
-
- std::chrono::time_point<std::chrono::high_resolution_clock> StartTime;
- std::chrono::nanoseconds Total;
- std::vector<Timer *> Children;
- std::string Name;
- Timer *Parent;
+ explicit Timer(llvm::StringRef name);
+ void print(int depth, double totalDuration, bool recurse = true) const;
+
+ std::chrono::time_point<std::chrono::high_resolution_clock> startTime;
+ std::chrono::nanoseconds total;
+ std::vector<Timer *> children;
+ std::string name;
+ Timer *parent;
};
} // namespace lld
diff --git a/include/lld/Common/Version.h b/include/lld/Common/Version.h
index 23a10ed6dbf3b..9571aa2743e5b 100644
--- a/include/lld/Common/Version.h
+++ b/include/lld/Common/Version.h
@@ -1,9 +1,8 @@
//===- lld/Common/Version.h - LLD Version Number ----------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// 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
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/lld/Core/AbsoluteAtom.h b/include/lld/Core/AbsoluteAtom.h
index ed25297cea812..5214b418f3d5b 100644
--- a/include/lld/Core/AbsoluteAtom.h
+++ b/include/lld/Core/AbsoluteAtom.h
@@ -1,9 +1,8 @@
//===- Core/AbsoluteAtom.h - An absolute Atom -----------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/ArchiveLibraryFile.h b/include/lld/Core/ArchiveLibraryFile.h
index 2c736e7d6c616..0abef40447b96 100644
--- a/include/lld/Core/ArchiveLibraryFile.h
+++ b/include/lld/Core/ArchiveLibraryFile.h
@@ -1,9 +1,8 @@
//===- Core/ArchiveLibraryFile.h - Models static library ------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Atom.h b/include/lld/Core/Atom.h
index 149c3d5ee2c57..4d3d27a2af57b 100644
--- a/include/lld/Core/Atom.h
+++ b/include/lld/Core/Atom.h
@@ -1,9 +1,8 @@
//===- Core/Atom.h - A node in linking graph --------------------*- 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/DefinedAtom.h b/include/lld/Core/DefinedAtom.h
index ba10b45411f16..4b1de7ffec112 100644
--- a/include/lld/Core/DefinedAtom.h
+++ b/include/lld/Core/DefinedAtom.h
@@ -1,9 +1,8 @@
//===- Core/DefinedAtom.h - An Atom with content --------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Error.h b/include/lld/Core/Error.h
index 36a36724987a4..c18fe96d268c8 100644
--- a/include/lld/Core/Error.h
+++ b/include/lld/Core/Error.h
@@ -1,9 +1,8 @@
//===- Error.h - system_error extensions for lld ----------------*- 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
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/lld/Core/File.h b/include/lld/Core/File.h
index 54f533576a4b3..492f35989f166 100644
--- a/include/lld/Core/File.h
+++ b/include/lld/Core/File.h
@@ -1,9 +1,8 @@
//===- Core/File.h - A Container of Atoms ---------------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Instrumentation.h b/include/lld/Core/Instrumentation.h
index 939d645575879..602a37aff57cb 100644
--- a/include/lld/Core/Instrumentation.h
+++ b/include/lld/Core/Instrumentation.h
@@ -1,9 +1,8 @@
//===- include/Core/Instrumentation.h - Instrumentation API ---------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
///
diff --git a/include/lld/Core/LinkingContext.h b/include/lld/Core/LinkingContext.h
index 52ab1a2480e82..e090ff9902318 100644
--- a/include/lld/Core/LinkingContext.h
+++ b/include/lld/Core/LinkingContext.h
@@ -1,9 +1,8 @@
//===- lld/Core/LinkingContext.h - Linker Target Info Interface -*- 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Node.h b/include/lld/Core/Node.h
index c30482409e7a4..a224793d7824f 100644
--- a/include/lld/Core/Node.h
+++ b/include/lld/Core/Node.h
@@ -1,9 +1,8 @@
//===- lld/Core/Node.h - Input file class -----------------------*- 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
//
//===----------------------------------------------------------------------===//
///
diff --git a/include/lld/Core/Pass.h b/include/lld/Core/Pass.h
index bfe3f9b10e0c3..57d5a40e082a0 100644
--- a/include/lld/Core/Pass.h
+++ b/include/lld/Core/Pass.h
@@ -1,9 +1,8 @@
//===------ Core/Pass.h - Base class for linker passes ----------*- 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/PassManager.h b/include/lld/Core/PassManager.h
index f2ef10f406f21..02499d09caee3 100644
--- a/include/lld/Core/PassManager.h
+++ b/include/lld/Core/PassManager.h
@@ -1,9 +1,8 @@
//===- lld/Core/PassManager.h - Manage linker passes ----------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Reader.h b/include/lld/Core/Reader.h
index 6cf6282ff39c4..a2d7912d74133 100644
--- a/include/lld/Core/Reader.h
+++ b/include/lld/Core/Reader.h
@@ -1,9 +1,8 @@
//===- lld/Core/Reader.h - Abstract File Format Reading Interface ---------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Reference.h b/include/lld/Core/Reference.h
index 1d3003c84616b..191e0f07ec381 100644
--- a/include/lld/Core/Reference.h
+++ b/include/lld/Core/Reference.h
@@ -1,9 +1,8 @@
//===- Core/References.h - A Reference to Another Atom ----------*- 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Resolver.h b/include/lld/Core/Resolver.h
index 5157c9fddc1a2..9ab2195094595 100644
--- a/include/lld/Core/Resolver.h
+++ b/include/lld/Core/Resolver.h
@@ -1,9 +1,8 @@
//===- Core/Resolver.h - Resolves Atom References -------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/SharedLibraryAtom.h b/include/lld/Core/SharedLibraryAtom.h
index 7fec7a3e3d291..171d154bc0556 100644
--- a/include/lld/Core/SharedLibraryAtom.h
+++ b/include/lld/Core/SharedLibraryAtom.h
@@ -1,9 +1,8 @@
//===- Core/SharedLibraryAtom.h - A Shared Library Atom -------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/SharedLibraryFile.h b/include/lld/Core/SharedLibraryFile.h
index 53bf967b0236d..846d1f22f17a0 100644
--- a/include/lld/Core/SharedLibraryFile.h
+++ b/include/lld/Core/SharedLibraryFile.h
@@ -1,9 +1,8 @@
//===- Core/SharedLibraryFile.h - Models shared libraries as Atoms --------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Simple.h b/include/lld/Core/Simple.h
index feeed6ae473b5..f211beb9953f9 100644
--- a/include/lld/Core/Simple.h
+++ b/include/lld/Core/Simple.h
@@ -1,9 +1,8 @@
//===- lld/Core/Simple.h - Simple implementations of Atom and File --------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
///
diff --git a/include/lld/Core/SymbolTable.h b/include/lld/Core/SymbolTable.h
index 156c56eafbf76..c7502a45d7c34 100644
--- a/include/lld/Core/SymbolTable.h
+++ b/include/lld/Core/SymbolTable.h
@@ -1,9 +1,8 @@
//===- Core/SymbolTable.h - Main Symbol Table -----------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/UndefinedAtom.h b/include/lld/Core/UndefinedAtom.h
index f45d6ecda6b01..a40db36519eca 100644
--- a/include/lld/Core/UndefinedAtom.h
+++ b/include/lld/Core/UndefinedAtom.h
@@ -1,9 +1,8 @@
//===- Core/UndefinedAtom.h - An Undefined Atom ---------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/Core/Writer.h b/include/lld/Core/Writer.h
index 1cdfabefebd7e..0de5fca32bce1 100644
--- a/include/lld/Core/Writer.h
+++ b/include/lld/Core/Writer.h
@@ -1,9 +1,8 @@
//===- lld/Core/Writer.h - Abstract File Format Interface -----------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/ReaderWriter/MachOLinkingContext.h b/include/lld/ReaderWriter/MachOLinkingContext.h
index fde65880c3e39..f48ad77053e5e 100644
--- a/include/lld/ReaderWriter/MachOLinkingContext.h
+++ b/include/lld/ReaderWriter/MachOLinkingContext.h
@@ -1,9 +1,8 @@
//===- lld/ReaderWriter/MachOLinkingContext.h -----------------------------===//
//
-// 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
//
//===----------------------------------------------------------------------===//
diff --git a/include/lld/ReaderWriter/YamlContext.h b/include/lld/ReaderWriter/YamlContext.h
index b97d21f68e55b..dc133e3627de3 100644
--- a/include/lld/ReaderWriter/YamlContext.h
+++ b/include/lld/ReaderWriter/YamlContext.h
@@ -1,9 +1,8 @@
//===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===//
//
-// 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
//
//===----------------------------------------------------------------------===//