DanielCChen wrote:

> Approach look OK to me.
> 
> Could you add test(s) along the lines of 
> [aix-rlib.c](https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/aix-rtlib.c).
>  If we make further changes, knowing what is expected on AIX/PPCLunux would 
> be very helpful.
> 
> A review from someone involved with the Clang driver side would be helpful. 
> @MaskRay ?

Thanks for the review again.
I am planning to add tests once the principle of the design is accepted. 

Further improvement:
1. The `addFortranRuntimeLibs` should contain common code only (something 
similar to what AIX.cpp is doing: just get the path) and leave platform 
specific stuff to the overriding functions for each platform (if they have 
unique stuff). The overriding functions can call the base one to get the common 
code.
2. `getCompilerRT` may be split into two: one for `lib/${os_dirname}` and one 
for `lib/${triple}`. For the platform like AIX that it only needs `os_dirname`, 
it can just use the base one without needing to override it. For the platform 
like LoP that honers the `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` option, it can 
call both without needing to override it (similar to PPCLinux.cpp)
3. Note that I only made AIX and LoP re-using the `compilerRT` code as I don't 
have means to test other platforms. But in theory, this code can go into the 
base function for other platforms.

https://github.com/llvm/llvm-project/pull/131041
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to