Replicates all needed state between expanded functions
commit5e6f06cf59Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Thu May 11 15:42:11 2017 -0400 Fixed issue with aliasing local variables ISPC++ now produces valid code, or an appropriate error message, for all of my test cases. commitbfe723e1b7Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Thu May 11 03:09:38 2017 -0400 Actually copy the AST. Type replacement works except for function parameters. commitf65b3e6300Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Thu May 11 01:19:50 2017 -0400 [WIP] Remove cases for ForeachStmt and SymbolExpr commit2e28640860Merge:6a91c5dd020107Author: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Wed May 10 23:13:40 2017 -0400 Merge branch 'master' into copy_ast commit6a91c5d5acAuthor: Aaron Gutierrez <gutierrez.aaron.m@gmail.com> Date: Wed May 10 11:11:39 2017 -0400 Attempt to replicate AST when expanding polytypes
This commit is contained in:
47
expr.h
47
expr.h
@@ -96,6 +96,7 @@ public:
|
||||
encountered, NULL should be returned. */
|
||||
virtual Expr *TypeCheck() = 0;
|
||||
|
||||
Expr *Copy();
|
||||
|
||||
/** This method replaces a polymorphic type with a specific atomic type */
|
||||
Expr *ReplacePolyType(const PolyType *polyType, const Type *replacement);
|
||||
@@ -385,6 +386,51 @@ protected:
|
||||
mutable const Type *type, *lvalueType;
|
||||
};
|
||||
|
||||
class StructMemberExpr : public MemberExpr
|
||||
{
|
||||
public:
|
||||
StructMemberExpr(Expr *e, const char *id, SourcePos p,
|
||||
SourcePos idpos, bool derefLValue);
|
||||
|
||||
static inline bool classof(StructMemberExpr const*) { return true; }
|
||||
static inline bool classof(ASTNode const* N) {
|
||||
return N->getValueID() == StructMemberExprID;
|
||||
}
|
||||
|
||||
const Type *GetType() const;
|
||||
const Type *GetLValueType() const;
|
||||
int getElementNumber() const;
|
||||
const Type *getElementType() const;
|
||||
|
||||
private:
|
||||
const StructType *getStructType() const;
|
||||
};
|
||||
|
||||
|
||||
class VectorMemberExpr : public MemberExpr
|
||||
{
|
||||
public:
|
||||
VectorMemberExpr(Expr *e, const char *id, SourcePos p,
|
||||
SourcePos idpos, bool derefLValue);
|
||||
|
||||
static inline bool classof(VectorMemberExpr const*) { return true; }
|
||||
static inline bool classof(ASTNode const* N) {
|
||||
return N->getValueID() == VectorMemberExprID;
|
||||
}
|
||||
|
||||
llvm::Value *GetValue(FunctionEmitContext* ctx) const;
|
||||
llvm::Value *GetLValue(FunctionEmitContext* ctx) const;
|
||||
const Type *GetType() const;
|
||||
const Type *GetLValueType() const;
|
||||
|
||||
int getElementNumber() const;
|
||||
const Type *getElementType() const;
|
||||
|
||||
private:
|
||||
const VectorType *exprVectorType;
|
||||
const VectorType *memberType;
|
||||
};
|
||||
|
||||
|
||||
/** @brief Expression representing a compile-time constant value.
|
||||
|
||||
@@ -715,6 +761,7 @@ public:
|
||||
Symbol *GetBaseSymbol() const;
|
||||
Expr *TypeCheck();
|
||||
Expr *Optimize();
|
||||
Expr *ReplacePolyType(const PolyType *from, const Type *to);
|
||||
void Print() const;
|
||||
int EstimateCost() const;
|
||||
llvm::Constant *GetConstant(const Type *type) const;
|
||||
|
||||
Reference in New Issue
Block a user