summaryrefslogtreecommitdiffstats
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2018-07-25 22:52:05 +0000
committerRichard Trieu <rtrieu@google.com>2018-07-25 22:52:05 +0000
commitc78e9948f0c4544e0f6d28180d8c37f09d55d013 (patch)
tree1bd8a5b1db3137a4fafb9706e56ac0b808de9303 /lib/AST/Decl.cpp
parenta465f7c8c4f2c7c23099ea45caba0744a4be7c8a (diff)
[ODRHash] Support hashing enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index a23499f3fe..3b9b85a20a 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -3973,6 +3973,17 @@ void EnumDecl::setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED,
SpecializationInfo = new (C) MemberSpecializationInfo(ED, TSK);
}
+unsigned EnumDecl::getODRHash() {
+ if (HasODRHash)
+ return ODRHash;
+
+ class ODRHash Hash;
+ Hash.AddEnumDecl(this);
+ HasODRHash = true;
+ ODRHash = Hash.CalculateHash();
+ return ODRHash;
+}
+
//===----------------------------------------------------------------------===//
// RecordDecl Implementation
//===----------------------------------------------------------------------===//