1 //===- Config.h -------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLD_MACHO_CONFIG_H
10 #define LLD_MACHO_CONFIG_H
12 #include "llvm/ADT/DenseMap.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/BinaryFormat/MachO.h"
15 #include "llvm/TextAPI/MachO/Architecture.h"
23 struct SymbolPriorityEntry;
25 struct Configuration {
27 bool hasReexports = false;
28 llvm::StringRef installName;
29 llvm::StringRef outputFile;
30 llvm::MachO::Architecture arch;
31 llvm::MachO::HeaderFileType outputType;
32 std::vector<llvm::StringRef> librarySearchPaths;
33 // TODO: use the framework search paths
34 std::vector<llvm::StringRef> frameworkSearchPaths;
35 llvm::DenseMap<llvm::StringRef, SymbolPriorityEntry> priorities;
38 // The symbol with the highest priority should be ordered first in the output
39 // section (modulo input section contiguity constraints). Using priority
40 // (highest first) instead of order (lowest first) has the convenient property
41 // that the default-constructed zero priority -- for symbols/sections without a
42 // user-defined order -- naturally ends up putting them at the end of the
44 struct SymbolPriorityEntry {
45 // The priority given to a matching symbol, regardless of which object file
46 // it originated from.
47 size_t anyObjectFile = 0;
48 // The priority given to a matching symbol from a particular object file.
49 llvm::DenseMap<llvm::StringRef, size_t> objectFiles;
52 extern Configuration *config;