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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to