- if (Kind == Attribute::Alignment)
- Attrs.push_back(std::make_pair(Index, Attribute::
- getWithAlignment(C, B.getAlignment())));
- else if (Kind == Attribute::StackAlignment)
- Attrs.push_back(std::make_pair(Index, Attribute::
- getWithStackAlignment(C, B.getStackAlignment())));
- else if (Kind == Attribute::Dereferenceable)
- Attrs.push_back(std::make_pair(Index,
- Attribute::getWithDereferenceableBytes(C,
- B.getDereferenceableBytes())));
- else if (Kind == Attribute::DereferenceableOrNull)
- Attrs.push_back(
- std::make_pair(Index, Attribute::getWithDereferenceableOrNullBytes(
- C, B.getDereferenceableOrNullBytes())));
- else
- Attrs.push_back(std::make_pair(Index, Attribute::get(C, Kind)));
+ Attribute Attr;
+ switch (Kind) {
+ case Attribute::Alignment:
+ Attr = Attribute::getWithAlignment(C, B.getAlignment());
+ break;
+ case Attribute::StackAlignment:
+ Attr = Attribute::getWithStackAlignment(C, B.getStackAlignment());
+ break;
+ case Attribute::Dereferenceable:
+ Attr = Attribute::getWithDereferenceableBytes(
+ C, B.getDereferenceableBytes());
+ break;
+ case Attribute::DereferenceableOrNull:
+ Attr = Attribute::getWithDereferenceableOrNullBytes(
+ C, B.getDereferenceableOrNullBytes());
+ break;
+ default:
+ Attr = Attribute::get(C, Kind);
+ }
+ Attrs.push_back(std::make_pair(Index, Attr));