================
@@ -326,6 +326,19 @@ void ExecutionEnvironment::Configure(int ac, const char
*av[],
}
}
+ // FLANG_ERROR_BACKTRACE overrides the -fbacktrace default. Only the first
+ // character is significant, matching gfortran: 1/Y/y enables, 0/N/n
disables.
+ // Any other value is ignored. -fno-backtrace supplies "0" when the variable
+ // is not already set.
+ backtrace = true;
+ if (auto *x{std::getenv("FLANG_ERROR_BACKTRACE")}) {
+ if (*x == '1' || *x == 'Y' || *x == 'y') {
+ backtrace = true;
+ } else if (*x == '0' || *x == 'N' || *x == 'n') {
+ backtrace = false;
+ }
+ }
----------------
tarunprabhu wrote:
Thanks for the clarification. If there are other runtimes within LLVM that use
this convention, we should prefer it. While we aim for compatibility with
gfortran to an extent, compatibility within the LLVM ecosystem should come
first.
That said, I am not sure how these are handled in LLVM's runtimes either. It
might be worth taking a look to make sure we stay consistent.
https://github.com/llvm/llvm-project/pull/241967
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits