Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Watson2016-03-24 21:58:49 +0000
committerGreg Watson2016-03-24 21:58:49 +0000
commit10e74a3bf03a6ccf948eaea257db217f694e5003 (patch)
tree24957508a28d32f4dd335d48194727e9867c2a98
parent2b9d06eceb511843831e53af87a95c5196fd38a9 (diff)
downloadorg.eclipse.ptp-10e74a3bf03a6ccf948eaea257db217f694e5003.tar.gz
org.eclipse.ptp-10e74a3bf03a6ccf948eaea257db217f694e5003.tar.xz
org.eclipse.ptp-10e74a3bf03a6ccf948eaea257db217f694e5003.zip
Fix API changes in CDT and add a target definition.
Change-Id: I6f33b340737c41834c0e9253c902110f53cdcbd3 Signed-off-by: Greg Watson <g.watson@computer.org>
-rw-r--r--pom.xml21
-rw-r--r--releng/org.eclipse.ptp.target/.project11
-rw-r--r--releng/org.eclipse.ptp.target/mars.target24
-rw-r--r--releng/org.eclipse.ptp.target/neon.target47
-rw-r--r--releng/org.eclipse.ptp.target/pom.xml44
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/BarrierTable.java117
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIBarrierExprModified.java9
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIMVAnalysis.java59
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPISingleAssignAnalysis.java40
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/UseDefBuilder.java36
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTFunctionMacro.java10
-rw-r--r--tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTObjectMacro.java10
12 files changed, 269 insertions, 159 deletions
diff --git a/pom.xml b/pom.xml
index 53c235697..32747a1af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,13 +20,16 @@
<eclipse-release>neon</eclipse-release>
<tycho-version>0.23.1</tycho-version>
<tycho-extras-version>${tycho-version}</tycho-extras-version>
+ <!--
<platform-site>http://download.eclipse.org/eclipse/updates/4.6milestones</platform-site>
<tm-site>http://download.eclipse.org/tm/terminal/updates/4.0milestones</tm-site>
<cdt-site>http://download.eclipse.org/tools/cdt/builds/${eclipse-release}/milestones</cdt-site>
+ <launchbar-site>http://download.eclipse.org/tools/cdt/launchbar/neon.m6</launchbar-site>
<egit-site>http://download.eclipse.org/egit/updates-stable-nightly</egit-site>
<photran-site>https://hudson.eclipse.org/ptp/job/ptp-nightly-photran/lastSuccessfulBuild/artifact/org.eclipse.photran.repo/target/repository/</photran-site>
<remote-site>http://download.eclipse.org/tools/ptp/builds/remote/${remote-version}</remote-site>
<license-site>http://download.eclipse.org/cbi/updates/license</license-site>
+ -->
<help-docs-eclipserun-repo>http://download.eclipse.org/eclipse/updates/4.5</help-docs-eclipserun-repo>
<!-- The following property is used by the production profile to install the final repo and -->
<!-- associated components. It should be overridden if installing into a different location. -->
@@ -48,6 +51,7 @@
</licenses>
<modules>
+ <module>releng/org.eclipse.ptp.target</module>
<module>core/org.eclipse.ptp.core</module>
<module>core/org.eclipse.ptp.ems.core</module>
<module>core/org.eclipse.ptp.ems.ui</module>
@@ -160,7 +164,7 @@
</modules>
<repositories>
- <repository>
+ <!-- repository>
<id>platform-${eclipse-release}</id>
<url>${platform-site}</url>
<layout>p2</layout>
@@ -176,6 +180,11 @@
<layout>p2</layout>
</repository>
<repository>
+ <id>launchbar-${eclipse-release}</id>
+ <url>${launchbar-site}</url>
+ <layout>p2</layout>
+ </repository>
+ <repository>
<id>egit-${eclipse-release}</id>
<url>${egit-site}</url>
<layout>p2</layout>
@@ -194,7 +203,7 @@
<id>license</id>
<url>${license-site}</url>
<layout>p2</layout>
- </repository>
+ </repository-->
</repositories>
<build>
@@ -239,6 +248,14 @@
<arch>x86_64</arch>
</environment>
</environments>
+ <target>
+ <artifact>
+ <groupId>org.eclipse.ptp</groupId>
+ <artifactId>org.eclipse.ptp.target</artifactId>
+ <version>9.0.2-SNAPSHOT</version>
+ <classifier>neon</classifier>
+ </artifact>
+ </target>
</configuration>
</plugin>
<plugin>
diff --git a/releng/org.eclipse.ptp.target/.project b/releng/org.eclipse.ptp.target/.project
new file mode 100644
index 000000000..2b8c7f348
--- /dev/null
+++ b/releng/org.eclipse.ptp.target/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ptp.target</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.ptp.target/mars.target b/releng/org.eclipse.ptp.target/mars.target
new file mode 100644
index 000000000..c848db9d2
--- /dev/null
+++ b/releng/org.eclipse.ptp.target/mars.target
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?>
+<target name="mars" sequenceNumber="0">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.sdk.ide" version="0.0.0"/>
+<repository location="http://download.eclipse.org/eclipse/updates/4.5/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.mockito" version="0.0.0"/>
+<unit id="org.hamcrest" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.cdt.native.serial" version="0.0.0"/>
+<unit id="org.eclipse.cdt.core" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/cdt/builds/master/nightly/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.tm.terminal.control" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tm/terminal/builds/development/nightly/"/>
+</location>
+</locations>
+</target>
diff --git a/releng/org.eclipse.ptp.target/neon.target b/releng/org.eclipse.ptp.target/neon.target
new file mode 100644
index 000000000..8e96f0c17
--- /dev/null
+++ b/releng/org.eclipse.ptp.target/neon.target
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="mars" sequenceNumber="17">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.launchbar.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/cdt/launchbar/neon.m6/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="com.google.gson" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.license.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/cbi/updates/license/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/egit/updates-stable-nightly/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.remote.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/ptp/builds/remote/neon/milestones/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.sdk.ide" version="0.0.0"/>
+<repository location="http://download.eclipse.org/eclipse/updates/4.6milestones/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.tm.terminal.connector.remote.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.tm.terminal.control.sdk.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.tm.terminal.sdk.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.tm.terminal.view.sdk.feature.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tm/terminal/updates/4.0milestones/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.photran.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.photran.intel.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.photran.xlf.feature.group" version="0.0.0"/>
+<repository location="https://hudson.eclipse.org/ptp/job/ptp-nightly-photran/lastSuccessfulBuild/artifact/org.eclipse.photran.repo/target/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.cdt.sdk.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.cdt.core.parser.upc.sdk.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/cdt/builds/neon/milestones/"/>
+</location>
+</locations>
+</target>
diff --git a/releng/org.eclipse.ptp.target/pom.xml b/releng/org.eclipse.ptp.target/pom.xml
new file mode 100644
index 000000000..dd7a8dd6b
--- /dev/null
+++ b/releng/org.eclipse.ptp.target/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.ptp</groupId>
+ <artifactId>ptp-parent</artifactId>
+ <version>9.0.2-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.ptp.target</artifactId>
+ <packaging>pom</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.9.1</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>neon.target</file>
+ <type>target</type>
+ <classifier>neon</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/BarrierTable.java b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/BarrierTable.java
index 0fce3de19..e01a386cd 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/BarrierTable.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/BarrierTable.java
@@ -153,76 +153,77 @@ public class BarrierTable {
* Problem: for the case of #define newcomm MPI_COMM_WORLD
* I don't want the getRawSignature() on the communicator arg, i want the
* pre-processed value. How to get that?
+ *
+ * FIXME: This hasn't been tested with the new getArguments() interface, so may be broken.
*/
//@formatter:on
protected void setComm() {
- IASTExpression parameter = barrier_.getParameterExpression();
- IASTInitializerClause[] newParms = barrier_.getArguments(); // BRT could fix deprecation?
-
- if (parameter instanceof IASTUnaryExpression) {
- IASTUnaryExpression commExpr = (IASTUnaryExpression) parameter;
- IASTExpression commOp = commExpr.getOperand();
- if (commOp instanceof IASTUnaryExpression) {
- if (dbg_barrier)
- System.out.println("setComm(): communicator is IASTUnaryExpression"); //$NON-NLS-1$
- // IASTUnaryExpression commOprd = (IASTUnaryExpression) commOp;
- if (commOp instanceof IASTLiteralExpression) {// Yuan says windows
+ IASTInitializerClause[] arguments = barrier_.getArguments();
+ if (arguments.length > 0) {
+ if (arguments[0] instanceof IASTUnaryExpression) {
+ IASTUnaryExpression commExpr = (IASTUnaryExpression) arguments[0];
+ IASTExpression commOp = commExpr.getOperand();
+ if (commOp instanceof IASTUnaryExpression) {
if (dbg_barrier)
- System.out.println();
- IASTLiteralExpression comm = (IASTLiteralExpression) commOp;
- comm_ = comm.toString();
- } else if (commOp instanceof IASTIdExpression) { // Yuan says linux
- IASTIdExpression comm = (IASTIdExpression) commOp;
- comm_ = comm.getName().toString();
- } else if (commOp instanceof IASTName) {// ?
- comm_ = commOp.toString();
- } else {
-
- if (commOp instanceof IASTUnaryExpression) {// Mac OSX Openmpi < 1.3 (/usr/include/mpi.h) // 4/14/10: got
- // here OMPI 1.3.3
- IASTUnaryExpression iastUnaryExpression = (IASTUnaryExpression) commOp;
+ System.out.println("setComm(): communicator is IASTUnaryExpression"); //$NON-NLS-1$
+ // IASTUnaryExpression commOprd = (IASTUnaryExpression) commOp;
+ if (commOp instanceof IASTLiteralExpression) {// Yuan says windows
if (dbg_barrier)
- System.out.println("bdbg: communicator is IASTUnaryExpression"); //$NON-NLS-1$
- comm_ = iastUnaryExpression.getRawSignature();
-
+ System.out.println();
+ IASTLiteralExpression comm = (IASTLiteralExpression) commOp;
+ comm_ = comm.toString();
+ } else if (commOp instanceof IASTIdExpression) { // Yuan says linux
+ IASTIdExpression comm = (IASTIdExpression) commOp;
+ comm_ = comm.getName().toString();
+ } else if (commOp instanceof IASTName) {// ?
+ comm_ = commOp.toString();
} else {
- // last resort: use a unique name, but it won't
- // match anything??
+
+ if (commOp instanceof IASTUnaryExpression) {// Mac OSX Openmpi < 1.3 (/usr/include/mpi.h) // 4/14/10: got
+ // here OMPI 1.3.3
+ IASTUnaryExpression iastUnaryExpression = (IASTUnaryExpression) commOp;
+ if (dbg_barrier)
+ System.out.println("bdbg: communicator is IASTUnaryExpression"); //$NON-NLS-1$
+ comm_ = iastUnaryExpression.getRawSignature();
+
+ } else {
+ // last resort: use a unique name, but it won't
+ // match anything??
+ comm_ = "COMM_" + commCounter; //$NON-NLS-1$
+ commCounter++;
+ }
+ }
+ } else {
+ if (commOp instanceof IASTCastExpression) {// MAC OSX Openmpi 1.3.3 ;mpich2
+ IASTCastExpression iastCastExpression = (IASTCastExpression) commOp;
+ comm_ = iastCastExpression.getRawSignature();
+ }
+ else {
comm_ = "COMM_" + commCounter; //$NON-NLS-1$
commCounter++;
}
+
}
+ } else if (arguments[0] instanceof IASTIdExpression) {// windows mpich 1.2
+ IASTIdExpression idE = (IASTIdExpression) arguments[0];
+ comm_ = idE.getName().toString();
+
+ /*
+ * BRT 9/9/09: why hide the actual name? no non-mpi-comm-world comms will match!
+ * if (!comm_.equals("MPI_COMM_WORLD")) {
+ * comm_ = "COMM_" + commCounter;
+ * commCounter++;
+ * }
+ */
+ } else if (arguments[0] instanceof IASTLiteralExpression) {// added 9/9/09 for windows/mpich
+ IASTLiteralExpression iastLiteralExpression = (IASTLiteralExpression) arguments[0];
+
+ String str = iastLiteralExpression.getRawSignature();
+ comm_ = iastLiteralExpression.getRawSignature();
} else {
- if (commOp instanceof IASTCastExpression) {// MAC OSX Openmpi 1.3.3 ;mpich2
- IASTCastExpression iastCastExpression = (IASTCastExpression) commOp;
- comm_ = iastCastExpression.getRawSignature();
- }
- else {
- comm_ = "COMM_" + commCounter; //$NON-NLS-1$
- commCounter++;
- }
-
+ comm_ = "COMM_" + commCounter; //$NON-NLS-1$
+ commCounter++;
}
- } else if (parameter instanceof IASTIdExpression) {// windows mpich 1.2
- IASTIdExpression idE = (IASTIdExpression) parameter;
- comm_ = idE.getName().toString();
-
- /*
- * BRT 9/9/09: why hide the actual name? no non-mpi-comm-world comms will match!
- * if (!comm_.equals("MPI_COMM_WORLD")) {
- * comm_ = "COMM_" + commCounter;
- * commCounter++;
- * }
- */
- } else if (parameter instanceof IASTLiteralExpression) {// added 9/9/09 for windows/mpich
- IASTLiteralExpression iastLiteralExpression = (IASTLiteralExpression) parameter;
-
- String str = iastLiteralExpression.getRawSignature();
- comm_ = iastLiteralExpression.getRawSignature();
- }
- else {
- comm_ = "COMM_" + commCounter; //$NON-NLS-1$
- commCounter++;
}
if (dbg_barrier)
System.out.println("setComm(): communicator: " + comm_); //$NON-NLS-1$
diff --git a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIBarrierExprModified.java b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIBarrierExprModified.java
index 7c6635329..390f38e94 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIBarrierExprModified.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIBarrierExprModified.java
@@ -43,6 +43,7 @@ import org.eclipse.cdt.core.dom.ast.IASTGotoStatement;
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
+import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
import org.eclipse.cdt.core.dom.ast.IASTInitializerList;
import org.eclipse.cdt.core.dom.ast.IASTLabelStatement;
@@ -648,7 +649,7 @@ public class MPIBarrierExprModified extends ASTVisitor {
else if (expr instanceof IASTFunctionCallExpression) {
IASTFunctionCallExpression fExpr = (IASTFunctionCallExpression) expr;
IASTExpression funcname = fExpr.getFunctionNameExpression();
- IASTExpression parameter = fExpr.getParameterExpression();
+ IASTInitializerClause[] arguments = fExpr.getArguments();
String signature = funcname.getRawSignature();
int id = bTable_.isBarrier(fExpr);
if (id != -1) { /* barrier */
@@ -657,7 +658,7 @@ public class MPIBarrierExprModified extends ASTVisitor {
for (Enumeration<String> e = stacks_.keys(); e.hasMoreElements();) {
String commkey = e.nextElement();
Stack<BarrierExpression> sk = stacks_.get(commkey);
- if (parameter != null)
+ for (int i = 0; i < arguments.length; i++) // FIXME: check this is the correct thing to do
sk.pop(); // parameter
sk.pop(); // functionName
if (commkey.equals(comm))
@@ -674,7 +675,7 @@ public class MPIBarrierExprModified extends ASTVisitor {
String comm = e.nextElement();
Stack<BarrierExpression> sk = stacks_.get(comm);
BarrierExpression funcBE = node.getBarrierExpr().get(comm);
- if (parameter != null)
+ for (int i = 0; i < arguments.length; i++) // FIXME: check this is the correct thing to do
sk.pop(); // parameter
sk.pop(); // functionName
if (node == currentNode_) { // recursive functions
@@ -692,7 +693,7 @@ public class MPIBarrierExprModified extends ASTVisitor {
be = new BarrierExpression(BarrierExpression.BE_bot);
for (Enumeration<Stack<BarrierExpression>> e = stacks_.elements(); e.hasMoreElements();) {
Stack<BarrierExpression> sk = e.nextElement();
- if (parameter != null)
+ for (int i = 0; i < arguments.length; i++) // FIXME: check this is the correct thing to do
sk.pop(); // parameter
sk.pop(); // functionName
sk.push(be);
diff --git a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIMVAnalysis.java b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIMVAnalysis.java
index bd3d0d882..993013b2b 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIMVAnalysis.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPIMVAnalysis.java
@@ -98,17 +98,18 @@ public class MPIMVAnalysis {
IASTExpression funcname = funcE.getFunctionNameExpression();
String signature = funcname.getRawSignature();
if (signature.equals("MPI_Bcast")) { //$NON-NLS-1$
- IASTExpression paramE = funcE.getParameterExpression();
- IASTExpression[] params = ((IASTExpressionList) paramE).getExpressions();
- IASTExpression dataE = params[0];
- if (dataE instanceof IASTIdExpression) {
- IASTIdExpression ID = (IASTIdExpression) dataE;
- var = ID.getName().toString();
- } else if (dataE instanceof IASTUnaryExpression) {
- IASTUnaryExpression uE = (IASTUnaryExpression) dataE;
- if (uE.getOperator() == IASTUnaryExpression.op_amper && uE.getOperand() instanceof IASTIdExpression) {
- IASTIdExpression ID = (IASTIdExpression) uE.getOperand();
+ IASTInitializerClause[] arguments = funcE.getArguments();
+ if (arguments.length > 0 && arguments[0] instanceof IASTExpression) {
+ IASTExpression dataE = (IASTExpression) arguments[0];
+ if (dataE instanceof IASTIdExpression) {
+ IASTIdExpression ID = (IASTIdExpression) dataE;
var = ID.getName().toString();
+ } else if (dataE instanceof IASTUnaryExpression) {
+ IASTUnaryExpression uE = (IASTUnaryExpression) dataE;
+ if (uE.getOperator() == IASTUnaryExpression.op_amper && uE.getOperand() instanceof IASTIdExpression) {
+ IASTIdExpression ID = (IASTIdExpression) uE.getOperand();
+ var = ID.getName().toString();
+ }
}
}
}
@@ -436,12 +437,7 @@ public class MPIMVAnalysis {
IASTFunctionCallExpression funcE = (IASTFunctionCallExpression) expr;
IASTExpression funcname = funcE.getFunctionNameExpression();
String signature = funcname.getRawSignature();
- IASTExpression parameter = funcE.getParameterExpression();// BRT
- // this
- // might
- // still
- // work!!
- funcE.getArguments();
+ IASTInitializerClause[] arguments = funcE.getArguments();
MPICallGraphNode cgNode = (MPICallGraphNode) cg_.getNode(currentNode_.getFileName(), signature);
if (cgNode != null) { // BRT always null on tiny.c. ??
/*
@@ -451,7 +447,8 @@ public class MPIMVAnalysis {
* return value is MV or SV
*/
boolean returnval = false;
- if (parameter != null) {
+ if (arguments.length > 0 && arguments[0] instanceof IASTExpression) {
+ IASTExpression parameter = (IASTExpression) arguments[0];
v1 = useDefMVMapping(parameter, side, funcE, l1);
// BRT note with CDT 7.0 the IASTExpressionList is not
// encountered in the AST
@@ -495,7 +492,8 @@ public class MPIMVAnalysis {
return returnval;
}// end if cgNode!=null
else {
- if (parameter != null) {
+ if (arguments.length > 0 && arguments[0] instanceof IASTExpression) {
+ IASTExpression parameter = (IASTExpression) arguments[0];
v1 = useDefMVMapping(parameter, side, funcE, l1);
if (parameter instanceof IASTExpressionList) {
exprListMVContext_.pop();
@@ -643,12 +641,10 @@ public class MPIMVAnalysis {
String signature = funcname.getRawSignature();
func = (MPICallGraphNode) cg_.getNode(currentNode_.getFileName(), signature);
if (func != null) {
- IASTExpression parameter = funcExpr.getParameterExpression();
- if (parameter instanceof IASTExpressionList) {
- IASTExpressionList paramListE = (IASTExpressionList) parameter;
- IASTExpression[] params = paramListE.getExpressions();
- for (int i = 0; i < params.length; i++) {
- ExprMVAnalyzer ema = new ExprMVAnalyzer(params[i], block_.getMVvar(), block_);
+ IASTInitializerClause[] arguments = funcExpr.getArguments();
+ for (int i = 0; i < arguments.length; i++) {
+ if (arguments[i] instanceof IASTExpression) {
+ ExprMVAnalyzer ema = new ExprMVAnalyzer(arguments[i], block_.getMVvar(), block_);
ema.run();
if (ema.isMV()) {
String paramName = getFormalParamName(func, i);
@@ -657,15 +653,6 @@ public class MPIMVAnalysis {
}
}
}
- } else if (parameter != null) {
- ExprMVAnalyzer ema = new ExprMVAnalyzer(parameter, block_.getMVvar(), block_);
- ema.run();
- if (ema.isMV()) {
- String paramName = getFormalParamName(func, 0);
- if (paramName != null) {
- func.getParamMV().put(paramName, new Boolean(true));
- }
- }
}
}
}
@@ -739,7 +726,11 @@ public class MPIMVAnalysis {
return;
}
visitor(funcE.getFunctionNameExpression(), false, false);
- visitor(funcE.getParameterExpression(), inDeref, inAddr);
+ for (IASTInitializerClause argument: funcE.getArguments()) {
+ if (argument instanceof IASTExpression) {
+ visitor((IASTExpression) argument, inDeref, inAddr);
+ }
+ }
} else if (expr instanceof IASTIdExpression) {
IASTIdExpression ID = (IASTIdExpression) expr;
String var = ID.getName().toString();
diff --git a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPISingleAssignAnalysis.java b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPISingleAssignAnalysis.java
index 3f0aee2be..c30c68cb3 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPISingleAssignAnalysis.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/MPISingleAssignAnalysis.java
@@ -419,13 +419,18 @@ public class MPISingleAssignAnalysis {
if (signature.equals("malloc") || signature.equals("calloc") || //$NON-NLS-1$ //$NON-NLS-2$
signature.equals("realloc")) //$NON-NLS-1$
return true;
- IASTExpression paramE = funcE.getParameterExpression();
- if (paramE == null)
+ IASTInitializerClause[] arguments = funcE.getArguments();
+ if (arguments.length == 0)
return false;
- if (paramE instanceof IASTExpressionList)
- v1 = saExpr(paramE, side, funcE, -1, d1, u1, lr1, rr1);
- else
- v1 = saExpr(paramE, side, funcE, 0, d1, u1, lr1, rr1);
+ for (int i = 0; i < arguments.length; i++) {
+ if (arguments[i] instanceof IASTExpression) {
+ v1 = v1 | saExpr((IASTExpression)arguments[i], side, funcE, i, d1, u1, lr1, rr1);
+ Util.addAll(def, d1);
+ Util.addAll(use, u1);
+ Util.addAll(ldf, lr1);
+ Util.addAll(rdf, rr1);
+ }
+ }
/* update assignment number of global var */
MPICallGraphNode node = (MPICallGraphNode) cg_.getNode(currentNode_.getFileName(), signature);
if (node != null) {
@@ -564,20 +569,15 @@ public class MPISingleAssignAnalysis {
* Library function calls. Any parameter whose address
* is taken (pointer or array) is both defined and used.
*/
- IASTExpression parameterE = fE.getParameterExpression();
- if (parameterE instanceof IASTExpressionList) {
- IASTExpressionList paramEList = (IASTExpressionList) parameterE;
- IASTExpression param = (paramEList.getExpressions())[index];
- IType type = param.getExpressionType();
- if (type instanceof IArrayType ||
- type instanceof IPointerType)
- return 2;
- }
- else {
- IType type = parameterE.getExpressionType();
- if (type instanceof IArrayType ||
- type instanceof IPointerType)
- return 2;
+ IASTInitializerClause[] arguments = fE.getArguments();
+ if (arguments.length > index) {
+ IASTInitializerClause argument = arguments[index];
+ if (argument instanceof IASTExpression) {
+ IType type = ((IASTExpression)argument).getExpressionType();
+ if (type instanceof IArrayType ||
+ type instanceof IPointerType)
+ return 2;
+ }
}
}
return 0;
diff --git a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/UseDefBuilder.java b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/UseDefBuilder.java
index 94373c1e2..5a80d8b56 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/UseDefBuilder.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.mpi.analysis/src/org/eclipse/ptp/pldt/mpi/analysis/analysis/UseDefBuilder.java
@@ -295,13 +295,12 @@ public class UseDefBuilder extends ASTVisitor {
def_ = Util.Union(def_, n.getGlobalDef());
use_ = Util.Union(use_, n.getGlobalUse());
}
- IASTExpression paramE = funcE.getParameterExpression();
- if (paramE == null)
- return;
- if (paramE instanceof IASTExpressionList)
- useDefSet(funcE.getParameterExpression(), side, funcE, -1);
- else
- useDefSet(funcE.getParameterExpression(), side, funcE, 0);
+ IASTInitializerClause[] arguments = funcE.getArguments();
+ for (int i = 0; i < arguments.length; i++) {
+ if (arguments[i] instanceof IASTExpression) {
+ useDefSet((IASTExpression)arguments[i], side, funcall, i);
+ }
+ }
}
else if (expr instanceof IASTIdExpression) {
IASTIdExpression id = (IASTIdExpression) expr;
@@ -416,20 +415,15 @@ public class UseDefBuilder extends ASTVisitor {
* Library function calls. Any parameter whose address
* is taken (pointer or array) is both defined and used.
*/
- IASTExpression parameterE = fE.getParameterExpression();
- if (parameterE instanceof IASTExpressionList) {
- IASTExpressionList paramEList = (IASTExpressionList) parameterE;
- IASTExpression param = (paramEList.getExpressions())[index];
- IType type = param.getExpressionType();
- if (type instanceof IArrayType ||
- type instanceof IPointerType)
- return true;
- }
- else {
- IType type = parameterE.getExpressionType();
- if (type instanceof IArrayType ||
- type instanceof IPointerType)
- return true;
+ IASTInitializerClause[] arguments = fE.getArguments();
+ if (arguments.length > index) {
+ IASTInitializerClause argument = arguments[index];
+ if (argument instanceof IASTExpression) {
+ IType type = ((IASTExpression)argument).getExpressionType();
+ if (type instanceof IArrayType ||
+ type instanceof IPointerType)
+ return true;
+ }
}
}
return false;
diff --git a/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTFunctionMacro.java b/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTFunctionMacro.java
index 34af97cf3..b7fedab84 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTFunctionMacro.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTFunctionMacro.java
@@ -60,16 +60,6 @@ public class PASTFunctionMacro extends PASTNode implements IASTPreprocessorFunct
return macro_.getName();
}
- @SuppressWarnings("deprecation")
- public void setExpansion(String exp) {
- macro_.setExpansion(exp);
- }
-
- @SuppressWarnings("deprecation")
- public void setName(IASTName name) {
- macro_.setName(name);
- }
-
public void addParameter(IASTFunctionStyleMacroParameter parm) {
macro_.addParameter(parm);
}
diff --git a/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTObjectMacro.java b/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTObjectMacro.java
index cdb71e1a6..aad82ce9b 100644
--- a/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTObjectMacro.java
+++ b/tools/pldt/org.eclipse.ptp.pldt.openmp.analysis/src/org/eclipse/ptp/pldt/openmp/analysis/PAST/PASTObjectMacro.java
@@ -64,16 +64,6 @@ public class PASTObjectMacro extends PASTNode implements IASTPreprocessorObjectS
return objMacro_.getName();
}
- @Deprecated
- public void setExpansion(String exp) {
- objMacro_.setExpansion(exp);
- }
-
- @Deprecated
- public void setName(IASTName name) {
- objMacro_.setName(name);
- }
-
public IASTFileLocation getExpansionLocation() {
return objMacro_.getExpansionLocation();
}

Back to the top