@@ -25,15 +25,10 @@ class CompilationUnit(val source: SourceFile) {
25
25
/** Pickled TASTY binaries, indexed by class. */
26
26
var pickled : Map [ClassSymbol , Array [Byte ]] = Map ()
27
27
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.
30
30
*/
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
37
32
38
33
/** A structure containing a temporary map for generating inline accessors */
39
34
val inlineAccessors : InlineAccessors = new InlineAccessors
@@ -53,21 +48,18 @@ object CompilationUnit {
53
48
if (forceTrees) {
54
49
val force = new Force
55
50
force.traverse(unit1.tpdTree)
56
- unit1.containsInlineCalls = force.containsInline
57
- unit1.containsQuotesOrSplices = force.containsQuotes
51
+ unit1.containsQuotesSplicesOrInline = force.containsQuotesOrInline
58
52
}
59
53
unit1
60
54
}
61
55
62
56
/** Force the tree to be loaded */
63
57
private class Force extends TreeTraverser {
64
- var containsInline = false
65
- var containsQuotes = false
58
+ var containsQuotesOrInline = false
66
59
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
71
63
traverseChildren(tree)
72
64
}
73
65
}
0 commit comments