[flang] start splitting up afforestation so it isn't monolithic

Original-commit: flang-compiler/f18@842a42d954
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false
This commit is contained in:
Eric Schweitz 2019-04-23 14:40:04 -07:00
parent 170198381a
commit 8242853380
4 changed files with 782 additions and 710 deletions

View file

@ -17,3 +17,4 @@ add_subdirectory(evaluate)
add_subdirectory(FIR)
add_subdirectory(parser)
add_subdirectory(semantics)
add_subdirectory(bridge)

File diff suppressed because it is too large Load diff

View file

@ -56,7 +56,7 @@ struct FIRBuilder {
BasicBlock *GetInsertionPoint() const { return cursorBlock_; }
// create the various statements
QualifiedStmt<Addressable_impl> CreateAddr(const Expression &e) {
QualifiedStmt<Addressable_impl> CreateAddr(const Expression *e) {
return QualifiedInsert<Addressable_impl>(LocateExprStmt::Create(e));
}
QualifiedStmt<Addressable_impl> CreateAddr(Expression &&e) {
@ -80,16 +80,16 @@ struct FIRBuilder {
Statement *CreateDealloc(QualifiedStmt<AllocateInsn> alloc) {
return Insert(DeallocateInsn::Create(alloc));
}
Statement *CreateExpr(const Expression &e) {
Statement *CreateExpr(const Expression *e) {
return Insert(ApplyExprStmt::Create(e));
}
Statement *CreateExpr(Expression &&e) {
return Insert(ApplyExprStmt::Create(std::move(e)));
}
ApplyExprStmt *MakeAsExpr(const Expression &e) {
ApplyExprStmt *MakeAsExpr(const Expression *e) {
return GetApplyExpr(CreateExpr(e));
}
QualifiedStmt<ApplyExprStmt> QualifiedCreateExpr(const Expression &e) {
QualifiedStmt<ApplyExprStmt> QualifiedCreateExpr(const Expression *e) {
return QualifiedInsert<ApplyExprStmt>(ApplyExprStmt::Create(e));
}
QualifiedStmt<ApplyExprStmt> QualifiedCreateExpr(Expression &&e) {

View file

@ -230,7 +230,7 @@ public:
struct Default {}; // RANK DEFAULT
struct AssumedSize {}; // RANK(*)
struct Exactly { // RANK(n)
const Expression *v;
Expression *v;
};
using ValueType = std::variant<Exactly, AssumedSize, Default>;
using ValueSuccPairType = std::pair<ValueType, BasicBlock *>;
@ -295,7 +295,7 @@ protected:
// Compute the value of an expression
class ApplyExprStmt : public ActionStmt_impl {
public:
static ApplyExprStmt Create(const Expression &e) { return ApplyExprStmt{e}; }
static ApplyExprStmt Create(const Expression *e) { return ApplyExprStmt{*e}; }
static ApplyExprStmt Create(Expression &&e) {
return ApplyExprStmt{std::move(e)};
}
@ -323,8 +323,8 @@ protected:
// Compute the location of an expression
class LocateExprStmt : public Addressable_impl {
public:
static LocateExprStmt Create(const Expression &e) {
return LocateExprStmt(e);
static LocateExprStmt Create(const Expression *e) {
return LocateExprStmt(*e);
}
static LocateExprStmt Create(Expression &&e) { return LocateExprStmt(e); }