aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorTyker <tyker1@outlook.com>2020-10-26 09:58:20 +0100
committerTyker <tyker1@outlook.com>2020-10-26 10:50:05 +0100
commitd3205bbca3e0002d76282878986993e7e7994779 (patch)
tree9b4e41ff8ae3240d34d0b1a4d85266904ded8ef2 /clang/lib/CodeGen/CodeGenModule.h
parent8aa60f67dc8c67390680b7a3be0d31384300f09f (diff)
downloadllvm-d3205bbca3e0002d76282878986993e7e7994779.zip
llvm-d3205bbca3e0002d76282878986993e7e7994779.tar.gz
llvm-d3205bbca3e0002d76282878986993e7e7994779.tar.bz2
[Annotation] Allows annotation to carry some additional constant arguments.
This allows using annotation in a much more contexts than it currently has. especially when annotation with template or constexpr. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D88645
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index b3babc8..cb5b9bd 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -413,6 +413,9 @@ private:
/// Map used to get unique annotation strings.
llvm::StringMap<llvm::Constant*> AnnotationStrings;
+ /// Used for uniquing of annotation arguments.
+ llvm::DenseMap<unsigned, llvm::Constant *> AnnotationArgs;
+
llvm::StringMap<llvm::GlobalVariable *> CFConstantStringMap;
llvm::DenseMap<llvm::Constant *, llvm::GlobalVariable *> ConstantStringMap;
@@ -1241,6 +1244,9 @@ public:
/// Emit the annotation line number.
llvm::Constant *EmitAnnotationLineNo(SourceLocation L);
+ /// Emit additional args of the annotation.
+ llvm::Constant *EmitAnnotationArgs(const AnnotateAttr *Attr);
+
/// Generate the llvm::ConstantStruct which contains the annotation
/// information for a given GlobalValue. The annotation struct is
/// {i8 *, i8 *, i8 *, i32}. The first field is a constant expression, the