[PATCH] D99967: [Flang] Changes to mangling code

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 14 01:06:56 PDT 2021


kiranchandramohan added a comment.



>>> Though the description mentions that the functions are all tested - yet it looks like this patch adds a new function/overload without any callers, so how is it tested?
>>
>> Apologies for the misunderstanding here. What i meant is that the function that is ultimately called (fir::NameUniquer::doType) is already tested and this is a wrapper around that function. I will check today if I can add a unit  
>>  test for this function (assuming that is the recommendation here).
>
> Hmm - well, then there's the question of: What's the purpose of the new function? We don't usually add new code without usage (& then test the new code via that usage). But there are some times when it's suitable to implement new code with nothing but a unit test for coverage - usually only if that code is intended for API usage by clients outside the LLVM project.
>
> What's the purpose/intended usage of this new code?

Names have to be unique at the FIR (MLIR IR for Flang) layer. So the usage of name mangling is when we lower from the parse-tree of Flang to FIR. The bridge code which does this lowering has not yet landed in llvm-project/flang. The approach for upstreaming this portion is to bring in all the support functions and classes and then introduce the bridge code and show the lowering and testing for each Fortran construct. (Note that at the FIR layer and lowering to LLVM IR the agreed approach is to upstream pass by pass).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99967/new/

https://reviews.llvm.org/D99967



More information about the llvm-commits mailing list