Skip to content

Commit 1284100

Browse files
committed
remove unused function checking for bitfields
1 parent bc4e14b commit 1284100

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ class SemaHLSL : public SemaBase {
215215
bool diagnosePositionType(QualType T, const ParsedAttr &AL);
216216

217217
bool CanPerformScalarCast(QualType SrcTy, QualType DestTy);
218-
bool ContainsBitField(QualType BaseTy);
219218
bool CanPerformElementwiseCast(Expr *Src, QualType DestType);
220219
bool CanPerformAggregateSplatCast(Expr *Src, QualType DestType);
221220
ExprResult ActOnOutParamExpr(ParmVarDecl *Param, Expr *Arg);

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,40 +3544,6 @@ bool SemaHLSL::CanPerformScalarCast(QualType SrcTy, QualType DestTy) {
35443544
llvm_unreachable("Unhandled scalar cast");
35453545
}
35463546

3547-
// Detect if a type contains a bitfield. Will be removed when
3548-
// bitfield support is added to HLSLElementwiseCast and HLSLAggregateSplatCast
3549-
bool SemaHLSL::ContainsBitField(QualType BaseTy) {
3550-
llvm::SmallVector<QualType, 16> WorkList;
3551-
WorkList.push_back(BaseTy);
3552-
while (!WorkList.empty()) {
3553-
QualType T = WorkList.pop_back_val();
3554-
T = T.getCanonicalType().getUnqualifiedType();
3555-
// only check aggregate types
3556-
if (const auto *AT = dyn_cast<ConstantArrayType>(T)) {
3557-
WorkList.push_back(AT->getElementType());
3558-
continue;
3559-
}
3560-
if (const auto *RT = dyn_cast<RecordType>(T)) {
3561-
const RecordDecl *RD = RT->getOriginalDecl()->getDefinitionOrSelf();
3562-
if (RD->isUnion())
3563-
continue;
3564-
3565-
const CXXRecordDecl *CXXD = dyn_cast<CXXRecordDecl>(RD);
3566-
3567-
if (CXXD && CXXD->isStandardLayout())
3568-
RD = CXXD->getStandardLayoutBaseWithFields();
3569-
3570-
for (const auto *FD : RD->fields()) {
3571-
if (FD->isBitField())
3572-
return true;
3573-
WorkList.push_back(FD->getType());
3574-
}
3575-
continue;
3576-
}
3577-
}
3578-
return false;
3579-
}
3580-
35813547
// Can perform an HLSL Aggregate splat cast if the Dest is an aggregate and the
35823548
// Src is a scalar or a vector of length 1
35833549
// Or if Dest is a vector and Src is a vector of length 1

0 commit comments

Comments
 (0)