Skip to content

Commit 9422085

Browse files
committed
Add explicit visibility macros to Support source files
1 parent 305f60a commit 9422085

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

llvm/lib/Support/CommandLine.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/ADT/StringRef.h"
3030
#include "llvm/ADT/Twine.h"
3131
#include "llvm/Config/config.h"
32+
#include "llvm/Support/Compiler.h"
3233
#include "llvm/Support/ConvertUTF.h"
3334
#include "llvm/Support/Debug.h"
3435
#include "llvm/Support/Error.h"
@@ -54,24 +55,24 @@ using namespace cl;
5455
//
5556
namespace llvm {
5657
namespace cl {
57-
template class basic_parser<bool>;
58-
template class basic_parser<boolOrDefault>;
59-
template class basic_parser<int>;
60-
template class basic_parser<long>;
61-
template class basic_parser<long long>;
62-
template class basic_parser<unsigned>;
63-
template class basic_parser<unsigned long>;
64-
template class basic_parser<unsigned long long>;
65-
template class basic_parser<double>;
66-
template class basic_parser<float>;
67-
template class basic_parser<std::string>;
68-
template class basic_parser<char>;
69-
70-
template class opt<unsigned>;
71-
template class opt<int>;
72-
template class opt<std::string>;
73-
template class opt<char>;
74-
template class opt<bool>;
58+
template class LLVM_EXPORT_TEMPLATE basic_parser<bool>;
59+
template class LLVM_EXPORT_TEMPLATE basic_parser<boolOrDefault>;
60+
template class LLVM_EXPORT_TEMPLATE basic_parser<int>;
61+
template class LLVM_EXPORT_TEMPLATE basic_parser<long>;
62+
template class LLVM_EXPORT_TEMPLATE basic_parser<long long>;
63+
template class LLVM_EXPORT_TEMPLATE basic_parser<unsigned>;
64+
template class LLVM_EXPORT_TEMPLATE basic_parser<unsigned long>;
65+
template class LLVM_EXPORT_TEMPLATE basic_parser<unsigned long long>;
66+
template class LLVM_EXPORT_TEMPLATE basic_parser<double>;
67+
template class LLVM_EXPORT_TEMPLATE basic_parser<float>;
68+
template class LLVM_EXPORT_TEMPLATE basic_parser<std::string>;
69+
template class LLVM_EXPORT_TEMPLATE basic_parser<char>;
70+
71+
template class LLVM_EXPORT_TEMPLATE opt<unsigned>;
72+
template class LLVM_EXPORT_TEMPLATE opt<int>;
73+
template class LLVM_EXPORT_TEMPLATE opt<std::string>;
74+
template class LLVM_EXPORT_TEMPLATE opt<char>;
75+
template class LLVM_EXPORT_TEMPLATE opt<bool>;
7576
} // namespace cl
7677
} // namespace llvm
7778

llvm/lib/Support/Debug.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "llvm/Support/Debug.h"
2727
#include "llvm/Support/CommandLine.h"
28+
#include "llvm/Support/Compiler.h"
2829
#include "llvm/Support/ManagedStatic.h"
2930
#include "llvm/Support/Signals.h"
3031
#include "llvm/Support/circular_raw_ostream.h"
@@ -42,7 +43,7 @@ using namespace llvm;
4243
// built without NDEBUG can depend on via the llvm/Support/Debug.h header.
4344
namespace llvm {
4445
/// Exported boolean set by the -debug option.
45-
bool DebugFlag = false;
46+
LLVM_ABI bool DebugFlag = false;
4647

4748
static ManagedStatic<std::vector<std::string>> CurrentDebugType;
4849

@@ -193,4 +194,4 @@ void llvm::initDebugOptions() {}
193194

194195
/// EnableDebugBuffering - Turn on signal handler installation.
195196
///
196-
bool llvm::EnableDebugBuffering = false;
197+
LLVM_ABI bool llvm::EnableDebugBuffering = false;

llvm/lib/Support/SmallVector.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "llvm/ADT/SmallVector.h"
1414
#include "llvm/ADT/Twine.h"
15+
#include "llvm/Support/Compiler.h"
1516
#include "llvm/Support/MemAlloc.h"
1617
#include <cstdint>
1718
#ifdef LLVM_ENABLE_EXCEPTIONS
@@ -164,14 +165,14 @@ void SmallVectorBase<Size_T>::grow_pod(void *FirstEl, size_t MinSize,
164165
this->set_allocation_range(NewElts, NewCapacity);
165166
}
166167

167-
template class llvm::SmallVectorBase<uint32_t>;
168+
template class LLVM_EXPORT_TEMPLATE llvm::SmallVectorBase<uint32_t>;
168169

169170
// Disable the uint64_t instantiation for 32-bit builds.
170171
// Both uint32_t and uint64_t instantiations are needed for 64-bit builds.
171172
// This instantiation will never be used in 32-bit builds, and will cause
172173
// warnings when sizeof(Size_T) > sizeof(size_t).
173174
#if SIZE_MAX > UINT32_MAX
174-
template class llvm::SmallVectorBase<uint64_t>;
175+
template class LLVM_EXPORT_TEMPLATE llvm::SmallVectorBase<uint64_t>;
175176

176177
// Assertions to ensure this #if stays in sync with SmallVectorSizeType.
177178
static_assert(sizeof(SmallVectorSizeType<char>) == sizeof(uint64_t),

0 commit comments

Comments
 (0)