Last active
October 5, 2015 00:58
-
-
Save Keno/79b08a4b187c4d950dd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/include/llvm/Analysis/DominanceFrontier.h b/include/llvm/Analysis/DominanceFrontier.h | |
index fb73005..d0dfd86 100644 | |
--- a/include/llvm/Analysis/DominanceFrontier.h | |
+++ b/include/llvm/Analysis/DominanceFrontier.h | |
@@ -202,8 +202,8 @@ public: | |
void dump() const; | |
}; | |
-extern template class DominanceFrontierBase<BasicBlock>; | |
-extern template class ForwardDominanceFrontierBase<BasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION DominanceFrontierBase<BasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION ForwardDominanceFrontierBase<BasicBlock>; | |
} // End llvm namespace | |
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h | |
index 841c002..7cd3fc4 100644 | |
--- a/include/llvm/Analysis/LoopInfo.h | |
+++ b/include/llvm/Analysis/LoopInfo.h | |
@@ -347,7 +347,7 @@ raw_ostream& operator<<(raw_ostream &OS, const LoopBase<BlockT, LoopT> &Loop) { | |
} | |
// Implementation in LoopInfoImpl.h | |
-extern template class LoopBase<BasicBlock, Loop>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION LoopBase<BasicBlock, Loop>; | |
class Loop : public LoopBase<BasicBlock, Loop> { | |
public: | |
@@ -631,7 +631,7 @@ public: | |
}; | |
// Implementation in LoopInfoImpl.h | |
-extern template class LoopInfoBase<BasicBlock, Loop>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION LoopInfoBase<BasicBlock, Loop>; | |
class LoopInfo : public LoopInfoBase<BasicBlock, Loop> { | |
typedef LoopInfoBase<BasicBlock, Loop> BaseT; | |
diff --git a/include/llvm/Analysis/RegionInfo.h b/include/llvm/Analysis/RegionInfo.h | |
index 4988386..844074d 100644 | |
--- a/include/llvm/Analysis/RegionInfo.h | |
+++ b/include/llvm/Analysis/RegionInfo.h | |
@@ -913,9 +913,9 @@ inline raw_ostream &operator<<(raw_ostream &OS, | |
return OS << Node.template getNodeAs<BlockT>()->getName(); | |
} | |
-extern template class RegionBase<RegionTraits<Function>>; | |
-extern template class RegionNodeBase<RegionTraits<Function>>; | |
-extern template class RegionInfoBase<RegionTraits<Function>>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RegionBase<RegionTraits<Function>>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RegionNodeBase<RegionTraits<Function>>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RegionInfoBase<RegionTraits<Function>>; | |
} // End llvm namespace | |
#endif | |
diff --git a/include/llvm/CodeGen/GCMetadataPrinter.h b/include/llvm/CodeGen/GCMetadataPrinter.h | |
index 2208470..0738e27 100644 | |
--- a/include/llvm/CodeGen/GCMetadataPrinter.h | |
+++ b/include/llvm/CodeGen/GCMetadataPrinter.h | |
@@ -30,6 +30,7 @@ class GCMetadataPrinter; | |
/// GCMetadataPrinterRegistry - The GC assembly printer registry uses all the | |
/// defaults from Registry. | |
+extern template class LLVM_UNIQUE_INSTANTIATION Registry<GCMetadataPrinter>; | |
typedef Registry<GCMetadataPrinter> GCMetadataPrinterRegistry; | |
/// GCMetadataPrinter - Emits GC metadata as assembly code. Instances are | |
diff --git a/include/llvm/CodeGen/GCStrategy.h b/include/llvm/CodeGen/GCStrategy.h | |
index a1b8e89..340d7b4 100644 | |
--- a/include/llvm/CodeGen/GCStrategy.h | |
+++ b/include/llvm/CodeGen/GCStrategy.h | |
@@ -171,6 +171,7 @@ public: | |
/// Note that to use a custom GCMetadataPrinter w/gc.roots, you must also | |
/// register your GCMetadataPrinter subclass with the | |
/// GCMetadataPrinterRegistery as well. | |
+extern template class LLVM_UNIQUE_INSTANTIATION Registry<GCStrategy>; | |
typedef Registry<GCStrategy> GCRegistry; | |
} | |
diff --git a/include/llvm/CodeGen/LiveIntervalUnion.h b/include/llvm/CodeGen/LiveIntervalUnion.h | |
index f0f1637..16d7945 100644 | |
--- a/include/llvm/CodeGen/LiveIntervalUnion.h | |
+++ b/include/llvm/CodeGen/LiveIntervalUnion.h | |
@@ -37,6 +37,8 @@ overlap(const LiveInterval::Segment &VRSeg, | |
return VRSeg.start < LUSeg.stop() && LUSeg.start() < VRSeg.end; | |
} | |
+extern template class LLVM_UNIQUE_INSTANTIATION IntervalMap<SlotIndex, LiveInterval*>; | |
+ | |
/// Union of live intervals that are strong candidates for coalescing into a | |
/// single register (either physical or virtual depending on the context). We | |
/// expect the constituent live intervals to be disjoint, although we may | |
diff --git a/include/llvm/CodeGen/MachineDominanceFrontier.h b/include/llvm/CodeGen/MachineDominanceFrontier.h | |
index 4131194..d96d1af 100644 | |
--- a/include/llvm/CodeGen/MachineDominanceFrontier.h | |
+++ b/include/llvm/CodeGen/MachineDominanceFrontier.h | |
@@ -17,6 +17,9 @@ | |
namespace llvm { | |
+extern template class LLVM_UNIQUE_INSTANTIATION DominanceFrontierBase<MachineBasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION ForwardDominanceFrontierBase<MachineBasicBlock>; | |
+ | |
class MachineDominanceFrontier : public MachineFunctionPass { | |
ForwardDominanceFrontierBase<MachineBasicBlock> Base; | |
public: | |
diff --git a/include/llvm/CodeGen/MachineDominators.h b/include/llvm/CodeGen/MachineDominators.h | |
index a69936f..26de588 100644 | |
--- a/include/llvm/CodeGen/MachineDominators.h | |
+++ b/include/llvm/CodeGen/MachineDominators.h | |
@@ -29,8 +29,8 @@ inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB | |
this->Roots.push_back(MBB); | |
} | |
-extern template class DomTreeNodeBase<MachineBasicBlock>; | |
-extern template class DominatorTreeBase<MachineBasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION DomTreeNodeBase<MachineBasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION DominatorTreeBase<MachineBasicBlock>; | |
typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode; | |
diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h | |
index 4868b73..73042cf 100644 | |
--- a/include/llvm/CodeGen/MachineLoopInfo.h | |
+++ b/include/llvm/CodeGen/MachineLoopInfo.h | |
@@ -38,7 +38,7 @@ namespace llvm { | |
// Implementation in LoopInfoImpl.h | |
class MachineLoop; | |
-extern template class LoopBase<MachineBasicBlock, MachineLoop>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION LoopBase<MachineBasicBlock, MachineLoop>; | |
class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> { | |
public: | |
@@ -63,7 +63,7 @@ private: | |
}; | |
// Implementation in LoopInfoImpl.h | |
-extern template class LoopInfoBase<MachineBasicBlock, MachineLoop>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION LoopInfoBase<MachineBasicBlock, MachineLoop>; | |
class MachineLoopInfo : public MachineFunctionPass { | |
LoopInfoBase<MachineBasicBlock, MachineLoop> LI; | |
diff --git a/include/llvm/CodeGen/MachineRegionInfo.h b/include/llvm/CodeGen/MachineRegionInfo.h | |
index df9823f..1068dd3 100644 | |
--- a/include/llvm/CodeGen/MachineRegionInfo.h | |
+++ b/include/llvm/CodeGen/MachineRegionInfo.h | |
@@ -172,9 +172,9 @@ template <> struct GraphTraits<MachineRegionInfoPass*> | |
} | |
}; | |
-extern template class RegionBase<RegionTraits<MachineFunction>>; | |
-extern template class RegionNodeBase<RegionTraits<MachineFunction>>; | |
-extern template class RegionInfoBase<RegionTraits<MachineFunction>>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RegionBase<RegionTraits<MachineFunction>>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RegionNodeBase<RegionTraits<MachineFunction>>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RegionInfoBase<RegionTraits<MachineFunction>>; | |
} | |
#endif | |
diff --git a/include/llvm/IR/BasicBlock.h b/include/llvm/IR/BasicBlock.h | |
index 08e30bd..3596962 100644 | |
--- a/include/llvm/IR/BasicBlock.h | |
+++ b/include/llvm/IR/BasicBlock.h | |
@@ -20,6 +20,7 @@ | |
#include "llvm/IR/SymbolTableListTraits.h" | |
#include "llvm/Support/CBindingWrapping.h" | |
#include "llvm/Support/DataTypes.h" | |
+#include "llvm/Support/Compiler.h" | |
namespace llvm { | |
@@ -31,6 +32,7 @@ class BlockAddress; | |
class Function; | |
// Traits for intrusive list of basic blocks... | |
+extern template class LLVM_UNIQUE_INSTANTIATION SymbolTableListTraits<Instruction, BasicBlock>; | |
template<> struct ilist_traits<BasicBlock> | |
: public SymbolTableListTraits<BasicBlock, Function> { | |
diff --git a/include/llvm/IR/Dominators.h b/include/llvm/IR/Dominators.h | |
index 37447c3..4e4b98c 100644 | |
--- a/include/llvm/IR/Dominators.h | |
+++ b/include/llvm/IR/Dominators.h | |
@@ -36,12 +36,12 @@ namespace llvm { | |
template <typename IRUnitT> class AnalysisManager; | |
class PreservedAnalyses; | |
-extern template class DomTreeNodeBase<BasicBlock>; | |
-extern template class DominatorTreeBase<BasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION DomTreeNodeBase<BasicBlock>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION DominatorTreeBase<BasicBlock>; | |
-extern template void Calculate<Function, BasicBlock *>( | |
+extern template void LLVM_UNIQUE_INSTANTIATION Calculate<Function, BasicBlock *>( | |
DominatorTreeBase<GraphTraits<BasicBlock *>::NodeType> &DT, Function &F); | |
-extern template void Calculate<Function, Inverse<BasicBlock *>>( | |
+extern template void LLVM_UNIQUE_INSTANTIATION Calculate<Function, Inverse<BasicBlock *>>( | |
DominatorTreeBase<GraphTraits<Inverse<BasicBlock *>>::NodeType> &DT, | |
Function &F); | |
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h | |
index 0121786..fa5b9dc 100644 | |
--- a/include/llvm/IR/Function.h | |
+++ b/include/llvm/IR/Function.h | |
@@ -34,6 +34,10 @@ class FunctionType; | |
class LLVMContext; | |
class DISubprogram; | |
+extern template class LLVM_UNIQUE_INSTANTIATION | |
+ llvm::SymbolTableListTraits<Argument, Function>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION | |
+ llvm::SymbolTableListTraits<BasicBlock, Function>; | |
template<> struct ilist_traits<Argument> | |
: public SymbolTableListTraits<Argument, Function> { | |
diff --git a/include/llvm/IR/GlobalVariable.h b/include/llvm/IR/GlobalVariable.h | |
index a015983..5a2dfd4 100644 | |
--- a/include/llvm/IR/GlobalVariable.h | |
+++ b/include/llvm/IR/GlobalVariable.h | |
@@ -24,6 +24,7 @@ | |
#include "llvm/ADT/ilist_node.h" | |
#include "llvm/IR/GlobalObject.h" | |
#include "llvm/IR/OperandTraits.h" | |
+#include "llvm/IR/SymbolTableListTraits.h" | |
namespace llvm { | |
diff --git a/include/llvm/IR/Instruction.h b/include/llvm/IR/Instruction.h | |
index 000e854..088d66d 100644 | |
--- a/include/llvm/IR/Instruction.h | |
+++ b/include/llvm/IR/Instruction.h | |
@@ -29,6 +29,7 @@ class MDNode; | |
class BasicBlock; | |
struct AAMDNodes; | |
+extern template class LLVM_UNIQUE_INSTANTIATION SymbolTableListTraits<Instruction, BasicBlock>; | |
template <> | |
struct ilist_traits<Instruction> | |
: public SymbolTableListTraits<Instruction, BasicBlock> { | |
diff --git a/include/llvm/IR/Module.h b/include/llvm/IR/Module.h | |
index 8bb9c21..2662afe 100644 | |
--- a/include/llvm/IR/Module.h | |
+++ b/include/llvm/IR/Module.h | |
@@ -22,6 +22,7 @@ | |
#include "llvm/IR/GlobalAlias.h" | |
#include "llvm/IR/GlobalVariable.h" | |
#include "llvm/IR/Metadata.h" | |
+#include "llvm/IR/SymbolTableListTraits.h" | |
#include "llvm/Support/CBindingWrapping.h" | |
#include "llvm/Support/CodeGen.h" | |
#include "llvm/Support/DataTypes.h" | |
@@ -34,6 +35,12 @@ class LLVMContext; | |
class RandomNumberGenerator; | |
class StructType; | |
+extern template class LLVM_UNIQUE_INSTANTIATION | |
+ SymbolTableListTraits<Function, Module>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION | |
+ SymbolTableListTraits<GlobalVariable, Module>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION | |
+ SymbolTableListTraits<GlobalAlias, Module>; | |
template<> struct ilist_traits<Function> | |
: public SymbolTableListTraits<Function, Module> { | |
diff --git a/include/llvm/IR/SymbolTableListTraits.h b/include/llvm/IR/SymbolTableListTraits.h | |
index 87dd366..1424202 100644 | |
--- a/include/llvm/IR/SymbolTableListTraits.h | |
+++ b/include/llvm/IR/SymbolTableListTraits.h | |
@@ -69,7 +69,7 @@ public: | |
ilist_iterator<ValueSubClass> last); | |
//private: | |
template<typename TPtr> | |
- void setSymTabObject(TPtr *, TPtr); | |
+ LLVM_LIBRARY_VISIBILITY void setSymTabObject(TPtr *, TPtr); | |
static ValueSymbolTable *toPtr(ValueSymbolTable *P) { return P; } | |
static ValueSymbolTable *toPtr(ValueSymbolTable &R) { return &R; } | |
}; | |
diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h | |
index 7c3d49f..21c3c3f 100644 | |
--- a/include/llvm/PassSupport.h | |
+++ b/include/llvm/PassSupport.h | |
@@ -92,9 +92,9 @@ class TargetMachine; | |
PassName::registerOptions(); \ | |
template<typename PassName> | |
-Pass *callDefaultCtor() { return new PassName(); } | |
+LLVM_LIBRARY_VISIBILITY Pass *callDefaultCtor() { return new PassName(); } | |
-template <typename PassName> Pass *callTargetMachineCtor(TargetMachine *TM) { | |
+template <typename PassName> LLVM_LIBRARY_VISIBILITY Pass *callTargetMachineCtor(TargetMachine *TM) { | |
return new PassName(TM); | |
} | |
diff --git a/include/llvm/ProfileData/InstrProfReader.h b/include/llvm/ProfileData/InstrProfReader.h | |
index c0585d6..8f3d7e2 100644 | |
--- a/include/llvm/ProfileData/InstrProfReader.h | |
+++ b/include/llvm/ProfileData/InstrProfReader.h | |
@@ -185,6 +185,9 @@ private: | |
} | |
}; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RawInstrProfReader<uint32_t>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION RawInstrProfReader<uint64_t>; | |
+ | |
typedef RawInstrProfReader<uint32_t> RawInstrProfReader32; | |
typedef RawInstrProfReader<uint64_t> RawInstrProfReader64; | |
diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h | |
index 467dc12..4a21366 100644 | |
--- a/include/llvm/Support/CommandLine.h | |
+++ b/include/llvm/Support/CommandLine.h | |
@@ -789,7 +789,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<bool>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<bool>; | |
//-------------------------------------------------- | |
// parser<boolOrDefault> | |
@@ -815,7 +815,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<boolOrDefault>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<boolOrDefault>; | |
//-------------------------------------------------- | |
// parser<int> | |
@@ -837,7 +837,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<int>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<int>; | |
//-------------------------------------------------- | |
// parser<unsigned> | |
@@ -859,7 +859,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<unsigned>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<unsigned>; | |
//-------------------------------------------------- | |
// parser<unsigned long long> | |
@@ -884,7 +884,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<unsigned long long>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<unsigned long long>; | |
//-------------------------------------------------- | |
// parser<double> | |
@@ -906,7 +906,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<double>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<double>; | |
//-------------------------------------------------- | |
// parser<float> | |
@@ -928,7 +928,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<float>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<float>; | |
//-------------------------------------------------- | |
// parser<std::string> | |
@@ -953,7 +953,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<std::string>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<std::string>; | |
//-------------------------------------------------- | |
// parser<char> | |
@@ -978,7 +978,7 @@ public: | |
void anchor() override; | |
}; | |
-extern template class basic_parser<char>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION basic_parser<char>; | |
//-------------------------------------------------- | |
// PrintOptionDiff | |
@@ -1253,11 +1253,11 @@ public: | |
} | |
}; | |
-extern template class opt<unsigned>; | |
-extern template class opt<int>; | |
-extern template class opt<std::string>; | |
-extern template class opt<char>; | |
-extern template class opt<bool>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION opt<unsigned>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION opt<int>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION opt<std::string>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION opt<char>; | |
+extern template class LLVM_UNIQUE_INSTANTIATION opt<bool>; | |
//===----------------------------------------------------------------------===// | |
// list_storage class | |
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h | |
index f744237..b46d76a 100644 | |
--- a/include/llvm/Support/Compiler.h | |
+++ b/include/llvm/Support/Compiler.h | |
@@ -150,6 +150,12 @@ | |
#define LLVM_ATTRIBUTE_WEAK | |
#endif | |
+#if __has_attribute(unique_instantiation) | |
+#define LLVM_UNIQUE_INSTANTIATION __attribute__((unique_instantiation)) | |
+#else | |
+#define LLVM_UNIQUE_INSTANTIATION | |
+#endif | |
+ | |
// Prior to clang 3.2, clang did not accept any spelling of | |
// __has_attribute(const), so assume it is supported. | |
#if defined(__clang__) || defined(__GNUC__) | |
diff --git a/include/llvm/Support/ManagedStatic.h b/include/llvm/Support/ManagedStatic.h | |
index 2e131e4..997d580 100644 | |
--- a/include/llvm/Support/ManagedStatic.h | |
+++ b/include/llvm/Support/ManagedStatic.h | |
@@ -22,7 +22,7 @@ namespace llvm { | |
/// object_creator - Helper method for ManagedStatic. | |
template<class C> | |
-void* object_creator() { | |
+LLVM_LIBRARY_VISIBILITY void* object_creator() { | |
return new C(); | |
} | |
diff --git a/lib/Analysis/DominanceFrontier.cpp b/lib/Analysis/DominanceFrontier.cpp | |
index 7ba91bc..98f10d8 100644 | |
--- a/lib/Analysis/DominanceFrontier.cpp | |
+++ b/lib/Analysis/DominanceFrontier.cpp | |
@@ -13,8 +13,8 @@ | |
using namespace llvm; | |
namespace llvm { | |
-template class DominanceFrontierBase<BasicBlock>; | |
-template class ForwardDominanceFrontierBase<BasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION DominanceFrontierBase<BasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION ForwardDominanceFrontierBase<BasicBlock>; | |
} | |
char DominanceFrontier::ID = 0; | |
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp | |
index 3d30c3a..264f72c 100644 | |
--- a/lib/Analysis/LoopInfo.cpp | |
+++ b/lib/Analysis/LoopInfo.cpp | |
@@ -34,8 +34,8 @@ | |
using namespace llvm; | |
// Explicitly instantiate methods in LoopInfoImpl.h for IR-level Loops. | |
-template class llvm::LoopBase<BasicBlock, Loop>; | |
-template class llvm::LoopInfoBase<BasicBlock, Loop>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::LoopBase<BasicBlock, Loop>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::LoopInfoBase<BasicBlock, Loop>; | |
// Always verify loopinfo if expensive checking is enabled. | |
#ifdef XDEBUG | |
diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp | |
index f59d267..fc3ab78c 100644 | |
--- a/lib/Analysis/RegionInfo.cpp | |
+++ b/lib/Analysis/RegionInfo.cpp | |
@@ -30,9 +30,9 @@ using namespace llvm; | |
#define DEBUG_TYPE "region" | |
namespace llvm { | |
-template class RegionBase<RegionTraits<Function>>; | |
-template class RegionNodeBase<RegionTraits<Function>>; | |
-template class RegionInfoBase<RegionTraits<Function>>; | |
+template class LLVM_UNIQUE_INSTANTIATION RegionBase<RegionTraits<Function>>; | |
+template class LLVM_UNIQUE_INSTANTIATION RegionNodeBase<RegionTraits<Function>>; | |
+template class LLVM_UNIQUE_INSTANTIATION RegionInfoBase<RegionTraits<Function>>; | |
} | |
STATISTIC(numRegions, "The # of regions"); | |
diff --git a/lib/CodeGen/GCMetadataPrinter.cpp b/lib/CodeGen/GCMetadataPrinter.cpp | |
index bb8cfa1..05ec164 100644 | |
--- a/lib/CodeGen/GCMetadataPrinter.cpp | |
+++ b/lib/CodeGen/GCMetadataPrinter.cpp | |
@@ -14,6 +14,10 @@ | |
#include "llvm/CodeGen/GCMetadataPrinter.h" | |
using namespace llvm; | |
+namespace llvm { | |
+ template class LLVM_UNIQUE_INSTANTIATION llvm::Registry<GCMetadataPrinter>; | |
+} | |
+ | |
GCMetadataPrinter::GCMetadataPrinter() {} | |
GCMetadataPrinter::~GCMetadataPrinter() {} | |
diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp | |
index 554d326..33040bd 100644 | |
--- a/lib/CodeGen/GCStrategy.cpp | |
+++ b/lib/CodeGen/GCStrategy.cpp | |
@@ -16,6 +16,8 @@ | |
using namespace llvm; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::Registry<GCStrategy>; | |
+ | |
GCStrategy::GCStrategy() | |
: UseStatepoints(false), NeededSafePoints(0), CustomReadBarriers(false), | |
CustomWriteBarriers(false), CustomRoots(false), InitRoots(true), | |
diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp | |
index 1571551..81d2946 100644 | |
--- a/lib/CodeGen/LiveDebugVariables.cpp | |
+++ b/lib/CodeGen/LiveDebugVariables.cpp | |
@@ -75,6 +75,11 @@ LiveDebugVariables::LiveDebugVariables() : MachineFunctionPass(ID), pImpl(nullpt | |
/// LocMap - Map of where a user value is live, and its location. | |
typedef IntervalMap<SlotIndex, unsigned, 4> LocMap; | |
+namespace llvm { | |
+ extern template class LLVM_UNIQUE_INSTANTIATION IntervalMap<SlotIndex, unsigned, 4>; | |
+ template class LLVM_UNIQUE_INSTANTIATION IntervalMap<SlotIndex, unsigned, 4>; | |
+} | |
+ | |
namespace { | |
/// UserValueScopes - Keeps track of lexical scopes associated with a | |
/// user value's source location. | |
diff --git a/lib/CodeGen/LiveIntervalUnion.cpp b/lib/CodeGen/LiveIntervalUnion.cpp | |
index 025d99c..9ff7413 100644 | |
--- a/lib/CodeGen/LiveIntervalUnion.cpp | |
+++ b/lib/CodeGen/LiveIntervalUnion.cpp | |
@@ -24,6 +24,9 @@ using namespace llvm; | |
#define DEBUG_TYPE "regalloc" | |
+namespace llvm { | |
+template class LLVM_UNIQUE_INSTANTIATION IntervalMap<SlotIndex, LiveInterval*>; | |
+} | |
// Merge a LiveInterval's segments. Guarantee no overlaps. | |
void LiveIntervalUnion::unify(LiveInterval &VirtReg, const LiveRange &Range) { | |
diff --git a/lib/CodeGen/MachineDominanceFrontier.cpp b/lib/CodeGen/MachineDominanceFrontier.cpp | |
index acb7c48..06b2c4c 100644 | |
--- a/lib/CodeGen/MachineDominanceFrontier.cpp | |
+++ b/lib/CodeGen/MachineDominanceFrontier.cpp | |
@@ -16,8 +16,8 @@ | |
using namespace llvm; | |
namespace llvm { | |
-template class DominanceFrontierBase<MachineBasicBlock>; | |
-template class ForwardDominanceFrontierBase<MachineBasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION DominanceFrontierBase<MachineBasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION ForwardDominanceFrontierBase<MachineBasicBlock>; | |
} | |
diff --git a/lib/CodeGen/MachineDominators.cpp b/lib/CodeGen/MachineDominators.cpp | |
index 3f04bb0..628e66a 100644 | |
--- a/lib/CodeGen/MachineDominators.cpp | |
+++ b/lib/CodeGen/MachineDominators.cpp | |
@@ -19,8 +19,8 @@ | |
using namespace llvm; | |
namespace llvm { | |
-template class DomTreeNodeBase<MachineBasicBlock>; | |
-template class DominatorTreeBase<MachineBasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION DomTreeNodeBase<MachineBasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION DominatorTreeBase<MachineBasicBlock>; | |
} | |
char MachineDominatorTree::ID = 0; | |
diff --git a/lib/CodeGen/MachineLoopInfo.cpp b/lib/CodeGen/MachineLoopInfo.cpp | |
index e19e6e3..9d2e8f0 100644 | |
--- a/lib/CodeGen/MachineLoopInfo.cpp | |
+++ b/lib/CodeGen/MachineLoopInfo.cpp | |
@@ -23,8 +23,8 @@ | |
using namespace llvm; | |
// Explicitly instantiate methods in LoopInfoImpl.h for MI-level Loops. | |
-template class llvm::LoopBase<MachineBasicBlock, MachineLoop>; | |
-template class llvm::LoopInfoBase<MachineBasicBlock, MachineLoop>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::LoopBase<MachineBasicBlock, MachineLoop>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::LoopInfoBase<MachineBasicBlock, MachineLoop>; | |
char MachineLoopInfo::ID = 0; | |
INITIALIZE_PASS_BEGIN(MachineLoopInfo, "machine-loops", | |
diff --git a/lib/CodeGen/MachineRegionInfo.cpp b/lib/CodeGen/MachineRegionInfo.cpp | |
index 01d2c2e..dbb47fa 100644 | |
--- a/lib/CodeGen/MachineRegionInfo.cpp | |
+++ b/lib/CodeGen/MachineRegionInfo.cpp | |
@@ -12,9 +12,9 @@ STATISTIC(numMachineRegions, "The # of machine regions"); | |
STATISTIC(numMachineSimpleRegions, "The # of simple machine regions"); | |
namespace llvm { | |
-template class RegionBase<RegionTraits<MachineFunction>>; | |
-template class RegionNodeBase<RegionTraits<MachineFunction>>; | |
-template class RegionInfoBase<RegionTraits<MachineFunction>>; | |
+template class LLVM_UNIQUE_INSTANTIATION RegionBase<RegionTraits<MachineFunction>>; | |
+template class LLVM_UNIQUE_INSTANTIATION RegionNodeBase<RegionTraits<MachineFunction>>; | |
+template class LLVM_UNIQUE_INSTANTIATION RegionInfoBase<RegionTraits<MachineFunction>>; | |
} | |
//===----------------------------------------------------------------------===// | |
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp | |
index 665ed3b..f93036d 100644 | |
--- a/lib/CodeGen/SplitKit.cpp | |
+++ b/lib/CodeGen/SplitKit.cpp | |
@@ -36,6 +36,10 @@ STATISTIC(NumCopies, "Number of copies inserted for splitting"); | |
STATISTIC(NumRemats, "Number of rematerialized defs for splitting"); | |
STATISTIC(NumRepairs, "Number of invalid live ranges repaired"); | |
+namespace llvm { | |
+template class LLVM_UNIQUE_INSTANTIATION IntervalMap<SlotIndex, unsigned>; | |
+} | |
+ | |
//===----------------------------------------------------------------------===// | |
// Split Analysis | |
//===----------------------------------------------------------------------===// | |
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h | |
index 69c65ff..0f7511f 100644 | |
--- a/lib/CodeGen/SplitKit.h | |
+++ b/lib/CodeGen/SplitKit.h | |
@@ -196,6 +196,7 @@ public: | |
bool shouldSplitSingleBlock(const BlockInfo &BI, bool SingleInstrs) const; | |
}; | |
+extern template class LLVM_UNIQUE_INSTANTIATION IntervalMap<SlotIndex, unsigned>; | |
/// SplitEditor - Edit machine code and LiveIntervals for live range | |
/// splitting. | |
diff --git a/lib/IR/BasicBlock.cpp b/lib/IR/BasicBlock.cpp | |
index 76bf176..e51da7f 100644 | |
--- a/lib/IR/BasicBlock.cpp | |
+++ b/lib/IR/BasicBlock.cpp | |
@@ -35,7 +35,7 @@ LLVMContext &BasicBlock::getContext() const { | |
// Explicit instantiation of SymbolTableListTraits since some of the methods | |
// are not in the public header file... | |
-template class llvm::SymbolTableListTraits<Instruction, BasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::SymbolTableListTraits<Instruction, BasicBlock>; | |
BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent, | |
diff --git a/lib/IR/Dominators.cpp b/lib/IR/Dominators.cpp | |
index d94e31d..3f7a914 100644 | |
--- a/lib/IR/Dominators.cpp | |
+++ b/lib/IR/Dominators.cpp | |
@@ -62,12 +62,12 @@ bool BasicBlockEdge::isSingleEdge() const { | |
// | |
//===----------------------------------------------------------------------===// | |
-template class llvm::DomTreeNodeBase<BasicBlock>; | |
-template class llvm::DominatorTreeBase<BasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::DomTreeNodeBase<BasicBlock>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::DominatorTreeBase<BasicBlock>; | |
-template void llvm::Calculate<Function, BasicBlock *>( | |
+template void LLVM_UNIQUE_INSTANTIATION llvm::Calculate<Function, BasicBlock *>( | |
DominatorTreeBase<GraphTraits<BasicBlock *>::NodeType> &DT, Function &F); | |
-template void llvm::Calculate<Function, Inverse<BasicBlock *>>( | |
+template void LLVM_UNIQUE_INSTANTIATION llvm::Calculate<Function, Inverse<BasicBlock *>>( | |
DominatorTreeBase<GraphTraits<Inverse<BasicBlock *>>::NodeType> &DT, | |
Function &F); | |
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp | |
index 64ebdb4..fed9acc 100644 | |
--- a/lib/IR/Function.cpp | |
+++ b/lib/IR/Function.cpp | |
@@ -35,8 +35,8 @@ using namespace llvm; | |
// Explicit instantiations of SymbolTableListTraits since some of the methods | |
// are not in the public header file... | |
-template class llvm::SymbolTableListTraits<Argument, Function>; | |
-template class llvm::SymbolTableListTraits<BasicBlock, Function>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::SymbolTableListTraits<Argument, Function>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::SymbolTableListTraits<BasicBlock, Function>; | |
//===----------------------------------------------------------------------===// | |
// Argument Implementation | |
diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp | |
index 7d8c352..df0e4c7 100644 | |
--- a/lib/IR/Metadata.cpp | |
+++ b/lib/IR/Metadata.cpp | |
@@ -14,7 +14,6 @@ | |
#include "llvm/IR/Metadata.h" | |
#include "LLVMContextImpl.h" | |
#include "MetadataImpl.h" | |
-#include "SymbolTableListTraitsImpl.h" | |
#include "llvm/ADT/DenseMap.h" | |
#include "llvm/ADT/STLExtras.h" | |
#include "llvm/ADT/SmallSet.h" | |
diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp | |
index 87cd222..e74236f 100644 | |
--- a/lib/IR/Module.cpp | |
+++ b/lib/IR/Module.cpp | |
@@ -37,9 +37,9 @@ using namespace llvm; | |
// Explicit instantiations of SymbolTableListTraits since some of the methods | |
// are not in the public header file. | |
-template class llvm::SymbolTableListTraits<Function, Module>; | |
-template class llvm::SymbolTableListTraits<GlobalVariable, Module>; | |
-template class llvm::SymbolTableListTraits<GlobalAlias, Module>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::SymbolTableListTraits<Function, Module>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::SymbolTableListTraits<GlobalVariable, Module>; | |
+template class LLVM_UNIQUE_INSTANTIATION llvm::SymbolTableListTraits<GlobalAlias, Module>; | |
//===----------------------------------------------------------------------===// | |
// Primitive Module methods. | |
diff --git a/lib/IR/SymbolTableListTraitsImpl.h b/lib/IR/SymbolTableListTraitsImpl.h | |
index a18f982..209b880 100644 | |
--- a/lib/IR/SymbolTableListTraitsImpl.h | |
+++ b/lib/IR/SymbolTableListTraitsImpl.h | |
@@ -26,7 +26,7 @@ namespace llvm { | |
/// the current function and reinsert them into the new function. | |
template<typename ValueSubClass, typename ItemParentClass> | |
template<typename TPtr> | |
-void SymbolTableListTraits<ValueSubClass,ItemParentClass> | |
+LLVM_LIBRARY_VISIBILITY void SymbolTableListTraits<ValueSubClass,ItemParentClass> | |
::setSymTabObject(TPtr *Dest, TPtr Src) { | |
// Get the old symtab and value list before doing the assignment. | |
ValueSymbolTable *OldST = TraitsClass::getSymTab(getListOwner()); | |
diff --git a/lib/ProfileData/InstrProfReader.cpp b/lib/ProfileData/InstrProfReader.cpp | |
index ff93c4d..dd5602f 100644 | |
--- a/lib/ProfileData/InstrProfReader.cpp | |
+++ b/lib/ProfileData/InstrProfReader.cpp | |
@@ -290,8 +290,8 @@ RawInstrProfReader<IntPtrT>::readNextRecord(InstrProfRecord &Record) { | |
} | |
namespace llvm { | |
-template class RawInstrProfReader<uint32_t>; | |
-template class RawInstrProfReader<uint64_t>; | |
+template class LLVM_UNIQUE_INSTANTIATION RawInstrProfReader<uint32_t>; | |
+template class LLVM_UNIQUE_INSTANTIATION RawInstrProfReader<uint64_t>; | |
} | |
InstrProfLookupTrait::hash_value_type | |
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp | |
index 11162ce..adf273f 100644 | |
--- a/lib/Support/CommandLine.cpp | |
+++ b/lib/Support/CommandLine.cpp | |
@@ -46,21 +46,21 @@ using namespace cl; | |
// | |
namespace llvm { | |
namespace cl { | |
-template class basic_parser<bool>; | |
-template class basic_parser<boolOrDefault>; | |
-template class basic_parser<int>; | |
-template class basic_parser<unsigned>; | |
-template class basic_parser<unsigned long long>; | |
-template class basic_parser<double>; | |
-template class basic_parser<float>; | |
-template class basic_parser<std::string>; | |
-template class basic_parser<char>; | |
- | |
-template class opt<unsigned>; | |
-template class opt<int>; | |
-template class opt<std::string>; | |
-template class opt<char>; | |
-template class opt<bool>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<bool>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<boolOrDefault>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<int>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<unsigned>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<unsigned long long>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<double>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<float>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<std::string>; | |
+template class LLVM_UNIQUE_INSTANTIATION basic_parser<char>; | |
+ | |
+template class LLVM_UNIQUE_INSTANTIATION opt<unsigned>; | |
+template class LLVM_UNIQUE_INSTANTIATION opt<int>; | |
+template class LLVM_UNIQUE_INSTANTIATION opt<std::string>; | |
+template class LLVM_UNIQUE_INSTANTIATION opt<char>; | |
+template class LLVM_UNIQUE_INSTANTIATION opt<bool>; | |
} | |
} // end namespace llvm::cl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment