mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[Hexagon] Fix build: move template specialization into namespace scope
This commit is contained in:
parent
6218f09b03
commit
1a325ba866
@ -212,19 +212,6 @@ private:
|
||||
const_iterator end() const { return Blocks.end(); }
|
||||
};
|
||||
|
||||
template <typename T> static T *getIfUnordered(T *MaybeT) {
|
||||
return MaybeT && MaybeT->isUnordered() ? MaybeT : nullptr;
|
||||
}
|
||||
template <typename T> static T *isCandidate(Instruction *In) {
|
||||
return dyn_cast<T>(In);
|
||||
}
|
||||
template <> LoadInst *isCandidate<LoadInst>(Instruction *In) {
|
||||
return getIfUnordered(dyn_cast<LoadInst>(In));
|
||||
}
|
||||
template <> StoreInst *isCandidate<StoreInst>(Instruction *In) {
|
||||
return getIfUnordered(dyn_cast<StoreInst>(In));
|
||||
}
|
||||
|
||||
Align getAlignFromValue(const Value *V) const;
|
||||
Optional<MemoryLocation> getLocation(const Instruction &In) const;
|
||||
Optional<AddrInfo> getAddrInfo(Instruction &In) const;
|
||||
@ -294,6 +281,19 @@ raw_ostream &operator<<(raw_ostream &OS, const AlignVectors::ByteSpan &BS) {
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename T> T *getIfUnordered(T *MaybeT) {
|
||||
return MaybeT && MaybeT->isUnordered() ? MaybeT : nullptr;
|
||||
}
|
||||
template <typename T> T *isCandidate(Instruction *In) {
|
||||
return dyn_cast<T>(In);
|
||||
}
|
||||
template <> LoadInst *isCandidate<LoadInst>(Instruction *In) {
|
||||
return getIfUnordered(dyn_cast<LoadInst>(In));
|
||||
}
|
||||
template <> StoreInst *isCandidate<StoreInst>(Instruction *In) {
|
||||
return getIfUnordered(dyn_cast<StoreInst>(In));
|
||||
}
|
||||
|
||||
template <typename Pred, typename... Ts>
|
||||
void erase_if(std::map<Ts...> &map, Pred p) {
|
||||
for (auto i = map.begin(), e = map.end(); i != e;) {
|
||||
|
Loading…
Reference in New Issue
Block a user