MaskRay added a comment.

In D73307#1932131 <>, @rnk wrote:

> At a higher level, should this just be an IR pass that clang adds into the 
> pipeline when the flag is set? It should be safe to rename internal functions 
> and give private functions internal linkage. It would be less invasive to 
> clang and have better separation of concerns. As written, this is based on 
> the source filename on the module, which is accessible from IR. The only 
> reason I can think of against this is that the debug info might refer to the 
> function linkage name, but maybe that is calculated later during codegen.

I second this suggestion. `clang/lib/CodeGen/BackendUtil.cpp` 
`EmitAssemblyHelper::EmitAssemblyWithNewPassManager` ModulePassManager may be a 
more appropriate place for this feature. There are examples from both sides:

- clang frontend: `#pragma redefine_extname`
- middle end IR->IR: the old pass manager has a feature -frewrite-map-file, 
which does a similar thing but is implemented as an IR transformation.


cfe-commits mailing list

Reply via email to