mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Fix typeo and refactor bb productions to make it possible for us to reuse any
forward reference blocks if they have been created (instead of creating a new block, replaceAllUsesOfWith, then nuking the placeholder). This is not yet implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -71,7 +71,7 @@ static struct PerModuleInfo {
|
|||||||
|
|
||||||
/// PlaceHolderInfo - When temporary placeholder objects are created, remember
|
/// PlaceHolderInfo - When temporary placeholder objects are created, remember
|
||||||
/// how they were referenced and one which line of the input they came from so
|
/// how they were referenced and one which line of the input they came from so
|
||||||
/// that we can resolve them alter and print error messages as appropriate.
|
/// that we can resolve them later and print error messages as appropriate.
|
||||||
std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
|
std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
|
||||||
|
|
||||||
// GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
|
// GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
|
||||||
@ -1639,16 +1639,6 @@ BasicBlock : InstructionList OptAssign BBTerminatorInst {
|
|||||||
$1->getInstList().push_back($3);
|
$1->getInstList().push_back($3);
|
||||||
InsertValue($1);
|
InsertValue($1);
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
|
||||||
| LABELSTR InstructionList OptAssign BBTerminatorInst {
|
|
||||||
setValueName($4, $3);
|
|
||||||
InsertValue($4);
|
|
||||||
|
|
||||||
$2->getInstList().push_back($4);
|
|
||||||
setValueName($2, $1);
|
|
||||||
|
|
||||||
InsertValue($2);
|
|
||||||
$$ = $2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
InstructionList : InstructionList Inst {
|
InstructionList : InstructionList Inst {
|
||||||
@ -1656,7 +1646,18 @@ InstructionList : InstructionList Inst {
|
|||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| /* empty */ {
|
| /* empty */ {
|
||||||
|
// FIXME: Should check to see if there is a forward ref'd basic block that
|
||||||
|
// we can use and reuse it as appropriate. It doesn't make sense just to
|
||||||
|
// make forward ref'd blocks then discard them.
|
||||||
$$ = CurBB = new BasicBlock("", CurFun.CurrentFunction);
|
$$ = CurBB = new BasicBlock("", CurFun.CurrentFunction);
|
||||||
|
}
|
||||||
|
| LABELSTR {
|
||||||
|
// FIXME: Should check to see if there is a forward ref'd basic block that
|
||||||
|
// we can use and reuse it as appropriate. It doesn't make sense just to
|
||||||
|
// make forward ref'd blocks then discard them.
|
||||||
|
$$ = CurBB = new BasicBlock("", CurFun.CurrentFunction);
|
||||||
|
setValueName($$, $1);
|
||||||
|
InsertValue($$);
|
||||||
};
|
};
|
||||||
|
|
||||||
BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
||||||
|
Reference in New Issue
Block a user