Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-04-10 12:27:51 +0000
committerMarkus Schorn2008-04-10 12:27:51 +0000
commitbac604f82e54690bb0b3aadb0c6ab9185b9f1cf8 (patch)
tree9894f604e1fb8566fa1bb1b54896ccd0b0dba53b /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parent3c104b3f4c70dbd30b6129567fe3e17ade0b0b9c (diff)
downloadorg.eclipse.cdt-bac604f82e54690bb0b3aadb0c6ab9185b9f1cf8.tar.gz
org.eclipse.cdt-bac604f82e54690bb0b3aadb0c6ab9185b9f1cf8.tar.xz
org.eclipse.cdt-bac604f82e54690bb0b3aadb0c6ab9185b9f1cf8.zip
Differentiating typeid-nodes from typeof-nodes.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java28
1 files changed, 10 insertions, 18 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
index a94d431d54f..b0638bbb40d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
@@ -568,24 +568,16 @@ public class ExpressionWriter extends NodeWriter{
}
private String getTypeIdExp(IASTTypeIdExpression typeIdExp) {
- int type = typeIdExp.getOperator();
- if (type <= IASTTypeIdExpression.op_last) {
- if(type == IASTTypeIdExpression.op_sizeof) {
- return SIZEOF_OP + "("; //$NON-NLS-1$
- }
- }else {
- if (typeIdExp instanceof ICPPASTTypeIdExpression) {
- if(type == ICPPASTTypeIdExpression.op_typeid) {
- return TYPEID_OP;
- }
- }else if (typeIdExp instanceof IGNUASTTypeIdExpression) {
- switch (type) {//TODO HSR Emanuel: check if there can't be GNUTypeIdExpressions here, see #162470
- case IGNUASTTypeIdExpression.op_alignof:
- return ALIGNOF_OP + "("; //$NON-NLS-1$
- case IGNUASTTypeIdExpression.op_typeof:
- return TYPEOF_OP;
- }
- }
+ final int type = typeIdExp.getOperator();
+ switch(type) {
+ case IASTTypeIdExpression.op_sizeof:
+ return SIZEOF_OP + "("; //$NON-NLS-1$
+ case ICPPASTTypeIdExpression.op_typeid:
+ return TYPEID_OP;
+ case IGNUASTTypeIdExpression.op_alignof:
+ return ALIGNOF_OP + "("; //$NON-NLS-1$
+ case IGNUASTTypeIdExpression.op_typeof:
+ return TYPEOF_OP;
}
throw new IllegalArgumentException("Unknown TypeId Type"); //$NON-NLS-1$
}

Back to the top