================
@@ -3514,6 +3520,31 @@ void CodeGenModule::AddDependentLib(StringRef Lib) {
LinkerOptionsMetadata.push_back(llvm::MDNode::get(C, MDOpts));
}
+/// Process copyright pragma and create LLVM metadata.
+/// #pragma comment(copyright, "string") embed copyright
+/// information into the object file's loader section.
+///
+/// Example: #pragma comment(copyright, "Copyright IBM Corp. 2024")
+///
+/// This should only be called once per translation unit.
+void CodeGenModule::ProcessPragmaComment(PragmaMSCommentKind Kind,
+ StringRef Comment) {
+ // Ensure we are only processing Copyright Pragmas
+ assert(Kind == PCK_Copyright &&
+ "Unexpected pragma comment kind, ProcessPragmaComment should only be "
+ "called for PCK_Copyright");
+
+ // Only one copyright pragma allowed per translation unit
+ if (LoadTimeComment) {
----------------
tonykuttai wrote:
My bad. Added the assert. Got confused with the code flow.
https://github.com/llvm/llvm-project/pull/178184
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits