aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorBrendan Dahl <brendan.dahl@gmail.com>2023-09-12 12:53:24 -0700
committerDerek Schuff <dschuff@chromium.org>2023-09-12 13:07:55 -0700
commitc6a33ff49dfb3498dae15c718820ea3d9c19f3cb (patch)
tree6f81ba6f0fa5f3d4ab6cb558eae451647116b6af /clang/lib/CodeGen/CodeGenModule.h
parent3635c7437558870aa17310ff55074c48ab5683f8 (diff)
downloadllvm-c6a33ff49dfb3498dae15c718820ea3d9c19f3cb.zip
llvm-c6a33ff49dfb3498dae15c718820ea3d9c19f3cb.tar.gz
llvm-c6a33ff49dfb3498dae15c718820ea3d9c19f3cb.tar.bz2
[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/
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h4
1 files changed, 4 insertions, 0 deletions
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<llvm::Constant*> 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<StringRef, const ValueDecl *> DeferredAnnotations;
+
/// Map used to get unique annotation strings.
llvm::StringMap<llvm::Constant*> AnnotationStrings;