summaryrefslogtreecommitdiffstats
path: root/lib/IR/LLVMContextImpl.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
committerdim <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
commitd2fc7c7001ed3babcd0106d15dd70224abfb6f29 (patch)
tree7c411f9b5d807f7f204fdd16965d8925a82b6d18 /lib/IR/LLVMContextImpl.h
parent60174f118de85cbcad51deb11c650f22c9be2235 (diff)
downloadFreeBSD-src-d2fc7c7001ed3babcd0106d15dd70224abfb6f29.zip
FreeBSD-src-d2fc7c7001ed3babcd0106d15dd70224abfb6f29.tar.gz
Vendor import of llvm trunk r241361:
https://llvm.org/svn/llvm-project/llvm/trunk@241361
Diffstat (limited to 'lib/IR/LLVMContextImpl.h')
-rw-r--r--lib/IR/LLVMContextImpl.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
index 41a898b..cbbf11e 100644
--- a/lib/IR/LLVMContextImpl.h
+++ b/lib/IR/LLVMContextImpl.h
@@ -651,6 +651,35 @@ template <> struct MDNodeKeyImpl<DINamespace> {
}
};
+template <> struct MDNodeKeyImpl<DIModule> {
+ Metadata *Scope;
+ StringRef Name;
+ StringRef ConfigurationMacros;
+ StringRef IncludePath;
+ StringRef ISysRoot;
+ MDNodeKeyImpl(Metadata *Scope, StringRef Name,
+ StringRef ConfigurationMacros,
+ StringRef IncludePath,
+ StringRef ISysRoot)
+ : Scope(Scope), Name(Name), ConfigurationMacros(ConfigurationMacros),
+ IncludePath(IncludePath), ISysRoot(ISysRoot) {}
+ MDNodeKeyImpl(const DIModule *N)
+ : Scope(N->getRawScope()), Name(N->getName()),
+ ConfigurationMacros(N->getConfigurationMacros()),
+ IncludePath(N->getIncludePath()), ISysRoot(N->getISysRoot()) {}
+
+ bool isKeyOf(const DIModule *RHS) const {
+ return Scope == RHS->getRawScope() && Name == RHS->getName() &&
+ ConfigurationMacros == RHS->getConfigurationMacros() &&
+ IncludePath == RHS->getIncludePath() &&
+ ISysRoot == RHS->getISysRoot();
+ }
+ unsigned getHashValue() const {
+ return hash_combine(Scope, Name,
+ ConfigurationMacros, IncludePath, ISysRoot);
+ }
+};
+
template <> struct MDNodeKeyImpl<DITemplateTypeParameter> {
StringRef Name;
Metadata *Type;
@@ -1025,6 +1054,6 @@ public:
void dropTriviallyDeadConstantArrays();
};
-} // namespace llvm
+}
#endif
OpenPOWER on IntegriCloud