1 //===- MinGW.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_COFF_MINGW_H
10 #define LLD_COFF_MINGW_H
14 #include "lld/Common/LLVM.h"
15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/ADT/StringSet.h"
17 #include "llvm/Option/ArgList.h"
23 // Logic for deciding what symbols to export, when exporting all
29 void addWholeArchive(StringRef path
);
31 llvm::StringSet
<> excludeSymbols
;
32 llvm::StringSet
<> excludeSymbolPrefixes
;
33 llvm::StringSet
<> excludeSymbolSuffixes
;
34 llvm::StringSet
<> excludeLibs
;
35 llvm::StringSet
<> excludeObjects
;
37 bool shouldExport(Defined
*sym
) const;
40 void writeDefFile(StringRef name
);
42 // The -wrap option is a feature to rename symbols so that you can write
43 // wrappers for existing functions. If you pass `-wrap:foo`, all
44 // occurrences of symbol `foo` are resolved to `__wrap_foo` (so, you are
45 // expected to write `__wrap_foo` function as a wrapper). The original
46 // symbol becomes accessible as `__real_foo`, so you can call that from your
49 // This data structure is instantiated for each -wrap option.
50 struct WrappedSymbol
{
56 std::vector
<WrappedSymbol
> addWrappedSymbols(llvm::opt::InputArgList
&args
);
58 void wrapSymbols(ArrayRef
<WrappedSymbol
> wrapped
);