summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/APValue.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-12 08:57:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-12 08:57:59 +0000
commitd3d6f4f65c77344ccf57f0ae9bea45d8c664ae0f (patch)
tree32d1efa4eb05a3ebcb8c3e987cf4d31910f4b300 /clang/lib/AST/APValue.cpp
parent91ab86fd29be1a2e0201cf214f8aaf3f24fafd8b (diff)
downloadbcm5719-llvm-d3d6f4f65c77344ccf57f0ae9bea45d8c664ae0f.tar.gz
bcm5719-llvm-d3d6f4f65c77344ccf57f0ae9bea45d8c664ae0f.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. This reinstates r360464 (reverted in r360531) with a workaround for an MSVC bug that previously caused the Windows bots to fail. llvm-svn: 360537
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