aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2015-10-22 13:52:00 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-10-22 15:17:33 +0000
commit1a759077b44f160c1a299babf8a0105fd1372bd4 (patch)
tree6d34d551ead274f492adf80643aef2be2044a8c4 /src/main/java
parentd262fa501bcd6fff6de9e3fa3d71ae58a1daad27 (diff)
Remove ast from Rule
It's always null -- MOS_MIGRATED_REVID=106053287
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/Package.java12
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/PackageDeserializer.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/Rule.java15
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/RuleClass.java2
4 files changed, 10 insertions, 25 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java
index 94df8eae6c..579e0604d8 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Package.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java
@@ -35,7 +35,6 @@ import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.AttributeMap.AcceptsLabelAttribute;
import com.google.devtools.build.lib.packages.License.DistributionType;
import com.google.devtools.build.lib.packages.PackageFactory.Globber;
-import com.google.devtools.build.lib.syntax.FuncallExpression;
import com.google.devtools.build.lib.util.Pair;
import com.google.devtools.build.lib.vfs.Canonicalizer;
import com.google.devtools.build.lib.vfs.Path;
@@ -1002,15 +1001,14 @@ public class Package {
* <p>Useful for RuleClass instantiation, where the rule name is checked by trying to create a
* Label. This label can then be used again here.
*/
- Rule newRuleWithLabel(Label label, RuleClass ruleClass, FuncallExpression ast,
- Location location) {
- return newRuleWithLabelAndAttrContainer(label, ruleClass, ast, location,
+ Rule newRuleWithLabel(Label label, RuleClass ruleClass, Location location) {
+ return newRuleWithLabelAndAttrContainer(label, ruleClass, location,
new AttributeContainer(ruleClass));
}
- Rule newRuleWithLabelAndAttrContainer(Label label, RuleClass ruleClass, FuncallExpression ast,
- Location location, AttributeContainer attributeContainer) {
- return new Rule(pkg, label, ruleClass, ast, location, attributeContainer);
+ Rule newRuleWithLabelAndAttrContainer(Label label, RuleClass ruleClass, Location location,
+ AttributeContainer attributeContainer) {
+ return new Rule(pkg, label, ruleClass, location, attributeContainer);
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializer.java b/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializer.java
index 4a4ae10993..302240f74d 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializer.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializer.java
@@ -369,7 +369,7 @@ public class PackageDeserializer {
* Deserialize a package from its representation as a protocol message. The inverse of
* {@link PackageSerializer#serialize}.
* @throws IOException
- * @throws InterruptedException
+ * @throws InterruptedException
*/
private void deserializeInternal(Build.Package packagePb, StoredEventHandler eventHandler,
Package.Builder builder, InputStream in)
@@ -472,7 +472,7 @@ public class PackageDeserializer {
* @return a new {@link Package} as read from {@code in}
* @throws PackageDeserializationException on failures deserializing the input
* @throws IOException on failures reading from {@code in}
- * @throws InterruptedException
+ * @throws InterruptedException
*/
public Package deserialize(InputStream in)
throws PackageDeserializationException, IOException, InterruptedException {
@@ -719,7 +719,7 @@ public class PackageDeserializer {
Map<String, ParsedAttributeValue> attributeValues, EventHandler eventHandler,
AttributeContainer attributeContainer)
throws LabelSyntaxException, InterruptedException {
- Rule rule = pkgBuilder.newRuleWithLabelAndAttrContainer(label, ruleClass, null, ruleLocation,
+ Rule rule = pkgBuilder.newRuleWithLabelAndAttrContainer(label, ruleClass, ruleLocation,
attributeContainer);
rule.checkValidityPredicate(eventHandler);
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Rule.java b/src/main/java/com/google/devtools/build/lib/packages/Rule.java
index 1cc5f63c03..df1cb5e9b5 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Rule.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Rule.java
@@ -35,7 +35,6 @@ import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition;
import com.google.devtools.build.lib.packages.License.DistributionType;
import com.google.devtools.build.lib.syntax.EvalException;
-import com.google.devtools.build.lib.syntax.FuncallExpression;
import com.google.devtools.build.lib.syntax.GlobList;
import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.util.BinaryPredicate;
@@ -149,15 +148,13 @@ public final class Rule implements Target {
private final Location location;
- private final FuncallExpression ast; // may be null
-
private final String workspaceName;
// Initialized in the call to populateOutputFiles.
private List<OutputFile> outputFiles;
private ListMultimap<String, OutputFile> outputFileMap;
- Rule(Package pkg, Label label, RuleClass ruleClass, FuncallExpression ast, Location location,
+ Rule(Package pkg, Label label, RuleClass ruleClass, Location location,
AttributeContainer attributeContainer) {
this.pkg = Preconditions.checkNotNull(pkg);
this.label = label;
@@ -166,7 +163,6 @@ public final class Rule implements Target {
this.attributes = attributeContainer;
this.attributeMap = new RawAttributeMapper(pkg, ruleClass, label, attributes);
this.containsErrors = false;
- this.ast = ast;
this.workspaceName = pkg.getWorkspaceName();
}
@@ -248,15 +244,6 @@ public final class Rule implements Target {
}
/**
- * Returns the AST for this rule. Returns null if the package factory chose
- * not to retain the AST when evaluateBuildFile was called for this rule's
- * package.
- */
- public FuncallExpression getSyntaxTree() {
- return ast;
- }
-
- /**
* Returns true iff there were errors while constructing this rule, such as
* attributes with missing values or values of the wrong type.
*/
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index 797aeb94d5..aaa0c7d422 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -1230,7 +1230,7 @@ public final class RuleClass {
Rule createRuleWithLabel(Package.Builder pkgBuilder, Label ruleLabel,
Map<String, Object> attributeValues, EventHandler eventHandler, FuncallExpression ast,
Location location) throws LabelSyntaxException, InterruptedException {
- Rule rule = pkgBuilder.newRuleWithLabel(ruleLabel, this, null, location);
+ Rule rule = pkgBuilder.newRuleWithLabel(ruleLabel, this, location);
createRuleCommon(rule, pkgBuilder, attributeValues, eventHandler, ast);
return rule;
}