Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1927963002: Support compilation of Hello World (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/modelx.dart
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 3a1e981f5b85a870f330bb945e24f3e01b9ed29d..d090f760d872dfe274df4dbdeb8999e459e6fa0e 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -109,13 +109,15 @@ abstract class ElementX extends Element with ElementCommon {
return enclosingElement != null && enclosingElement.isCompilationUnit;
}
+ @override
+ int get sourceOffset => position?.charOffset;
+
Token get position => null;
SourceSpan get sourcePosition {
if (position == null) return null;
Uri uri = compilationUnit.script.resourceUri;
- return new SourceSpan(
- uri, position.charOffset, position.charOffset + position.charCount);
+ return new SourceSpan(uri, position.charOffset, position.charEnd);
}
Token findMyName(Token token) {
@@ -164,13 +166,6 @@ abstract class ElementX extends Element with ElementCommon {
return null;
}
- Element get enclosingClassOrCompilationUnit {
- for (Element e = this; e != null; e = e.enclosingElement) {
- if (e.isClass || e.isCompilationUnit) return e;
- }
- return null;
- }
-
/**
* Creates the scope for this element.
*/
@@ -2487,10 +2482,6 @@ abstract class BaseClassElementX extends ElementX
bool isProxy = false;
bool hasIncompleteHierarchy = false;
- // backendMembers are members that have been added by the backend to simplify
- // compilation. They don't have any user-side counter-part.
- Link<Element> backendMembers = const Link<Element>();
-
OrderedTypeSet allSupertypesAndSelf;
BaseClassElementX(String name, Element enclosing, this.id, int initialState)
@@ -2500,8 +2491,6 @@ abstract class BaseClassElementX extends ElementX
int get hashCode => id;
- bool get hasBackendMembers => !backendMembers.isEmpty;
-
bool get isUnnamedMixinApplication => false;
@override
@@ -2554,26 +2543,6 @@ abstract class BaseClassElementX extends ElementX
void setDefaultConstructor(
FunctionElement constructor, DiagnosticReporter reporter);
- void addBackendMember(Element member) {
- // TODO(ngeoffray): Deprecate this method.
- assert(member.isGenerativeConstructorBody);
- backendMembers = backendMembers.prepend(member);
- }
-
- void reverseBackendMembers() {
- backendMembers = backendMembers.reverse();
- }
-
- /// Lookup a synthetic element created by the backend.
- Element lookupBackendMember(String memberName) {
- for (Element element in backendMembers) {
- if (element.name == memberName) {
- return element;
- }
- }
- return null;
- }
-
ConstructorElement lookupDefaultConstructor() {
ConstructorElement constructor = lookupConstructor("");
// This method might be called on constructors that have not been
@@ -2598,10 +2567,6 @@ abstract class BaseClassElementX extends ElementX
return supertype == null ? null : supertype.element;
}
- void forEachBackendMember(void f(Element member)) {
- backendMembers.forEach(f);
- }
-
// TODO(johnniwinther): Remove these when issue 18630 is fixed.
ClassElement get patch => super.patch;
ClassElement get origin => super.origin;
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698