aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorBrendan Dahl <brendan.dahl@gmail.com>2023-11-29 15:13:30 -0800
committerGitHub <noreply@github.com>2023-11-29 15:13:30 -0800
commitc6d70722b49db01914d5f64cc86ea5ed609ad9fd (patch)
tree77ba601cfe40fae3dd863127213a6f452ae50933 /clang/lib/CodeGen/CodeGenModule.h
parentefc60dc00796fd113e057a92c6861eeb57e649ae (diff)
downloadllvm-c6d70722b49db01914d5f64cc86ea5ed609ad9fd.zip
llvm-c6d70722b49db01914d5f64cc86ea5ed609ad9fd.tar.gz
llvm-c6d70722b49db01914d5f64cc86ea5ed609ad9fd.tar.bz2
[clang][CodeGen] Emit annotations for function declarations. (#66716)
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.
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 e81edc9..ec34680f 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;