mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
Fixed spelling of reverseConstantPropagationLookup (245053).
This commit is contained in:
parent
e9629b194e
commit
b4981a7e62
4 changed files with 60 additions and 58 deletions
|
@ -189,7 +189,7 @@ public class CPPTemplates {
|
|||
*/
|
||||
private static IBinding instantiateSelectedTemplate(ICPPTemplateDefinition template, IType[] arguments)
|
||||
throws DOMException {
|
||||
Assert.isTrue(template instanceof ICPPClassTemplatePartialSpecialization == false);
|
||||
Assert.isTrue(!(template instanceof ICPPClassTemplatePartialSpecialization));
|
||||
|
||||
ICPPTemplateParameter[] parameters= template.getTemplateParameters();
|
||||
if (parameters == null || parameters.length == 0)
|
||||
|
@ -262,7 +262,7 @@ public class CPPTemplates {
|
|||
// we do not correctly distinguish between type and non-type parameters, this works
|
||||
// around getting the wrong instance when providing a value rather than a type.
|
||||
if (instance != null) {
|
||||
if (argsContainDependentType || instance instanceof ICPPDeferredClassInstance == false)
|
||||
if (argsContainDependentType || !(instance instanceof ICPPDeferredClassInstance))
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -1007,8 +1007,8 @@ public class CPPTemplates {
|
|||
parent = parent.getParent();
|
||||
}
|
||||
if (parent instanceof IASTDeclSpecifier) {
|
||||
if (parent instanceof IASTCompositeTypeSpecifier == false
|
||||
&& parent instanceof IASTElaboratedTypeSpecifier == false) {
|
||||
if (!(parent instanceof IASTCompositeTypeSpecifier) &&
|
||||
!(parent instanceof IASTElaboratedTypeSpecifier)) {
|
||||
return null;
|
||||
}
|
||||
parent = parent.getParent();
|
||||
|
@ -1017,7 +1017,7 @@ public class CPPTemplates {
|
|||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
if (parent instanceof IASTDeclaration == false) {
|
||||
if (!(parent instanceof IASTDeclaration)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1282,7 +1282,7 @@ public class CPPTemplates {
|
|||
* will include its value)
|
||||
*/
|
||||
if (param instanceof IASTIdExpression) {
|
||||
param= CPPVisitor.reverseConstantPropogationLookup((IASTIdExpression)param);
|
||||
param= CPPVisitor.reverseConstantPropagationLookup((IASTIdExpression)param);
|
||||
}
|
||||
|
||||
IType type= CPPVisitor.createType(param);
|
||||
|
@ -1523,8 +1523,8 @@ public class CPPTemplates {
|
|||
if (e1 == null)
|
||||
return true;
|
||||
|
||||
e1= CPPVisitor.reverseConstantPropogationLookup(e1);
|
||||
e2= CPPVisitor.reverseConstantPropogationLookup(e2);
|
||||
e1= CPPVisitor.reverseConstantPropagationLookup(e1);
|
||||
e2= CPPVisitor.reverseConstantPropagationLookup(e2);
|
||||
|
||||
if (e1 instanceof IASTLiteralExpression && e2 instanceof IASTLiteralExpression) {
|
||||
IType t1= e1.getExpressionType();
|
||||
|
@ -1887,7 +1887,8 @@ public class CPPTemplates {
|
|||
return !(argument instanceof IProblemBinding);
|
||||
}
|
||||
|
||||
static protected boolean matchTemplateParameterAndArgument(ICPPTemplateParameter param, IType argument, ObjectMap map) {
|
||||
static protected boolean matchTemplateParameterAndArgument(ICPPTemplateParameter param, IType argument,
|
||||
ObjectMap map) {
|
||||
if (!isValidArgument(param, argument)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1897,7 +1898,8 @@ public class CPPTemplates {
|
|||
if (!(argument instanceof ICPPTemplateDefinition))
|
||||
return false;
|
||||
|
||||
ICPPTemplateParameter[] pParams = null, aParams = null;
|
||||
ICPPTemplateParameter[] pParams = null;
|
||||
ICPPTemplateParameter[] aParams = null;
|
||||
try {
|
||||
pParams = ((ICPPTemplateTemplateParameter) param).getTemplateParameters();
|
||||
aParams = ((ICPPTemplateDefinition) argument).getTemplateParameters();
|
||||
|
|
|
@ -567,7 +567,7 @@ public class CPPVisitor {
|
|||
if (parent instanceof IASTStandardFunctionDeclarator) {
|
||||
IASTStandardFunctionDeclarator fdtor = (IASTStandardFunctionDeclarator) param.getParent();
|
||||
// if the fdtor does not declare a function we don't create a binding for the parameter.
|
||||
if (findOutermostDeclarator(fdtor).getParent() instanceof IASTDeclaration == false ||
|
||||
if (!(findOutermostDeclarator(fdtor).getParent() instanceof IASTDeclaration) ||
|
||||
findTypeRelevantDeclarator(fdtor) != fdtor)
|
||||
return null;
|
||||
IBinding temp = findInnermostDeclarator(fdtor).getName().resolveBinding();
|
||||
|
@ -2166,7 +2166,6 @@ public class CPPVisitor {
|
|||
public static IASTProblem[] getProblems(IASTTranslationUnit tu) {
|
||||
CollectProblemsAction action = new CollectProblemsAction();
|
||||
tu.accept(action);
|
||||
|
||||
return action.getProblems();
|
||||
}
|
||||
|
||||
|
@ -2344,7 +2343,8 @@ public class CPPVisitor {
|
|||
return BigInteger.ZERO;
|
||||
}
|
||||
|
||||
int start=0, end= integral.length();
|
||||
int start=0;
|
||||
int end= integral.length();
|
||||
|
||||
boolean negate= integral.charAt(start) == '-';
|
||||
if (negate || integral.charAt(start) == '+') {
|
||||
|
@ -2379,7 +2379,7 @@ public class CPPVisitor {
|
|||
* @param e1
|
||||
* @return the first non id-expression by following values assigned to basic types.
|
||||
*/
|
||||
public static final IASTExpression reverseConstantPropogationLookup(IASTExpression e1) {
|
||||
public static final IASTExpression reverseConstantPropagationLookup(IASTExpression e1) {
|
||||
try {
|
||||
for(int i= 0; e1 instanceof IASTIdExpression && i < 8; i++) {
|
||||
IBinding b1= ((IASTIdExpression)e1).getName().resolveBinding();
|
||||
|
@ -2436,9 +2436,9 @@ public class CPPVisitor {
|
|||
public static IASTDeclarator findTypeRelevantDeclarator(IASTDeclarator declarator) {
|
||||
IASTDeclarator result= findInnermostDeclarator(declarator);
|
||||
while (result.getPointerOperators().length == 0
|
||||
&& result instanceof IASTFieldDeclarator == false
|
||||
&& result instanceof IASTFunctionDeclarator == false
|
||||
&& result instanceof IASTArrayModifier == false) {
|
||||
&& !(result instanceof IASTFieldDeclarator)
|
||||
&& !(result instanceof IASTFunctionDeclarator)
|
||||
&& !(result instanceof IASTArrayModifier)) {
|
||||
final IASTNode parent= result.getParent();
|
||||
if (parent instanceof IASTDeclarator) {
|
||||
result= (IASTDeclarator) parent;
|
||||
|
@ -2453,7 +2453,7 @@ public class CPPVisitor {
|
|||
* Searches for the function enclosing the given node. May return <code>null</code>.
|
||||
*/
|
||||
public static IBinding findEnclosingFunction(IASTNode node) {
|
||||
while(node != null && node instanceof IASTFunctionDefinition == false) {
|
||||
while (node != null && !(node instanceof IASTFunctionDefinition)) {
|
||||
node= node.getParent();
|
||||
}
|
||||
if (node == null)
|
||||
|
@ -2490,7 +2490,7 @@ public class CPPVisitor {
|
|||
*/
|
||||
public static IBinding findDeclarationOwner(IASTNode node, boolean allowFunction) {
|
||||
// search for declaration
|
||||
while (node instanceof IASTDeclaration == false) {
|
||||
while (!(node instanceof IASTDeclaration)) {
|
||||
if (node == null)
|
||||
return null;
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ public class IndexCPPSignatureUtil {
|
|||
}
|
||||
|
||||
private static String getValueString(IASTExpression e) {
|
||||
e= CPPVisitor.reverseConstantPropogationLookup(e);
|
||||
e= CPPVisitor.reverseConstantPropagationLookup(e);
|
||||
if (e instanceof IASTLiteralExpression) {
|
||||
IType t1= e.getExpressionType();
|
||||
try {
|
||||
|
|
|
@ -65,7 +65,7 @@ class PDOMCPPBasicType extends PDOMNode implements ICPPBasicType, IIndexType {
|
|||
db.putShort(record + TYPE_ID, getTypeCode(type));
|
||||
try {
|
||||
if(type.getValue() != null) {
|
||||
IASTExpression e= CPPVisitor.reverseConstantPropogationLookup(type.getValue());
|
||||
IASTExpression e= CPPVisitor.reverseConstantPropagationLookup(type.getValue());
|
||||
if(e != null) {
|
||||
db.putInt(record + INTEGRAL, CPPVisitor.parseIntegral(e.toString()).intValue());
|
||||
db.putByte(record + INTERNAL_FLAGS, (byte)1);
|
||||
|
|
Loading…
Add table
Reference in a new issue