diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-05-12 08:57:59 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-05-12 08:57:59 +0000 |
commit | d3d6f4f65c77344ccf57f0ae9bea45d8c664ae0f (patch) | |
tree | 32d1efa4eb05a3ebcb8c3e987cf4d31910f4b300 /clang/lib/AST/APValue.cpp | |
parent | 91ab86fd29be1a2e0201cf214f8aaf3f24fafd8b (diff) | |
download | bcm5719-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.cpp | 13 |
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( |