From c6a33ff49dfb3498dae15c718820ea3d9c19f3cb Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 12 Sep 2023 12:53:24 -0700 Subject: [clang][CodeGen] Emit annotations for function declarations. Previously, annotations were only emitted for function definitions. With this change annotations are also emitted for declarations. Also, emitting function annotations is now deferred until the end so that the most up to date declaration is used which will have any inherited annotations. Differential Revision: https://reviews.llvm.org/D156172/new/ --- clang/lib/CodeGen/CodeGenModule.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 073b471..8b0d68a 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -431,6 +431,10 @@ private: /// Global annotations. std::vector Annotations; + // 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; + /// Map used to get unique annotation strings. llvm::StringMap AnnotationStrings; -- cgit v1.1