================
@@ -2079,6 +2084,13 @@ class CodeGenModule : public CodeGenTypeCache {
   /// false, the definition can be emitted lazily if it's used.
   bool MustBeEmitted(const ValueDecl *D);
 
+  /// Emit load-time comment metadata for #pragma comment(copyright, ...).
+  /// This adds the copyright string to the module's named metadata, which will
+  /// be processed by the IR passes to embed it in the .text section
+  /// of the generated object file, where it will be loaded into memory at
+  /// program runtime.
+  void EmitLoadTimeComment();
----------------
hubert-reinterpretcast wrote:

- It is very odd to place this between `MustBeEmitted` and 
`MayBeEmittedEagerly`. Please add to the end of the class.
- To match the naming of this function (and the metadata, etc.), the comment 
should be less `#pragma comment(copyright, ...)`-centric.
- In the front-end code, let's just say what the front-end does and leave the 
responsibility of the other components to said components. In particular, that 
leaves us with less to fix if things change.
```suggestion
  /// Emit the load-time comment metadata (e.g., from
  /// #pragma comment(copyright, ...)) for the translation unit.
  void EmitLoadTimeComment();
```

https://github.com/llvm/llvm-project/pull/178184
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to