Remove callerLabel from Environment.
It is a Bazel-specific information.
--
MOS_MIGRATED_REVID=140719791
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Environment.java b/src/main/java/com/google/devtools/build/lib/syntax/Environment.java
index 11515ef..7029a59 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/Environment.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/Environment.java
@@ -336,13 +336,6 @@
@Nullable private Continuation continuation;
/**
- * Gets the label of the BUILD file that is using this environment. For example, if a target
- * //foo has a dependency on //bar which is a Skylark rule defined in //rules:my_rule.bzl being
- * evaluated in this environment, then this would return //foo.
- */
- @Nullable private final Label callerLabel;
-
- /**
* Enters a scope by saving state to a new Continuation
* @param function the function whose scope to enter
* @param caller the source AST node for the caller
@@ -463,7 +456,6 @@
* @param importedExtensions Extension-s from which to import bindings with load()
* @param fileContentHashCode a hash for the source file being evaluated, if any
* @param phase the current phase
- * @param callerLabel the label this environment came from
*/
private Environment(
Frame globalFrame,
@@ -471,8 +463,7 @@
EventHandler eventHandler,
Map<String, Extension> importedExtensions,
@Nullable String fileContentHashCode,
- Phase phase,
- @Nullable Label callerLabel) {
+ Phase phase) {
this.globalFrame = Preconditions.checkNotNull(globalFrame);
this.dynamicFrame = Preconditions.checkNotNull(dynamicFrame);
Preconditions.checkArgument(globalFrame.mutability().isMutable());
@@ -480,7 +471,6 @@
this.eventHandler = eventHandler;
this.importedExtensions = importedExtensions;
this.phase = phase;
- this.callerLabel = callerLabel;
this.transitiveHashCode =
computeTransitiveContentHashCode(fileContentHashCode, importedExtensions);
}
@@ -495,7 +485,6 @@
@Nullable private EventHandler eventHandler;
@Nullable private Map<String, Extension> importedExtensions;
@Nullable private String fileContentHashCode;
- private Label label;
Builder(Mutability mutability) {
this.mutability = mutability;
@@ -560,13 +549,7 @@
eventHandler,
importedExtensions,
fileContentHashCode,
- phase,
- label);
- }
-
- public Builder setCallerLabel(Label label) {
- this.label = label;
- return this;
+ phase);
}
}
@@ -575,13 +558,6 @@
}
/**
- * Returns the caller's label.
- */
- public Label getCallerLabel() {
- return callerLabel;
- }
-
- /**
* Sets a binding for a special dynamic variable in this Environment.
* This is not for end-users, and will throw an AssertionError in case of conflict.
* @param varname the name of the dynamic variable to be bound