Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java
index e251b6e6657..f40ca27ce73 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java
@@ -119,6 +119,33 @@ public class CIndex implements IIndex {
}
}
+ public IIndexBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
+ if(SPECIALCASE_SINGLES && fFragments.length==1) {
+ return fFragments[0].findMacroContainers(pattern, filter, monitor);
+ } else {
+ List<IIndexBinding[]> result = new ArrayList<IIndexBinding[]>();
+ ILinkage[] linkages = Linkage.getAllLinkages();
+ for(int j=0; j < linkages.length; j++) {
+ if(filter.acceptLinkage(linkages[j])) {
+ IIndexFragmentBinding[][] fragmentBindings = new IIndexFragmentBinding[fPrimaryFragmentCount][];
+ for (int i = 0; i < fPrimaryFragmentCount; i++) {
+ try {
+ IBinding[] part = fFragments[i].findMacroContainers(pattern, retargetFilter(linkages[j], filter), monitor);
+ fragmentBindings[i] = new IIndexFragmentBinding[part.length];
+ System.arraycopy(part, 0, fragmentBindings[i], 0, part.length);
+ } catch (CoreException e) {
+ CCorePlugin.log(e);
+ fragmentBindings[i] = IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
+ }
+ }
+ ICompositesFactory factory = getCompositesFactory(linkages[j].getLinkageID());
+ result.add(factory.getCompositeBindings(fragmentBindings));
+ }
+ }
+ return flatten(result);
+ }
+ }
+
public IIndexName[] findNames(IBinding binding, int flags) throws CoreException {
LinkedList<IIndexFragmentName> result= new LinkedList<IIndexFragmentName>();
if (binding instanceof ICPPUsingDeclaration) {

Back to the top