================
@@ -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) {
----------------
hubert-reinterpretcast wrote:
> The current behaviour is consistent with the Legacy XLC. XL also emitted a
> warning and continued with the compilation as shown below.
How is this responsive to @perry-ca's comment?
Your response explains the code at
https://github.com/llvm/llvm-project/blob/70ee8b22a5c715a3e477079dcc01c995dd273f62/clang/lib/Parse/ParsePragma.cpp#L3322-L3326
Since that code exists, why can't the assert requested by Sean be added?
https://github.com/llvm/llvm-project/pull/178184
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits