mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
566e4fdca9
commit
cc5074d0bc
22 changed files with 78 additions and 75 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;
|
||||||
|
|
||||||
|
@ -74,7 +74,8 @@ public class ASTInternal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IASTNode getDeclaredInSourceFileOnly(IIndexFragment forFragment, IBinding binding, boolean requireDefinition, PDOMBinding nonLocal) {
|
public static IASTNode getDeclaredInSourceFileOnly(IIndexFragment forFragment, IBinding binding,
|
||||||
|
boolean requireDefinition, PDOMBinding glob) {
|
||||||
IASTNode[] decls;
|
IASTNode[] decls;
|
||||||
IASTNode def;
|
IASTNode def;
|
||||||
if (binding instanceof ICPPInternalBinding) {
|
if (binding instanceof ICPPInternalBinding) {
|
||||||
|
@ -110,9 +111,9 @@ public class ASTInternal {
|
||||||
if (result == null)
|
if (result == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (requireDefinition && nonLocal != null) {
|
if (requireDefinition && glob != null) {
|
||||||
try {
|
try {
|
||||||
if (nonLocal.hasDeclaration())
|
if (glob.hasDeclaration())
|
||||||
return null;
|
return null;
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public class CPPBuiltinParameter extends PlatformObject implements ICPPParameter
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IType type= null;
|
private IType type;
|
||||||
|
|
||||||
public CPPBuiltinParameter(IType type) {
|
public CPPBuiltinParameter(IType type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
|
@ -31,8 +31,8 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* Binding for a c++ function parameter
|
* Binding for a c++ function parameter
|
||||||
*/
|
*/
|
||||||
public class CPPLambdaExpressionParameter extends PlatformObject implements ICPPParameter {
|
public class CPPLambdaExpressionParameter extends PlatformObject implements ICPPParameter {
|
||||||
private IType fType = null;
|
private IType fType;
|
||||||
private IASTName fDeclaration = null;
|
private IASTName fDeclaration;
|
||||||
|
|
||||||
public CPPLambdaExpressionParameter(IASTName name) {
|
public CPPLambdaExpressionParameter(IASTName name) {
|
||||||
fDeclaration = name;
|
fDeclaration = name;
|
||||||
|
@ -77,14 +77,17 @@ public class CPPLambdaExpressionParameter extends PlatformObject implements ICPP
|
||||||
public boolean isStatic() {
|
public boolean isStatic() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getQualifiedName() {
|
public String[] getQualifiedName() {
|
||||||
return new String[] { getName() };
|
return new String[] { getName() };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char[][] getQualifiedNameCharArray() {
|
public char[][] getQualifiedNameCharArray() {
|
||||||
return new char[][] { getNameCharArray() };
|
return new char[][] { getNameCharArray() };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isGloballyQualified() {
|
public boolean isGloballyQualified() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -15,12 +15,10 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caches instances per template, the template definitions need to implement this interface
|
* Caches instances per template, the template definitions need to implement this interface
|
||||||
*/
|
*/
|
||||||
public interface ICPPInstanceCache {
|
public interface ICPPInstanceCache {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to cache an instance with this template
|
* Attempts to cache an instance with this template
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
@ -18,7 +17,6 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
* Interface for ast-internal implementations of function bindings.
|
* Interface for ast-internal implementations of function bindings.
|
||||||
*/
|
*/
|
||||||
public interface ICPPInternalFunction extends ICPPInternalBinding {
|
public interface ICPPInternalFunction extends ICPPInternalBinding {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to resolve the parameter in the second phase.
|
* Called to resolve the parameter in the second phase.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,14 +6,13 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for templates from the ast.
|
* Interface for templates from the ast.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -534,8 +534,9 @@ public class CPPTemplates {
|
||||||
|
|
||||||
ICPPASTTemplateDeclaration templateDeclaration = templates[0];
|
ICPPASTTemplateDeclaration templateDeclaration = templates[0];
|
||||||
IASTDeclaration decl = templateDeclaration.getDeclaration();
|
IASTDeclaration decl = templateDeclaration.getDeclaration();
|
||||||
while (decl instanceof ICPPASTTemplateDeclaration)
|
while (decl instanceof ICPPASTTemplateDeclaration) {
|
||||||
decl = ((ICPPASTTemplateDeclaration) decl).getDeclaration();
|
decl = ((ICPPASTTemplateDeclaration) decl).getDeclaration();
|
||||||
|
}
|
||||||
|
|
||||||
IASTName name = null;
|
IASTName name = null;
|
||||||
if (decl instanceof IASTSimpleDeclaration) {
|
if (decl instanceof IASTSimpleDeclaration) {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
|
@ -26,20 +26,20 @@ abstract class CompositeCPPBinding extends CompositeIndexBinding implements ICPP
|
||||||
@Override
|
@Override
|
||||||
public String[] getQualifiedName() {
|
public String[] getQualifiedName() {
|
||||||
try {
|
try {
|
||||||
return ((ICPPBinding)rbinding).getQualifiedName();
|
return ((ICPPBinding) rbinding).getQualifiedName();
|
||||||
} catch(DOMException de) {
|
} catch (DOMException e) {
|
||||||
CCorePlugin.log(de);
|
CCorePlugin.log(e);
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char[][] getQualifiedNameCharArray() throws DOMException {
|
public char[][] getQualifiedNameCharArray() throws DOMException {
|
||||||
return ((ICPPBinding)rbinding).getQualifiedNameCharArray();
|
return ((ICPPBinding) rbinding).getQualifiedNameCharArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
return ((ICPPBinding)rbinding).isGloballyQualified();
|
return ((ICPPBinding) rbinding).isGloballyQualified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
|
|
|
@ -297,16 +297,17 @@ abstract public class PDOMWriter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
th= e;
|
th= e;
|
||||||
} catch (StackOverflowError e) {
|
} catch (StackOverflowError e) {
|
||||||
th= e;
|
th= e;
|
||||||
} catch (AssertionError e) {
|
} catch (AssertionError e) {
|
||||||
th= e;
|
th= e;
|
||||||
} finally {
|
} finally {
|
||||||
// Because the caller holds a read-lock, the result cache of the index is never cleared.
|
// Because the caller holds a read-lock, the result cache of the index is never
|
||||||
// ==> Before releasing the lock for the last time in this ast, we clear the result cache.
|
// cleared. Before releasing the lock for the last time in this AST, we clear
|
||||||
if (i == data.fSelectedFiles.length-1) {
|
// the result cache.
|
||||||
|
if (i == data.fSelectedFiles.length - 1) {
|
||||||
data.fIndex.clearResultCache();
|
data.fIndex.clearResultCache();
|
||||||
}
|
}
|
||||||
lock.release();
|
lock.release();
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class FindBinding {
|
||||||
public PDOMBinding getResult() {
|
public PDOMBinding getResult() {
|
||||||
return fResult;
|
return fResult;
|
||||||
}
|
}
|
||||||
// IPDOMVisitor
|
|
||||||
@Override
|
@Override
|
||||||
public boolean visit(IPDOMNode node) throws CoreException {
|
public boolean visit(IPDOMNode node) throws CoreException {
|
||||||
if (node instanceof PDOMBinding) {
|
if (node instanceof PDOMBinding) {
|
||||||
|
@ -127,7 +127,7 @@ public class FindBinding {
|
||||||
}
|
}
|
||||||
return false; /* do not visit children of node */
|
return false; /* do not visit children of node */
|
||||||
}
|
}
|
||||||
// IPDOMVisitor
|
|
||||||
@Override
|
@Override
|
||||||
public void leave(IPDOMNode node) throws CoreException {
|
public void leave(IPDOMNode node) throws CoreException {
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.pdom.dom;
|
package org.eclipse.cdt.internal.core.pdom.dom;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Bryan Wilkinson
|
* @author Bryan Wilkinson
|
||||||
*/
|
*/
|
||||||
public interface IPDOMOverloader {
|
public interface IPDOMOverloader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the signature hash for this PDOM element, which will be unique
|
* @return the signature hash for this PDOM element, which will be unique
|
||||||
* for all sibling IPDOMOverloaders with the same name.
|
* for all sibling IPDOMOverloaders with the same name.
|
||||||
|
|
|
@ -211,7 +211,7 @@ public final class PDOMName implements IIndexFragmentName, IASTFileLocation {
|
||||||
try {
|
try {
|
||||||
Database db = linkage.getDB();
|
Database db = linkage.getDB();
|
||||||
long bindingRec = db.getRecPtr(record + BINDING_REC_OFFSET);
|
long bindingRec = db.getRecPtr(record + BINDING_REC_OFFSET);
|
||||||
PDOMBinding binding = linkage.getBinding(bindingRec);
|
IPDOMBinding binding = linkage.getBinding(bindingRec);
|
||||||
return binding != null ? binding.getNameCharArray() : null;
|
return binding != null ? binding.getNameCharArray() : null;
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
|
|
|
@ -80,27 +80,28 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof IFunction) {
|
if (!(newBinding instanceof IFunction))
|
||||||
IFunction func= (IFunction) newBinding;
|
return;
|
||||||
IFunctionType newType;
|
|
||||||
IParameter[] newParams;
|
IFunction func= (IFunction) newBinding;
|
||||||
byte newAnnotation;
|
IFunctionType newType;
|
||||||
newType= func.getType();
|
IParameter[] newParams;
|
||||||
newParams = func.getParameters();
|
byte newAnnotation;
|
||||||
newAnnotation = PDOMCAnnotation.encodeAnnotation(func);
|
newType= func.getType();
|
||||||
|
newParams = func.getParameters();
|
||||||
setType(linkage, newType);
|
newAnnotation = PDOMCAnnotation.encodeAnnotation(func);
|
||||||
PDOMCParameter oldParams= getFirstParameter(null);
|
|
||||||
setParameters(newParams);
|
setType(linkage, newType);
|
||||||
if (oldParams != null) {
|
PDOMCParameter oldParams= getFirstParameter(null);
|
||||||
oldParams.delete(linkage);
|
setParameters(newParams);
|
||||||
}
|
if (oldParams != null) {
|
||||||
getDB().putByte(record + ANNOTATIONS, newAnnotation);
|
oldParams.delete(linkage);
|
||||||
}
|
}
|
||||||
|
getDB().putByte(record + ANNOTATIONS, newAnnotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setType(PDOMLinkage linkage, IFunctionType ft) throws CoreException {
|
private void setType(PDOMLinkage linkage, IFunctionType ft) throws CoreException {
|
||||||
linkage.storeType(record+FUNCTION_TYPE, ft);
|
linkage.storeType(record + FUNCTION_TYPE, ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setParameters(IParameter[] params) throws CoreException {
|
private void setParameters(IParameter[] params) throws CoreException {
|
||||||
|
@ -109,7 +110,7 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
|
||||||
db.putInt(record + NUM_PARAMS, params.length);
|
db.putInt(record + NUM_PARAMS, params.length);
|
||||||
db.putRecPtr(record + FIRST_PARAM, 0);
|
db.putRecPtr(record + FIRST_PARAM, 0);
|
||||||
PDOMCParameter next= null;
|
PDOMCParameter next= null;
|
||||||
for (int i= params.length-1; i >= 0; --i) {
|
for (int i= params.length; --i >= 0;) {
|
||||||
next= new PDOMCParameter(linkage, this, params[i], next);
|
next= new PDOMCParameter(linkage, this, params[i], next);
|
||||||
}
|
}
|
||||||
db.putRecPtr(record + FIRST_PARAM, next == null ? 0 : next.getRecord());
|
db.putRecPtr(record + FIRST_PARAM, next == null ? 0 : next.getRecord());
|
||||||
|
@ -134,8 +135,8 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
|
||||||
public IFunctionType getType() {
|
public IFunctionType getType() {
|
||||||
try {
|
try {
|
||||||
return (IFunctionType) getLinkage().loadType(record + FUNCTION_TYPE);
|
return (IFunctionType) getLinkage().loadType(record + FUNCTION_TYPE);
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(e);
|
||||||
return new ProblemFunctionType(ISemanticProblem.TYPE_NOT_PERSISTED);
|
return new ProblemFunctionType(ISemanticProblem.TYPE_NOT_PERSISTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,7 +164,7 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
|
||||||
|
|
||||||
long next = db.getRecPtr(record + FIRST_PARAM);
|
long next = db.getRecPtr(record + FIRST_PARAM);
|
||||||
for (int i = 0; i < n && next != 0; i++) {
|
for (int i = 0; i < n && next != 0; i++) {
|
||||||
IType type= i<ptypes.length ? ptypes[i] : null;
|
IType type= i < ptypes.length ? ptypes[i] : null;
|
||||||
final PDOMCParameter par = new PDOMCParameter(linkage, next, type);
|
final PDOMCParameter par = new PDOMCParameter(linkage, next, type);
|
||||||
next= par.getNextPtr();
|
next= par.getNextPtr();
|
||||||
result[i]= par;
|
result[i]= par;
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil;
|
import org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
import org.eclipse.cdt.internal.core.pdom.db.BTree;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.FindBinding;
|
import org.eclipse.cdt.internal.core.pdom.dom.FindBinding;
|
||||||
|
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMBinding;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMOverloader;
|
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMOverloader;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
|
||||||
|
@ -34,12 +35,13 @@ public class CPPFindBinding extends FindBinding {
|
||||||
public CPPBindingBTreeComparator(PDOMLinkage linkage) {
|
public CPPBindingBTreeComparator(PDOMLinkage linkage) {
|
||||||
super(linkage);
|
super(linkage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(long record1, long record2) throws CoreException {
|
public int compare(long record1, long record2) throws CoreException {
|
||||||
int cmp = super.compare(record1, record2);
|
int cmp = super.compare(record1, record2);
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
PDOMBinding binding1 = linkage.getBinding(record1);
|
IPDOMBinding binding1 = linkage.getBinding(record1);
|
||||||
PDOMBinding binding2 = linkage.getBinding(record2);
|
IPDOMBinding binding2 = linkage.getBinding(record2);
|
||||||
if (binding1 instanceof IPDOMOverloader && binding2 instanceof IPDOMOverloader) {
|
if (binding1 instanceof IPDOMOverloader && binding2 instanceof IPDOMOverloader) {
|
||||||
int ty1 = ((IPDOMOverloader) binding1).getSignatureHash();
|
int ty1 = ((IPDOMOverloader) binding1).getSignatureHash();
|
||||||
int ty2 = ((IPDOMOverloader) binding2).getSignatureHash();
|
int ty2 = ((IPDOMOverloader) binding2).getSignatureHash();
|
||||||
|
@ -66,7 +68,7 @@ public class CPPFindBinding extends FindBinding {
|
||||||
int c1 = PDOMNode.getNodeType(fLinkage.getDB(), record);
|
int c1 = PDOMNode.getNodeType(fLinkage.getDB(), record);
|
||||||
int c2= fConstant;
|
int c2= fConstant;
|
||||||
if (c1 == c2) {
|
if (c1 == c2) {
|
||||||
PDOMBinding binding = fLinkage.getBinding(record);
|
IPDOMBinding binding = fLinkage.getBinding(record);
|
||||||
if (binding instanceof IPDOMOverloader) {
|
if (binding instanceof IPDOMOverloader) {
|
||||||
c1 = ((IPDOMOverloader) binding).getSignatureHash();
|
c1 = ((IPDOMOverloader) binding).getSignatureHash();
|
||||||
c2= fSigHash;
|
c2= fSigHash;
|
||||||
|
|
|
@ -46,7 +46,7 @@ public abstract class PDOMCPPBinding extends PDOMBinding implements ICPPBinding
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean isGloballyQualified() throws DOMException {
|
public final boolean isGloballyQualified() throws DOMException {
|
||||||
// local stuff is not stored in the index.
|
// Local stuff is not stored in the index.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bryan Wilkinson (QNX) - Initial API and implementation
|
* Bryan Wilkinson (QNX) - Initial API and implementation
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
@ -64,8 +64,9 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
super(linkage, parent, template);
|
super(linkage, parent, template);
|
||||||
|
|
||||||
final Database db = getDB();
|
final Database db = getDB();
|
||||||
final ICPPTemplateParameter[] origParams= template.getTemplateParameters();
|
ICPPTemplateParameter[] origParams= template.getTemplateParameters();
|
||||||
final IPDOMCPPTemplateParameter[] params = PDOMTemplateParameterArray.createPDOMTemplateParameters(linkage, this, origParams);
|
IPDOMCPPTemplateParameter[] params =
|
||||||
|
PDOMTemplateParameterArray.createPDOMTemplateParameters(linkage, this, origParams);
|
||||||
long rec= PDOMTemplateParameterArray.putArray(db, params);
|
long rec= PDOMTemplateParameterArray.putArray(db, params);
|
||||||
db.putRecPtr(record + PARAMETERS, rec);
|
db.putRecPtr(record + PARAMETERS, rec);
|
||||||
db.putShort(record + RELEVANT_PARAMETERS, (short) params.length);
|
db.putShort(record + RELEVANT_PARAMETERS, (short) params.length);
|
||||||
|
@ -247,8 +248,9 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
// exclude other kinds of class templates
|
// exclude other kinds of class templates
|
||||||
if (type instanceof ICPPClassTemplatePartialSpecialization ||
|
if (type instanceof ICPPClassTemplatePartialSpecialization ||
|
||||||
type instanceof ICPPTemplateTemplateParameter ||
|
type instanceof ICPPTemplateTemplateParameter ||
|
||||||
type instanceof ICPPClassSpecialization)
|
type instanceof ICPPClassSpecialization) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ICPPClassType ctype= (ICPPClassType) type;
|
ICPPClassType ctype= (ICPPClassType) type;
|
||||||
if (ctype.getKey() != getKey())
|
if (ctype.getKey() != getKey())
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bryan Wilkinson (QNX) - Initial API and implementation
|
* Bryan Wilkinson (QNX) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
class PDOMCPPFunctionTemplate extends PDOMCPPFunction
|
class PDOMCPPFunctionTemplate extends PDOMCPPFunction
|
||||||
implements ICPPFunctionTemplate, ICPPInstanceCache, IPDOMMemberOwner, IPDOMCPPTemplateParameterOwner {
|
implements ICPPFunctionTemplate, ICPPInstanceCache, IPDOMMemberOwner, IPDOMCPPTemplateParameterOwner {
|
||||||
|
|
||||||
private static final int TEMPLATE_PARAMS = PDOMCPPFunction.RECORD_SIZE;
|
private static final int TEMPLATE_PARAMS = PDOMCPPFunction.RECORD_SIZE;
|
||||||
|
|
||||||
@SuppressWarnings("hiding")
|
@SuppressWarnings("hiding")
|
||||||
|
|
|
@ -56,7 +56,7 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IPDOMBind
|
||||||
public PDOMCPPParameter(PDOMLinkage linkage, PDOMNode parent, ICPPParameter param, PDOMCPPParameter next)
|
public PDOMCPPParameter(PDOMLinkage linkage, PDOMNode parent, ICPPParameter param, PDOMCPPParameter next)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
super(linkage, parent, param.getNameCharArray());
|
super(linkage, parent, param.getNameCharArray());
|
||||||
fType= null; // this constructor is used for adding parameters to the database, only.
|
fType= null; // This constructor is used for adding parameters to the database, only.
|
||||||
|
|
||||||
Database db = getDB();
|
Database db = getDB();
|
||||||
db.putByte(record + FLAGS, param.hasDefaultValue() ? FLAG_DEFAULT_VALUE : 0);
|
db.putByte(record + FLAGS, param.hasDefaultValue() ? FLAG_DEFAULT_VALUE : 0);
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bryan Wilkinson (QNX) - Initial API and implementation
|
* Bryan Wilkinson (QNX) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
class PDOMCPPTemplateTypeParameter extends PDOMCPPBinding implements IPDOMMemberOwner,
|
class PDOMCPPTemplateTypeParameter extends PDOMCPPBinding implements IPDOMMemberOwner,
|
||||||
ICPPTemplateTypeParameter, ICPPUnknownBinding, ICPPUnknownType, IIndexType,
|
ICPPTemplateTypeParameter, ICPPUnknownBinding, ICPPUnknownType, IIndexType,
|
||||||
IPDOMCPPTemplateParameter {
|
IPDOMCPPTemplateParameter {
|
||||||
|
|
||||||
private static final int PACK_BIT = 1 << 31;
|
private static final int PACK_BIT = 1 << 31;
|
||||||
|
|
||||||
private static final int DEFAULT_TYPE = PDOMCPPBinding.RECORD_SIZE;
|
private static final int DEFAULT_TYPE = PDOMCPPBinding.RECORD_SIZE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue