Skip to main content
summaryrefslogtreecommitdiffstats
path: root/upc
diff options
context:
space:
mode:
authorSergey Prigogin2012-04-13 14:36:38 -0400
committerSergey Prigogin2012-04-13 14:48:35 -0400
commit33374d0a517f3c40e03352b63ec4edc8885fb633 (patch)
treecab9a2541a7977cebf2ab5e9f6c3717e961cd194 /upc
parentb9097cd175b8a61b156f24821ef9c811b42228f6 (diff)
downloadorg.eclipse.cdt-33374d0a517f3c40e03352b63ec4edc8885fb633.tar.gz
org.eclipse.cdt-33374d0a517f3c40e03352b63ec4edc8885fb633.tar.xz
org.eclipse.cdt-33374d0a517f3c40e03352b63ec4edc8885fb633.zip
Bug 316230 - Representation of gcc attributes in AST. Also
contains a fix for bug 330635. Change-Id: I11d872bd68dc0819a95ad8bf83c6db20fbc81387 Reviewed-on: https://git.eclipse.org/r/5554 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 'upc')
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java11
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java26
2 files changed, 17 insertions, 20 deletions
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java
index 9b85e45259..5987c3a5ec 100644
--- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java
+++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.upc.ast;
@@ -39,11 +40,7 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo
public UPCASTForallStatement copy(CopyStyle style) {
UPCASTForallStatement copy = new UPCASTForallStatement();
copy.setAffinityExpression(affinity == null ? null : affinity.copy(style));
- copyForStatement(copy, style);
- if (style == CopyStyle.withLocations) {
- copy.setCopyLocation(this);
- }
- return copy;
+ return copy(copy, style);
}
@Override
@@ -83,6 +80,8 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo
}
}
+ if (!acceptByAttributes(visitor)) return false;
+
IASTStatement initializer = super.getInitializerStatement();
if (initializer != null && !initializer.accept(visitor)) return false;
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java
index 9058c8aa90..b28385766a 100644
--- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java
+++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java
@@ -1,22 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
- * IBM Corporation - initial API and implementation
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.upc.ast;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
-import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
+import org.eclipse.cdt.internal.core.dom.parser.ASTAttributeOwner;
@SuppressWarnings("restriction")
-public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSynchronizationStatement {
+public class UPCASTSynchronizationStatement extends ASTAttributeOwner implements IUPCASTSynchronizationStatement {
private int statmentKind;
private IASTExpression barrierExpression;
@@ -38,11 +39,7 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy
UPCASTSynchronizationStatement copy = new UPCASTSynchronizationStatement();
copy.statmentKind = statmentKind;
copy.setBarrierExpression(barrierExpression == null ? null : barrierExpression.copy(style));
- copy.setOffsetAndLength(this);
- if (style == CopyStyle.withLocations) {
- copy.setCopyLocation(this);
- }
- return copy;
+ return copy(copy, style);
}
@Override
@@ -78,6 +75,7 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy
}
}
+ if (!acceptByAttributes(visitor)) return false;
if (barrierExpression != null && !barrierExpression.accept(visitor)) return false;
if (visitor.shouldVisitStatements) {

Back to the top