diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-06-30 03:02:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-06-30 03:02:03 +0000 |
| commit | 5f88ccf3934f79966541a11fb7b9e0467b303f03 (patch) | |
| tree | ccee438fba97db84ddc16a2c4f8eee66bf27e04a /utils | |
| parent | c74714523d746f78b2b2c519cea065060aa6f886 (diff) | |
| download | external_llvm-5f88ccf3934f79966541a11fb7b9e0467b303f03.zip external_llvm-5f88ccf3934f79966541a11fb7b9e0467b303f03.tar.gz external_llvm-5f88ccf3934f79966541a11fb7b9e0467b303f03.tar.bz2 | |
check in anton's patch to make inlining happen in a determinstic order
and fix the bug that it uncovers: inlining a pattern fragment could bring
in other pattern fragments if the inlinee hadn't already been inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 2a7fd0b..1948c90 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -679,7 +679,10 @@ TreePatternNode *TreePatternNode::InlinePatternFragments(TreePattern &TP) { // Get a new copy of this fragment to stitch into here. //delete this; // FIXME: implement refcounting! - return FragTree; + + // The fragment we inlined could have recursive inlining that is needed. See + // if there are any pattern fragments in it and inline them as needed. + return FragTree->InlinePatternFragments(TP); } /// getImplicitType - Check to see if the specified record has an implicit @@ -1383,9 +1386,8 @@ void CodeGenDAGPatterns::ParsePatternFragments() { // Now that we've parsed all of the tree fragments, do a closure on them so // that there are not references to PatFrags left inside of them. - for (std::map<Record*, TreePattern*>::iterator I = PatternFragments.begin(), - E = PatternFragments.end(); I != E; ++I) { - TreePattern *ThePat = I->second; + for (unsigned i = 0, e = Fragments.size(); i != e; ++i) { + TreePattern *ThePat = PatternFragments[Fragments[i]]; ThePat->InlinePatternFragments(); // Infer as many types as possible. Don't worry about it if we don't infer |
