Skip to content

Commit 06ce71f

Browse files
committed
- Remove all the Expr Constant AST visitors.
- Remove CIR emitter stubs - Run clan format
1 parent 929f118 commit 06ce71f

File tree

7 files changed

+7
-30
lines changed

7 files changed

+7
-30
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class Expr : public ValueStmt {
309309
MLV_DuplicateVectorComponents,
310310
MLV_DuplicateMatrixComponents,
311311
MLV_InvalidExpression,
312-
MLV_LValueCast, // Specialized form of MLV_InvalidExpression.
312+
MLV_LValueCast, // Specialized form of MLV_InvalidExpression.
313313
MLV_IncompleteType,
314314
MLV_ConstQualified,
315315
MLV_ConstQualifiedField,
@@ -342,17 +342,17 @@ class Expr : public ValueStmt {
342342
enum Kinds {
343343
CL_LValue,
344344
CL_XValue,
345-
CL_Function, // Functions cannot be lvalues in C.
346-
CL_Void, // Void cannot be an lvalue in C.
345+
CL_Function, // Functions cannot be lvalues in C.
346+
CL_Void, // Void cannot be an lvalue in C.
347347
CL_AddressableVoid, // Void expression whose address can be taken in C.
348348
CL_DuplicateVectorComponents, // A vector shuffle with dupes.
349349
CL_DuplicateMatrixComponents, // A matrix shuffle with dupes.
350350
CL_MemberFunction, // An expression referring to a member function
351351
CL_SubObjCPropertySetting,
352-
CL_ClassTemporary, // A temporary of class type, or subobject thereof.
353-
CL_ArrayTemporary, // A temporary of array type.
352+
CL_ClassTemporary, // A temporary of class type, or subobject thereof.
353+
CL_ArrayTemporary, // A temporary of array type.
354354
CL_ObjCMessageRValue, // ObjC message is an rvalue
355-
CL_PRValue // A prvalue for any other reason, of any other type
355+
CL_PRValue // A prvalue for any other reason, of any other type
356356
};
357357
/// The results of modification testing.
358358
enum ModifiableType {
@@ -6524,11 +6524,6 @@ template <class Derived> class ElementAccessExprBase : public Expr {
65246524
}
65256525
SourceLocation getEndLoc() const LLVM_READONLY { return AccessorLoc; }
65266526

6527-
/*static bool classof(const Stmt *T) {
6528-
return T->getStmtClass() == ExtVectorElementExprClass ||
6529-
T->getStmtClass() == MatrixElementExprClass;
6530-
}*/
6531-
65326527
child_range children() { return child_range(&Base, &Base + 1); }
65336528
const_child_range children() const {
65346529
return const_child_range(&Base, &Base + 1);

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,12 +4092,6 @@ bool Compiler<Emitter>::VisitShuffleVectorExpr(const ShuffleVectorExpr *E) {
40924092
return true;
40934093
}
40944094

4095-
template <class Emitter>
4096-
bool Compiler<Emitter>::VisitMatrixElementExpr(const MatrixElementExpr *Node) {
4097-
// TODO
4098-
return false;
4099-
}
4100-
41014095
template <class Emitter>
41024096
bool Compiler<Emitter>::VisitExtVectorElementExpr(
41034097
const ExtVectorElementExpr *E) {

clang/lib/AST/ByteCode/Compiler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ class Compiler : public ConstStmtVisitor<Compiler<Emitter>, bool>,
223223
bool VisitConvertVectorExpr(const ConvertVectorExpr *E);
224224
bool VisitShuffleVectorExpr(const ShuffleVectorExpr *E);
225225
bool VisitExtVectorElementExpr(const ExtVectorElementExpr *E);
226-
bool VisitMatrixElementExpr(const MatrixElementExpr *E);
227226
bool VisitObjCBoxedExpr(const ObjCBoxedExpr *E);
228227
bool VisitCXXStdInitializerListExpr(const CXXStdInitializerListExpr *E);
229228
bool VisitStmtExpr(const StmtExpr *E);

clang/lib/AST/ExprConstant.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8993,8 +8993,6 @@ class ExprEvaluatorBase
89938993
DerivedSuccess(Result, E);
89948994
}
89958995

8996-
bool VisitMatrixElementExpr(const MatrixElementExpr *E) { return false; }
8997-
89988996
bool VisitExtVectorElementExpr(const ExtVectorElementExpr *E) {
89998997
APValue Val;
90008998
if (!Evaluate(Val, Info, E->getBase()))
@@ -9337,7 +9335,6 @@ class LValueExprEvaluator
93379335
bool VisitCXXUuidofExpr(const CXXUuidofExpr *E);
93389336
bool VisitArraySubscriptExpr(const ArraySubscriptExpr *E);
93399337
bool VisitExtVectorElementExpr(const ExtVectorElementExpr *E);
9340-
bool VisitMatrixElementExpr(const MatrixElementExpr *E);
93419338
bool VisitUnaryDeref(const UnaryOperator *E);
93429339
bool VisitUnaryReal(const UnaryOperator *E);
93439340
bool VisitUnaryImag(const UnaryOperator *E);
@@ -9699,10 +9696,6 @@ bool LValueExprEvaluator::VisitMemberExpr(const MemberExpr *E) {
96999696
return LValueExprEvaluatorBaseTy::VisitMemberExpr(E);
97009697
}
97019698

9702-
bool LValueExprEvaluator::VisitMatrixElementExpr(const MatrixElementExpr *E) {
9703-
return false;
9704-
}
9705-
97069699
bool LValueExprEvaluator::VisitExtVectorElementExpr(
97079700
const ExtVectorElementExpr *E) {
97089701
bool Success = true;

clang/lib/CIR/CodeGen/CIRGenFunction.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,6 @@ LValue CIRGenFunction::emitLValue(const Expr *e) {
946946
return emitArraySubscriptExpr(cast<ArraySubscriptExpr>(e));
947947
case Expr::ExtVectorElementExprClass:
948948
return emitExtVectorElementExpr(cast<ExtVectorElementExpr>(e));
949-
case Expr::MatrixElementExprClass:
950-
return emitMatrixElementExpr(cast<MatrixElementExpr>(e));
951949
case Expr::UnaryOperatorClass:
952950
return emitUnaryOpLValue(cast<UnaryOperator>(e));
953951
case Expr::StringLiteralClass:

clang/lib/CIR/CodeGen/CIRGenFunction.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,8 +1333,6 @@ class CIRGenFunction : public CIRGenTypeCache {
13331333

13341334
LValue emitExtVectorElementExpr(const ExtVectorElementExpr *e);
13351335

1336-
LValue emitMatrixElementExpr(cost MatrixElementExpr *e);
1337-
13381336
Address emitArrayToPointerDecay(const Expr *e,
13391337
LValueBaseInfo *baseInfo = nullptr);
13401338

clang/test/AST/HLSL/pch_with_matrix_element_accessor.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ float4 getDiag() {
2323
// CHECK-NEXT: DeclRefExpr {{.*}} 'float4':'vector<float, 4>' lvalue ParmVar {{.*}} 'V' 'float4':'vector<float, 4>'
2424
void setRowZero(float4 V) {
2525
gM._m00_m01_m02_m03 = V;
26-
}
26+
}

0 commit comments

Comments
 (0)