summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/APValue.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-10 20:05:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-10 20:05:32 +0000
commitc0fe5eb39c85756e02d1bf3e05127bc7e55a8973 (patch)
tree1c1b76932416544aa3a94743dd85f5607561eb09 /clang/lib/AST/APValue.cpp
parent5b5e27afa441f13fab524cb81c05dfaf54e22895 (diff)
downloadbcm5719-llvm-c0fe5eb39c85756e02d1bf3e05127bc7e55a8973.tar.gz
bcm5719-llvm-c0fe5eb39c85756e02d1bf3e05127bc7e55a8973.zip
Fix handling of objects under construction during constant expression
evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. llvm-svn: 360464
Diffstat (limited to 'clang/lib/AST/APValue.cpp')
-rw-r--r--clang/lib/AST/APValue.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index 9ed756d9d84..e7902e68780 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -58,13 +58,16 @@ llvm::DenseMapInfo<clang::APValue::LValueBase>::getTombstoneKey() {
DenseMapInfo<unsigned>::getTombstoneKey());
}
+namespace clang {
+llvm::hash_code hash_value(const APValue::LValueBase &Base) {
+ return llvm::hash_combine(Base.getOpaqueValue(), Base.getCallIndex(),
+ Base.getVersion());
+}
+}
+
unsigned llvm::DenseMapInfo<clang::APValue::LValueBase>::getHashValue(
const clang::APValue::LValueBase &Base) {
- llvm::FoldingSetNodeID ID;
- ID.AddPointer(Base.getOpaqueValue());
- ID.AddInteger(Base.getCallIndex());
- ID.AddInteger(Base.getVersion());
- return ID.ComputeHash();
+ return hash_value(Base);
}
bool llvm::DenseMapInfo<clang::APValue::LValueBase>::isEqual(
OpenPOWER on IntegriCloud