Skip to content

Commit

Permalink
clang-format applied
Browse files Browse the repository at this point in the history
  • Loading branch information
gitoleg committed Jan 22, 2024
1 parent deed5be commit fca1a43
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/CIR/Dialect/IR/CIRTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class StructType
uint64_t getPreferredAlignment(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const;

bool isLayoutIdentical(const StructType& other);
bool isLayoutIdentical(const StructType &other);

// Utilities for lazily computing and cacheing data layout info.
private:
Expand Down
8 changes: 4 additions & 4 deletions clang/lib/CIR/CodeGen/CIRGenBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,10 @@ class CIRGenBuilderTy : public CIRBaseBuilderTy {
return type;
}

mlir::cir::StructType getCompleteStructType(mlir::ArrayAttr fields,
bool packed = false,
llvm::StringRef name = "",
const clang::RecordDecl *ast = nullptr) {
mlir::cir::StructType
getCompleteStructType(mlir::ArrayAttr fields, bool packed = false,
llvm::StringRef name = "",
const clang::RecordDecl *ast = nullptr) {
llvm::SmallVector<mlir::Type, 8> members;
for (auto &attr : fields) {
const auto typedAttr = attr.dyn_cast<mlir::TypedAttr>();
Expand Down
17 changes: 8 additions & 9 deletions clang/lib/CIR/CodeGen/CIRGenExprConst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct ConstantAggregateBuilderUtils {
mlir::TypedAttr getPadding(CharUnits size) const {
auto eltTy = CGM.UCharTy;
auto arSize = size.getQuantity();
auto& bld = CGM.getBuilder();
auto &bld = CGM.getBuilder();
SmallVector<mlir::Attribute, 4> elts(arSize, bld.getZeroAttr(eltTy));
return bld.getConstArray(mlir::ArrayAttr::get(bld.getContext(), elts),
bld.getArrayType(eltTy, arSize));
Expand Down Expand Up @@ -227,8 +227,8 @@ bool ConstantAggregateBuilder::addBits(llvm::APInt Bits, uint64_t OffsetInBits,

if (WantedBits == CharWidth) {
// Got a full byte: just add it directly.
add(mlir::cir::IntAttr::get(charTy, BitsThisChar),
OffsetInChars, AllowOverwrite);
add(mlir::cir::IntAttr::get(charTy, BitsThisChar), OffsetInChars,
AllowOverwrite);
} else {
// Partial byte: update the existing integer if there is one. If we
// can't split out a 1-CharUnit range to update, then we can't add
Expand All @@ -253,8 +253,8 @@ bool ConstantAggregateBuilder::addBits(llvm::APInt Bits, uint64_t OffsetInBits,
BitsThisChar &= UpdateMask;
bool isNull = false;
if (*FirstElemToUpdate < Elems.size()) {
auto firstEltToUpdate =
dyn_cast<mlir::cir::IntAttr>(Elems[*FirstElemToUpdate]);
auto firstEltToUpdate =
dyn_cast<mlir::cir::IntAttr>(Elems[*FirstElemToUpdate]);
isNull = firstEltToUpdate && firstEltToUpdate.isNullValue();
}

Expand All @@ -277,7 +277,7 @@ bool ConstantAggregateBuilder::addBits(llvm::APInt Bits, uint64_t OffsetInBits,
"unexpectedly overwriting bitfield");
BitsThisChar |= (CI.getValue() & ~UpdateMask);
Elems[*FirstElemToUpdate] =
CGM.getBuilder().getAttr<mlir::cir::IntAttr>(charTy, BitsThisChar);
CGM.getBuilder().getAttr<mlir::cir::IntAttr>(charTy, BitsThisChar);
}
}

Expand Down Expand Up @@ -422,7 +422,7 @@ mlir::Attribute ConstantAggregateBuilder::buildFrom(
if (desired.isLayoutIdentical(strType))
strType = desired;

return builder.getConstStructOrZeroAttr(arrAttr, Packed, strType);
return builder.getConstStructOrZeroAttr(arrAttr, Packed, strType);
}

void ConstantAggregateBuilder::condense(CharUnits Offset,
Expand Down Expand Up @@ -521,8 +521,7 @@ bool ConstStructBuilder::AppendBitField(const FieldDecl *Field,
uint64_t FieldOffset,
mlir::cir::IntAttr CI,
bool AllowOverwrite) {
const auto &RL =
CGM.getTypes().getCIRGenRecordLayout(Field->getParent());
const auto &RL = CGM.getTypes().getCIRGenRecordLayout(Field->getParent());
const auto &Info = RL.getBitFieldInfo(Field);
llvm::APInt FieldValue = CI.getValue();

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CIR/Dialect/IR/CIRTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void StructType::complete(ArrayRef<Type> members, bool packed,
llvm_unreachable("failed to complete struct");
}

bool StructType::isLayoutIdentical(const StructType& other) {
bool StructType::isLayoutIdentical(const StructType &other) {
if (getImpl() == other.getImpl())
return true;

Expand Down

0 comments on commit fca1a43

Please sign in to comment.