[Mlir-commits] [mlir] 21605a1 - [mlir] Mark ClassID::getID as LLVM_EXTERNAL_VISIBILITY to ensure only one version exists
River Riddle
llvmlistbot at llvm.org
Wed Apr 8 16:54:32 PDT 2020
Author: River Riddle
Date: 2020-04-08T16:51:48-07:00
New Revision: 21605a1207743c9256c147086afa05c5c3636b26
URL: https://github.com/llvm/llvm-project/commit/21605a1207743c9256c147086afa05c5c3636b26
DIFF: https://github.com/llvm/llvm-project/commit/21605a1207743c9256c147086afa05c5c3636b26.diff
LOG: [mlir] Mark ClassID::getID as LLVM_EXTERNAL_VISIBILITY to ensure only one version exists
Summary: ClassID is used as a type id and must be unique in the face of shared libraries to ensure correctness. This fixes failures related to BUILD_SHARED_LIBs on macos.
Differential Revision: https://reviews.llvm.org/D77764
Added:
Modified:
mlir/include/mlir/Support/STLExtras.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/Support/STLExtras.h b/mlir/include/mlir/Support/STLExtras.h
index b49278fc9fd0..6cd1047b1ea5 100644
--- a/mlir/include/mlir/Support/STLExtras.h
+++ b/mlir/include/mlir/Support/STLExtras.h
@@ -93,11 +93,13 @@ inline void interleaveComma(const Container &c, raw_ostream &os) {
/// Note: We specify an explicit alignment here to allow use with PointerIntPair
/// and other utilities/data structures that require a known pointer alignment.
struct alignas(8) ClassID {
- template <typename T> static ClassID *getID() {
+ template <typename T>
+ LLVM_EXTERNAL_VISIBILITY static ClassID *getID() {
static ClassID id;
return &id;
}
- template <template <typename T> class Trait> static ClassID *getID() {
+ template <template <typename T> class Trait>
+ LLVM_EXTERNAL_VISIBILITY static ClassID *getID() {
static ClassID id;
return &id;
}
More information about the Mlir-commits
mailing list