mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Cosmetics.
This commit is contained in:
parent
8dc598a145
commit
3bb26e3de2
3 changed files with 14 additions and 20 deletions
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser;
|
package org.eclipse.cdt.internal.core.dom.parser;
|
||||||
|
|
||||||
|
@ -159,7 +159,8 @@ public abstract class VariableReadWriteFlags {
|
||||||
return READ | WRITE; // fall back
|
return READ | WRITE; // fall back
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int rwArgumentForFunctionCall(final IASTFunctionCallExpression funcCall, IASTNode argument, int indirection) {
|
protected int rwArgumentForFunctionCall(final IASTFunctionCallExpression funcCall,
|
||||||
|
IASTNode argument, int indirection) {
|
||||||
final IASTInitializerClause[] args = funcCall.getArguments();
|
final IASTInitializerClause[] args = funcCall.getArguments();
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (int i = 0; i < args.length; i++) {
|
||||||
if (args[i] == argument) {
|
if (args[i] == argument) {
|
||||||
|
@ -192,13 +193,11 @@ public abstract class VariableReadWriteFlags {
|
||||||
if (node.getPropertyInParent() == IASTCaseStatement.EXPRESSION) {
|
if (node.getPropertyInParent() == IASTCaseStatement.EXPRESSION) {
|
||||||
return READ;
|
return READ;
|
||||||
}
|
}
|
||||||
}
|
} else if (stmt instanceof IASTDoStatement) {
|
||||||
else if (stmt instanceof IASTDoStatement) {
|
|
||||||
if (node.getPropertyInParent() == IASTDoStatement.CONDITION) {
|
if (node.getPropertyInParent() == IASTDoStatement.CONDITION) {
|
||||||
return READ;
|
return READ;
|
||||||
}
|
}
|
||||||
}
|
} else if (stmt instanceof IASTExpressionStatement) {
|
||||||
else if (stmt instanceof IASTExpressionStatement) {
|
|
||||||
IASTNode parent= stmt.getParent();
|
IASTNode parent= stmt.getParent();
|
||||||
while (parent instanceof IASTCompoundStatement) {
|
while (parent instanceof IASTCompoundStatement) {
|
||||||
IASTCompoundStatement compound= (IASTCompoundStatement) parent;
|
IASTCompoundStatement compound= (IASTCompoundStatement) parent;
|
||||||
|
@ -220,24 +219,19 @@ public abstract class VariableReadWriteFlags {
|
||||||
if (node.getPropertyInParent() == ICPPASTRangeBasedForStatement.INITIALIZER) {
|
if (node.getPropertyInParent() == ICPPASTRangeBasedForStatement.INITIALIZER) {
|
||||||
return READ;
|
return READ;
|
||||||
}
|
}
|
||||||
}
|
} else if (stmt instanceof IASTIfStatement) {
|
||||||
else if (stmt instanceof IASTIfStatement) {
|
|
||||||
if (node.getPropertyInParent() == IASTIfStatement.CONDITION) {
|
if (node.getPropertyInParent() == IASTIfStatement.CONDITION) {
|
||||||
return READ;
|
return READ;
|
||||||
}
|
}
|
||||||
}
|
} else if (stmt instanceof IASTProblemStatement) {
|
||||||
else if (stmt instanceof IASTProblemStatement) {
|
|
||||||
return READ | WRITE;
|
return READ | WRITE;
|
||||||
}
|
} else if (stmt instanceof IASTReturnStatement) {
|
||||||
else if (stmt instanceof IASTReturnStatement) {
|
|
||||||
return indirection == 0 ? READ : WRITE;
|
return indirection == 0 ? READ : WRITE;
|
||||||
}
|
} else if (stmt instanceof IASTSwitchStatement) {
|
||||||
else if (stmt instanceof IASTSwitchStatement) {
|
|
||||||
if (node.getPropertyInParent() == IASTSwitchStatement.CONTROLLER_EXP) {
|
if (node.getPropertyInParent() == IASTSwitchStatement.CONTROLLER_EXP) {
|
||||||
return READ;
|
return READ;
|
||||||
}
|
}
|
||||||
}
|
} else if (stmt instanceof IASTWhileStatement) {
|
||||||
else if (stmt instanceof IASTWhileStatement) {
|
|
||||||
if (node.getPropertyInParent() == IASTWhileStatement.CONDITIONEXPRESSION) {
|
if (node.getPropertyInParent() == IASTWhileStatement.CONDITIONEXPRESSION) {
|
||||||
return READ;
|
return READ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.c;
|
package org.eclipse.cdt.internal.core.dom.parser.c;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
* Patrick Hofer - [Bug 328528]
|
* Patrick Hofer - [Bug 328528]
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public final class CPPVariableReadWriteFlags extends VariableReadWriteFlags {
|
||||||
}
|
}
|
||||||
type= ((ICPPReferenceType) type).getType();
|
type= ((ICPPReferenceType) type).getType();
|
||||||
}
|
}
|
||||||
while(indirection > 0 && (type instanceof ITypeContainer)) {
|
while (indirection > 0 && (type instanceof ITypeContainer)) {
|
||||||
if (type instanceof IPointerType) {
|
if (type instanceof IPointerType) {
|
||||||
indirection--;
|
indirection--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue