[PATCH] D153907: [AIX] [TOC] Add -mtocdata/-mno-tocdata options on AIX

Zaara Syeda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 06:35:19 PDT 2023


syzaara added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:2955
+  MarshallingInfoFlag<CodeGenOpts<"AllTocData">>;
+def mno_tocdata_EQ : CommaJoined<["-"], "mno-tocdata=">,
+  Flags<[CC1Option,TargetSpecific]>,
----------------
MaskRay wrote:
> If `-mtocdata=` is opt-in, the convention is to make just `-mtocdata=` CC1Option, but clear the flag for `-mno-tocdata=`.
Our situation with these options is a bit more complicated because -mno-tocdata= is not just removing the entries that were specified by -mtocdata=
For example if we have:

```
-mtocdata=X -mno-tocdata=X -mtocdata=Y,Z,S
```
Then we could potentially just forward to CC1: 

```
-mtocdata=Y,Z,S
```
Rather than what we currently forward:
```
-mno-tocdata -mtocdata=Y,Z,S
```
However, if we have
```
-mtocdata -mno-tocdata=Y,Z,S
```
This means all suitable variables by default will become toc-data aside from the exceptions in -mno-tocdata=Y,Z,S
and we would need to forward both these options.

So the way we handle it is by passing to CC1 either 
```
-mtocdata -mno-tocdata=
``` 
or 

```
-mno-tocdata -mtocdata=
```
which is the current default setting along with the exceptions that need to be applied to that default setting.


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

https://reviews.llvm.org/D153907



More information about the llvm-commits mailing list