From 664497557ae7e726b424d325533cdce8104b3337 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 28 Jun 2024 15:10:53 -0700 Subject: [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. --- clang/lib/CodeGen/CodeGenModule.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.h') 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 DeferredAnnotations; + llvm::MapVector DeferredAnnotations; /// Map used to get unique annotation strings. llvm::StringMap AnnotationStrings; -- cgit v1.1