mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Code streamlining.
This commit is contained in:
parent
7020c95a8b
commit
ad308251da
2 changed files with 4 additions and 20 deletions
|
@ -48,7 +48,6 @@ import org.eclipse.cdt.core.dom.ast.IFunction;
|
|||
import org.eclipse.cdt.core.dom.ast.INodeFactory;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||
import org.eclipse.cdt.core.dom.rewrite.DeclarationGenerator;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
@ -56,6 +55,7 @@ import org.eclipse.cdt.core.index.IIndexFile;
|
|||
import org.eclipse.cdt.core.index.IIndexName;
|
||||
import org.eclipse.cdt.core.model.CoreModelUtil;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
/**
|
||||
|
@ -82,7 +82,7 @@ public final class CxxAstUtils {
|
|||
|
||||
@Override
|
||||
public int visit(IASTExpression expression) {
|
||||
if(expression instanceof IASTFieldReference) {
|
||||
if (expression instanceof IASTFieldReference) {
|
||||
this.name = ((IASTFieldReference) expression).getFieldName();
|
||||
return PROCESS_ABORT;
|
||||
}
|
||||
|
@ -95,23 +95,7 @@ public final class CxxAstUtils {
|
|||
}
|
||||
|
||||
public static IType unwindTypedef(IType type) {
|
||||
if (!(type instanceof IBinding))
|
||||
return type;
|
||||
IBinding typeName = (IBinding) type;
|
||||
// unwind typedef chain
|
||||
try {
|
||||
while (typeName instanceof ITypedef) {
|
||||
IType t = ((ITypedef) typeName).getType();
|
||||
if (t instanceof IBinding) {
|
||||
typeName = (IBinding) t;
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) { // in CDT 6.0 getType throws DOMException
|
||||
Activator.log(e);
|
||||
}
|
||||
return (IType) typeName;
|
||||
return SemanticUtil.getNestedType(type, SemanticUtil.TDEF);
|
||||
}
|
||||
|
||||
public static boolean isInMacro(IASTNode node) {
|
||||
|
|
|
@ -58,7 +58,7 @@ Export-Package: org.eclipse.cdt.core,
|
|||
org.eclipse.cdt.internal.core.dom.parser;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.codan.checkers",
|
||||
org.eclipse.cdt.internal.core.dom.parser.c;x-friends:="org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.internal.core.dom.parser.cpp;x-friends:="org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;x-friends:="org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.codan.core.cxx",
|
||||
org.eclipse.cdt.internal.core.dom.rewrite;x-friends:="org.eclipse.cdt.core.tests,org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.internal.core.dom.rewrite.astwriter;x-friends:="org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;x-internal:=true,
|
||||
|
|
Loading…
Add table
Reference in a new issue