@@ -25,15 +25,10 @@ class CompilationUnit(val source: SourceFile) {
2525 /** Pickled TASTY binaries, indexed by class. */
2626 var pickled : Map [ClassSymbol , Array [Byte ]] = Map ()
2727
28- /** Will be reset to `true` if `tpdTree` contains a call to an inline method. The information
29- * is used in phase InlineCalls in order to avoid traversing an inline -less tree.
28+ /** Will be reset to `true` if contains `Quote`, `Splice` or calls to inline methods.
29+ * The information is used in phase ReifyQuotes in order to avoid traversing a quote -less tree.
3030 */
31- var containsInlineCalls : Boolean = false
32-
33- /** Will be reset to `true` if `untpdTree` contains `Quote` trees. The information
34- * is used in phase ReifyQuotes in order to avoid traversing a quote-less tree.
35- */
36- var containsQuotesOrSplices : Boolean = false
31+ var containsQuotesSplicesOrInline : Boolean = false
3732
3833 /** A structure containing a temporary map for generating inline accessors */
3934 val inlineAccessors : InlineAccessors = new InlineAccessors
@@ -53,21 +48,18 @@ object CompilationUnit {
5348 if (forceTrees) {
5449 val force = new Force
5550 force.traverse(unit1.tpdTree)
56- unit1.containsInlineCalls = force.containsInline
57- unit1.containsQuotesOrSplices = force.containsQuotes
51+ unit1.containsQuotesSplicesOrInline = force.containsQuotesOrInline
5852 }
5953 unit1
6054 }
6155
6256 /** Force the tree to be loaded */
6357 private class Force extends TreeTraverser {
64- var containsInline = false
65- var containsQuotes = false
58+ var containsQuotesOrInline = false
6659 def traverse (tree : Tree )(implicit ctx : Context ): Unit = {
67- if (tree.symbol.isQuote)
68- containsQuotes = true
69- if (tpd.isInlineCall(tree))
70- containsInline = true
60+ // Note that top-level splices are still inside the inline methods
61+ if (tree.symbol.isQuote || tpd.isInlineCall(tree))
62+ containsQuotesOrInline = true
7163 traverseChildren(tree)
7264 }
7365 }
0 commit comments