Skip to content

Commit

Permalink
[CIR][NFC] Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lanza committed Jan 29, 2024
1 parent a565498 commit b6e2936
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
17 changes: 8 additions & 9 deletions clang/lib/CIR/CodeGen/CIRGenBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#define LLVM_CLANG_LIB_CIR_CIRGENBUILDER_H

#include "Address.h"
#include "CIRGenRecordLayout.h"
#include "CIRDataLayout.h"
#include "CIRGenRecordLayout.h"
#include "CIRGenTypeCache.h"
#include "UnimplementedFeatureGuarding.h"

Expand Down Expand Up @@ -465,12 +465,11 @@ class CIRGenBuilderTy : public CIRBaseBuilderTy {
mlir::cir::ArrayType getArrayType(mlir::Type eltType, unsigned size) {
return mlir::cir::ArrayType::get(getContext(), eltType, size);
}

bool isSized(mlir::Type ty) {
if (ty.isIntOrFloat() ||
ty.isa<mlir::cir::PointerType, mlir::cir::StructType,
mlir::cir::ArrayType, mlir::cir::BoolType,
mlir::cir::IntType>())
mlir::cir::ArrayType, mlir::cir::BoolType, mlir::cir::IntType>())
return true;
assert(0 && "Unimplemented size for type");
return false;
Expand Down Expand Up @@ -668,18 +667,18 @@ class CIRGenBuilderTy : public CIRBaseBuilderTy {
bool useVolatile) {
auto offset = useVolatile ? info.VolatileOffset : info.Offset;
return create<mlir::cir::GetBitfieldOp>(loc, resultType, addr, storageType,
info.Name, info.Size,
offset, info.IsSigned);
info.Name, info.Size, offset,
info.IsSigned);
}

mlir::Value createSetBitfield(mlir::Location loc, mlir::Type resultType,
mlir::Value dstAddr, mlir::Type storageType,
mlir::Value src, const CIRGenBitFieldInfo &info,
bool useVolatile) {
auto offset = useVolatile ? info.VolatileOffset : info.Offset;
return create<mlir::cir::SetBitfieldOp>(
loc, resultType, dstAddr, storageType, src, info.Name,
info.Size, offset, info.IsSigned);
return create<mlir::cir::SetBitfieldOp>(loc, resultType, dstAddr,
storageType, src, info.Name,
info.Size, offset, info.IsSigned);
}

/// Create a pointer to a record member.
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
mlir::Value buildLoadOfLValue(const Expr *E) {
LValue LV = CGF.buildLValue(E);
// FIXME: add some akin to EmitLValueAlignmentAssumption(E, V);
return CGF.buildLoadOfLValue(LV, E->getExprLoc()).getScalarVal();
return CGF.buildLoadOfLValue(LV, E->getExprLoc()).getScalarVal();
}

mlir::Value buildLoadOfLValue(LValue LV, SourceLocation Loc) {
Expand Down Expand Up @@ -1054,7 +1054,7 @@ static mlir::Value buildPointerArithmetic(CIRGenFunction &CGF,
std::swap(pointerOperand, indexOperand);
}

bool isSigned = indexOperand->getType()->isSignedIntegerOrEnumerationType();
bool isSigned = indexOperand->getType()->isSignedIntegerOrEnumerationType();

// Some versions of glibc and gcc use idioms (particularly in their malloc
// routines) that add a pointer-sized integer (known to be a pointer value)
Expand Down
7 changes: 4 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1528,8 +1528,8 @@ void CIRGenItaniumRTTIBuilder::BuildVMIClassTypeInfo(mlir::Location loc,

for (const auto &Base : RD->bases()) {
// The __base_type member points to the RTTI for the base type.
Fields.push_back(
CIRGenItaniumRTTIBuilder(CXXABI, CGM).BuildTypeInfo(loc, Base.getType()));
Fields.push_back(CIRGenItaniumRTTIBuilder(CXXABI, CGM)
.BuildTypeInfo(loc, Base.getType()));

auto *BaseDecl =
cast<CXXRecordDecl>(Base.getType()->castAs<RecordType>()->getDecl());
Expand Down Expand Up @@ -1777,7 +1777,8 @@ mlir::Attribute CIRGenItaniumRTTIBuilder::BuildTypeInfo(
assert(!UnimplementedFeature::setDSOLocal());
CIRGenModule::setInitializer(GV, init);

return builder.getGlobalViewAttr(builder.getUInt8PtrTy(), GV);;
return builder.getGlobalViewAttr(builder.getUInt8PtrTy(), GV);
;
}

mlir::Attribute CIRGenItaniumCXXABI::getAddrOfRTTIDescriptor(mlir::Location loc,
Expand Down

0 comments on commit b6e2936

Please sign in to comment.