diff options
author | Mark Danial <mark.danial@ibm.com> | 2023-02-21 16:33:06 -0500 |
---|---|---|
committer | Mark Danial <mark.danial@ibm.com> | 2023-02-21 16:34:26 -0500 |
commit | 1360bfb05b3153ad93a7e866f0ac6860d94337a2 (patch) | |
tree | e8bc1d8ea321212ddbd797fc3872ed588513ea79 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | b7d86f3f1cfc8f7a0ac9e83d87767a4dac3832a0 (diff) | |
download | llvm-1360bfb05b3153ad93a7e866f0ac6860d94337a2.zip llvm-1360bfb05b3153ad93a7e866f0ac6860d94337a2.tar.gz llvm-1360bfb05b3153ad93a7e866f0ac6860d94337a2.tar.bz2 |
[Flang] Add user option -funderscoring/-fnounderscoring to control trailing underscore added to external names
This patch adds user option -funderscoring/-fnounderscoring to control the trailing underscore being appended to external names (e.g. procedure names, common block names). The option in gfortran is documented in https://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D140795
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 08cb69d..9bccb7e 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -171,6 +171,12 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, if (args.hasArg(clang::driver::options::OPT_pic_is_pie)) opts.IsPIE = 1; } + + // This option is compatible with -f[no-]underscoring in gfortran. + if (args.hasFlag(clang::driver::options::OPT_fno_underscoring, + clang::driver::options::OPT_funderscoring, false)) { + opts.Underscoring = 0; + } } /// Parses all target input arguments and populates the target |