diff options
author | Fangrui Song <i@maskray.me> | 2024-06-28 15:10:53 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-06-28 15:10:53 -0700 |
commit | 664497557ae7e726b424d325533cdce8104b3337 (patch) | |
tree | bb2e4826295437eb41b1c655cdff4bb14178addb /clang/lib/CodeGen/CodeGenModule.h | |
parent | ded956440739ae326a99cbaef18ce4362e972679 (diff) | |
download | llvm-664497557ae7e726b424d325533cdce8104b3337.zip llvm-664497557ae7e726b424d325533cdce8104b3337.tar.gz llvm-664497557ae7e726b424d325533cdce8104b3337.tar.bz2 |
[CodeGen] Use MapVector to stabilize iteration order
Otherwise clang/test/CodeGenCXX/attr-annotate.cpp
output could fail when llvm::hash_value(StringRef) changes
(#96282).
EmitGlobalAnnotations iterates over DeferredAnnotations.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 22b2b31..4796d42 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -435,7 +435,7 @@ private: // Store deferred function annotations so they can be emitted at the end with // most up to date ValueDecl that will have all the inherited annotations. - llvm::DenseMap<StringRef, const ValueDecl *> DeferredAnnotations; + llvm::MapVector<StringRef, const ValueDecl *> DeferredAnnotations; /// Map used to get unique annotation strings. llvm::StringMap<llvm::Constant*> AnnotationStrings; |