Removes unused JClassSeed type from JJS AST. http://gwt-code-reviews.appspot.com/153810/show Review by: spoon git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7634 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java index 45424e0..e63f993 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java +++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
@@ -21,7 +21,6 @@ import com.google.gwt.dev.jjs.SourceOrigin; import com.google.gwt.dev.jjs.Correlation.Literal; import com.google.gwt.dev.jjs.ast.JField.Disposition; -import com.google.gwt.dev.jjs.ast.js.JClassSeed; import com.google.gwt.dev.jjs.ast.js.JsniMethodBody; import com.google.gwt.dev.jjs.ast.js.JsonObject; import com.google.gwt.dev.jjs.impl.CodeSplitter; @@ -917,15 +916,6 @@ return classLiteral; } - /** - * TODO: unreferenced; remove this and JClassSeed? - */ - public JClassSeed getLiteralClassSeed(JClassType type) { - // could be interned - return new JClassSeed(createSourceInfoSynthetic(JProgram.class, - "class seed"), type, getTypeJavaLangObject()); - } - public JDoubleLiteral getLiteralDouble(double d) { return JDoubleLiteral.get(d); }
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java index 7f52180..a6a593c 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java +++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java
@@ -16,7 +16,6 @@ package com.google.gwt.dev.jjs.ast; import com.google.gwt.dev.jjs.InternalCompilerException; -import com.google.gwt.dev.jjs.ast.js.JClassSeed; import com.google.gwt.dev.jjs.ast.js.JMultiExpression; import com.google.gwt.dev.jjs.ast.js.JsniFieldRef; import com.google.gwt.dev.jjs.ast.js.JsniMethodBody; @@ -183,10 +182,6 @@ endVisit((JLiteral) x, ctx); } - public void endVisit(JClassSeed x, Context ctx) { - endVisit((JLiteral) x, ctx); - } - public void endVisit(JClassType x, Context ctx) { endVisit((JDeclaredType) x, ctx); } @@ -499,10 +494,6 @@ return visit((JLiteral) x, ctx); } - public boolean visit(JClassSeed x, Context ctx) { - return visit((JLiteral) x, ctx); - } - public boolean visit(JClassType x, Context ctx) { return visit((JDeclaredType) x, ctx); }
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/js/JClassSeed.java b/dev/core/src/com/google/gwt/dev/jjs/ast/js/JClassSeed.java deleted file mode 100644 index 9644b19..0000000 --- a/dev/core/src/com/google/gwt/dev/jjs/ast/js/JClassSeed.java +++ /dev/null
@@ -1,57 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.dev.jjs.ast.js; - -import com.google.gwt.dev.jjs.SourceInfo; -import com.google.gwt.dev.jjs.ast.Context; -import com.google.gwt.dev.jjs.ast.JClassType; -import com.google.gwt.dev.jjs.ast.JLiteral; -import com.google.gwt.dev.jjs.ast.JType; -import com.google.gwt.dev.jjs.ast.JVisitor; - -/** - * An AST node representing a class's constructor function. Only used by - * generated code, it doesn't represent any user construct. - */ -public class JClassSeed extends JLiteral { - - /** - * The class being referred to. - */ - private final JClassType refType; - private final JClassType objectType; - - public JClassSeed(SourceInfo sourceInfo, JClassType type, - JClassType objectType) { - super(sourceInfo); - refType = type; - this.objectType = objectType; - } - - public JClassType getRefType() { - return refType; - } - - public JType getType() { - return objectType; - } - - public void traverse(JVisitor visitor, Context ctx) { - if (visitor.visit(this, ctx)) { - } - visitor.endVisit(this, ctx); - } -}
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/CloneExpressionVisitor.java b/dev/core/src/com/google/gwt/dev/jjs/impl/CloneExpressionVisitor.java index 6bcc205..e1da519 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/CloneExpressionVisitor.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/CloneExpressionVisitor.java
@@ -46,7 +46,6 @@ import com.google.gwt.dev.jjs.ast.JStringLiteral; import com.google.gwt.dev.jjs.ast.JThisRef; import com.google.gwt.dev.jjs.ast.JVisitor; -import com.google.gwt.dev.jjs.ast.js.JClassSeed; import com.google.gwt.dev.jjs.ast.js.JMultiExpression; import com.google.gwt.dev.jjs.ast.js.JsniFieldRef; import com.google.gwt.dev.jjs.ast.js.JsniMethodRef; @@ -142,13 +141,6 @@ } @Override - public boolean visit(JClassSeed x, Context ctx) { - expression = new JClassSeed(x.getSourceInfo(), x.getRefType(), - program.getTypeJavaLangObject()); - return false; - } - - @Override public boolean visit(JConditional x, Context ctx) { expression = new JConditional(x.getSourceInfo(), x.getType(), cloneExpression(x.getIfTest()), cloneExpression(x.getThenExpr()),
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java index fcbfe3c..6e42209 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
@@ -81,7 +81,6 @@ import com.google.gwt.dev.jjs.ast.JVariable; import com.google.gwt.dev.jjs.ast.JVisitor; import com.google.gwt.dev.jjs.ast.JWhileStatement; -import com.google.gwt.dev.jjs.ast.js.JClassSeed; import com.google.gwt.dev.jjs.ast.js.JMultiExpression; import com.google.gwt.dev.jjs.ast.js.JsniMethodBody; import com.google.gwt.dev.jjs.ast.js.JsniMethodRef; @@ -618,11 +617,6 @@ push(classLit.makeRef(x.getSourceInfo())); } - @Override - public void endVisit(JClassSeed x, Context ctx) { - push(names.get(x.getRefType()).makeRef(x.getSourceInfo())); - } - @SuppressWarnings("unchecked") @Override public void endVisit(JClassType x, Context ctx) {