[PATCH] D85802: [clang] Add -fc++-abi= flag for specifying which C++ ABI to use

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 21 15:06:36 PDT 2021


leonardchan added a comment.

I got LGTM for this before, but I'll leave it open for a few days to address any new comments folks might have.



================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:3523
+    else
+      Opts.CXXABI = TargetCXXABI::getKind(CXXABI);
+  }
----------------
jansvoboda11 wrote:
> The original command-line arguments must be generated from this in `GenerateLangArgs`. See https://clang.llvm.org/docs/InternalsManual.html#compiler-invocation for more details.
Could you clarify more on this? I'm guessing you mean I should use one of the Marshalling Options to set `Opts.CXXABI`, but none of them seem very fitting here. `MarshallingInfoEnum` looks to be the most appropriate, but I think using it will require manually copying all the string and enum values from `TargetCXXABI.def`. If possible, I'd like to avoid hardcoding the enums and strings in `TargetCXXABI.def` elsewhere so when another ABI gets added, we'd only need to change that .td file and not multiple other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85802



More information about the cfe-commits mailing list