diff options
author | Sergey Prigogin | 2013-11-26 01:14:35 +0000 |
---|---|---|
committer | Sergey Prigogin | 2013-11-26 02:37:10 +0000 |
commit | 2d58772f7342249bccc32dfaf2b1cc7011768bb3 (patch) | |
tree | d1f125cf0e13dfb036e76e30ad8cd5b082035f9c /xlc/org.eclipse.cdt.core.lrparser.xlc | |
parent | d77a62571617de880e8d702df399a0ad6ae5c090 (diff) | |
download | org.eclipse.cdt-2d58772f7342249bccc32dfaf2b1cc7011768bb3.tar.gz org.eclipse.cdt-2d58772f7342249bccc32dfaf2b1cc7011768bb3.tar.xz org.eclipse.cdt-2d58772f7342249bccc32dfaf2b1cc7011768bb3.zip |
Bug 421247 - ASTNode.copy() chaining inconsistent
Change-Id: I89397209ae6a47b5a3a0827942b83a6755bc60e0
Reviewed-on: https://git.eclipse.org/r/18874
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Diffstat (limited to 'xlc/org.eclipse.cdt.core.lrparser.xlc')
2 files changed, 7 insertions, 9 deletions
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCASTVectorTypeSpecifier.java b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCASTVectorTypeSpecifier.java index b2df81bcab5..2f058b27493 100644 --- a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCASTVectorTypeSpecifier.java +++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCASTVectorTypeSpecifier.java @@ -15,7 +15,6 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTSimpleDeclSpecifier; @SuppressWarnings("restriction") public class XlcCASTVectorTypeSpecifier extends CASTSimpleDeclSpecifier implements IXlcCASTVectorTypeSpecifier { - private boolean isPixel; private boolean isBool; @@ -31,13 +30,9 @@ public class XlcCASTVectorTypeSpecifier extends CASTSimpleDeclSpecifier implemen @Override public XlcCASTVectorTypeSpecifier copy(CopyStyle style) { XlcCASTVectorTypeSpecifier copy = new XlcCASTVectorTypeSpecifier(); - copySimpleDeclSpec(copy, style); copy.isPixel = isPixel; copy.isBool = isBool; - if(style == CopyStyle.withLocations) { - copy.setCopyLocation(this); - } - return copy; + return copy(copy, style); } public boolean isPixel() { @@ -55,5 +50,4 @@ public class XlcCASTVectorTypeSpecifier extends CASTSimpleDeclSpecifier implemen public void setBool(boolean isBool) { this.isBool = isBool; } - } diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCPPASTModifiedArrayModifier.java b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCPPASTModifiedArrayModifier.java index 4231f03dc2f..e8edd8560ed 100644 --- a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCPPASTModifiedArrayModifier.java +++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/internal/core/lrparser/xlc/ast/XlcCPPASTModifiedArrayModifier.java @@ -32,6 +32,11 @@ public class XlcCPPASTModifiedArrayModifier extends CPPASTArrayModifier implemen @Override public XlcCPPASTModifiedArrayModifier copy() { + return copy(CopyStyle.withoutLocations); + } + + @Override + public XlcCPPASTModifiedArrayModifier copy(CopyStyle style) { IASTExpression exp = getConstantExpression(); XlcCPPASTModifiedArrayModifier copy = new XlcCPPASTModifiedArrayModifier(exp == null ? null : exp.copy()); copy.isVolatile = isVolatile; @@ -39,8 +44,7 @@ public class XlcCPPASTModifiedArrayModifier extends CPPASTArrayModifier implemen copy.isStatic = isStatic; copy.isConst = isConst; copy.varSized = varSized; - copy.setOffsetAndLength(this); - return copy; + return copy(copy, style); } public boolean isConst() { |