[clang] Fix Wnested-anon-types in ABIArgInfo

D98794 added the DirectAttr/IndirectAttr struct fields to that union, but
declaring anonymous structs in an anonymous union triggers `-Wnested-anon-types`
warnings. We can't just give them a name as they are in an anonymous union, so
this just declares the type outside.

```
clang/include/clang/CodeGen/CGFunctionInfo.h:97:5: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
    struct {
    ^
clang/include/clang/CodeGen/CGFunctionInfo.h:101:5: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
    struct {
    ^
```

Reviewed By: chill

Differential Revision: https://reviews.llvm.org/D102903
This commit is contained in:
Raphael Isemann 2021-05-21 10:57:06 +02:00
parent b5b3843f8d
commit ebd25fde5e
1 changed files with 10 additions and 8 deletions

View File

@ -93,15 +93,17 @@ private:
llvm::Type *PaddingType; // canHavePaddingType()
llvm::Type *UnpaddedCoerceAndExpandType; // isCoerceAndExpand()
};
struct DirectAttrInfo {
unsigned Offset;
unsigned Align;
};
struct IndirectAttrInfo {
unsigned Align;
unsigned AddrSpace;
};
union {
struct {
unsigned Offset;
unsigned Align;
} DirectAttr; // isDirect() || isExtend()
struct {
unsigned Align;
unsigned AddrSpace;
} IndirectAttr; // isIndirect()
DirectAttrInfo DirectAttr; // isDirect() || isExtend()
IndirectAttrInfo IndirectAttr; // isIndirect()
unsigned AllocaFieldIndex; // isInAlloca()
};
Kind TheKind;