================
@@ -423,6 +423,29 @@ class Compiler : public
ConstStmtVisitor<Compiler<Emitter>, bool>,
const QualType DerivedType);
bool emitLambdaStaticInvokerBody(const CXXMethodDecl *MD);
bool emitBuiltinBitCast(const CastExpr *E);
+
+ bool emitHLSLAggregateSplat(PrimType SrcT, unsigned SrcOffset,
+ QualType DestType, const Expr *E);
+
+ /// A scalar element extracted during HLSL aggregate flattening.
+ struct HLSLFlatElement {
+ unsigned LocalOffset;
+ PrimType Type;
+ };
+ unsigned countHLSLFlatElements(QualType Ty);
+ bool emitHLSLFlattenAggregate(QualType SrcType, unsigned SrcPtrOffset,
+ SmallVectorImpl<HLSLFlatElement> &Elements,
+ unsigned MaxElements, const Expr *E);
+ bool emitHLSLConstructAggregate(QualType DestType,
+ ArrayRef<HLSLFlatElement> Elements,
+ unsigned &ElemIdx, const Expr *E);
----------------
inbelic wrote:
nit: I think the use of a worklist over a recursive approach might avoid the
need for this `unsigned &ElemIdx`, which I am not a big fan of. But I won't
block on it.
https://github.com/llvm/llvm-project/pull/189126
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits