From 9c3e30e9a08cfd0c0e2a2d99c53fe3165f66eeac Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Tue, 7 Nov 2006 12:46:44 +0000 Subject: [PATCH] Testcase and fix for 159566 and 159570, additional info for IIndexInclude. --- .../index/tests/IndexIncludeTest.java | 41 ++++++++++++++++ .../internal/index/tests/IndexTestBase.java | 5 ++ .../cdt/core/testplugin/TestScannerInfo.java | 8 ++- .../core/testplugin/TestScannerProvider.java | 4 +- .../eclipse/cdt/core/index/IIndexInclude.java | 21 ++++++++ .../internal/core/index/IWritableIndex.java | 3 +- .../core/index/IWritableIndexFragment.java | 3 +- .../internal/core/index/WritableCIndex.java | 6 ++- .../eclipse/cdt/internal/core/pdom/PDOM.java | 2 +- .../cdt/internal/core/pdom/WritablePDOM.java | 6 ++- .../cdt/internal/core/pdom/db/Chunk.java | 9 ++++ .../cdt/internal/core/pdom/db/Database.java | 11 +++++ .../cdt/internal/core/pdom/dom/PDOMFile.java | 19 ++++--- .../internal/core/pdom/dom/PDOMInclude.java | 49 ++++++++++++++++++- .../pdom/indexer/fast/PDOMFastIndexerJob.java | 2 +- .../pdom/indexer/full/PDOMFullIndexerJob.java | 2 +- .../BasicCppCallHierarchyTest.java | 2 +- 17 files changed, 170 insertions(+), 23 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java index 870d81a528d..878a952d02f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java @@ -21,9 +21,11 @@ import org.eclipse.cdt.core.dom.IPDOMManager; import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexFile; +import org.eclipse.cdt.core.index.IIndexInclude; import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.testplugin.CProjectHelper; +import org.eclipse.cdt.core.testplugin.TestScannerProvider; import org.eclipse.cdt.core.testplugin.util.TestSourceReader; import org.eclipse.cdt.internal.core.CCoreInternals; import org.eclipse.core.resources.IFile; @@ -135,4 +137,43 @@ public class IndexIncludeTest extends IndexTestBase { } } + // {source20061107} + // #include "user20061107.h" + // #include + + public void testIncludeProperties() throws Exception { + waitForIndexer(); + TestScannerProvider.sIncludes= new String[]{fProject.getProject().getLocation().toOSString()}; + try { + String content= readTaggedComment("source20061107"); + TestSourceReader.createFile(fProject.getProject(), "user20061107.h", ""); + TestSourceReader.createFile(fProject.getProject(), "system20061107.h", ""); + IFile file= TestSourceReader.createFile(fProject.getProject(), "source20061107.cpp", content); + TestSourceReader.waitUntilFileIsIndexed(fIndex, file, 4000); + + fIndex.acquireReadLock(); + try { + IIndexFile ifile= fIndex.getFile(file.getLocation()); + assertNotNull(ifile); + IIndexInclude[] includes= ifile.getIncludes(); + assertEquals(2, includes.length); + + checkInclude(includes[0], content, "user20061107.h", false); + checkInclude(includes[1], content, "system20061107.h", true); + } + finally { + fIndex.releaseReadLock(); + } + } + finally { + TestScannerProvider.sIncludes= null; + } + } + + private void checkInclude(IIndexInclude include, String content, String includeName, boolean isSystem) throws CoreException { + int offset= content.indexOf(includeName); + assertEquals(offset, include.getNameOffset()); + assertEquals(includeName.length(), include.getNameLength()); + assertEquals(isSystem, include.isSystemInclude()); + } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java index d6020bcab0b..be9f79208f3 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java @@ -17,6 +17,7 @@ import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.testplugin.CProjectHelper; import org.eclipse.cdt.core.testplugin.CTestPlugin; import org.eclipse.cdt.core.testplugin.util.BaseTestCase; +import org.eclipse.cdt.core.testplugin.util.TestSourceReader; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; @@ -51,4 +52,8 @@ public class IndexTestBase extends BaseTestCase { assertTrue(CCorePlugin.getIndexManager().joinIndexer(10000, new NullProgressMonitor())); return result[0]; } + + protected String readTaggedComment(String tag) throws Exception { + return TestSourceReader.readTaggedComment(CTestPlugin.getDefault().getBundle(), "parser", getClass(), tag); + } } diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerInfo.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerInfo.java index 7de929e97b0..2b4c2cab11b 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerInfo.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerInfo.java @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.testplugin; @@ -17,13 +18,16 @@ import org.eclipse.cdt.core.parser.IScannerInfo; public class TestScannerInfo implements IScannerInfo { private Map emptyMap = new HashMap(0); + private String[] fIncludes; + public TestScannerInfo(String[] includes) { + fIncludes= includes; + } public Map getDefinedSymbols() { return emptyMap; } public String[] getIncludePaths() { - return new String[0]; + return fIncludes == null ? new String[0] : fIncludes; } - } diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerProvider.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerProvider.java index a49b45dc8ce..da6c43db9b7 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerProvider.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerProvider.java @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.testplugin; @@ -18,10 +19,11 @@ import org.eclipse.core.resources.IResource; public class TestScannerProvider extends AbstractCExtension implements IScannerInfoProvider { + public static String[] sIncludes= null; public final static String SCANNER_ID = CTestPlugin.PLUGIN_ID + ".TestScanner"; public IScannerInfo getScannerInformation(IResource resource) { - return new TestScannerInfo(); + return new TestScannerInfo(sIncludes); } public void subscribe(IResource resource, IScannerInfoChangeListener listener) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexInclude.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexInclude.java index 6b1381c5fca..c00bd8fb451 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexInclude.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexInclude.java @@ -50,4 +50,25 @@ public interface IIndexInclude { * @throws CoreException */ String getIncludesLocation() throws CoreException; + + /** + * Returns the character offset of the name of the include in its source file. The name does + * not include the enclosing quotes or angle brackets. + * @throws CoreException + */ + int getNameOffset() throws CoreException; + + /** + * Returns the length of the name of the include. The name does + * not include the enclosing quotes or angle brackets. + * @throws CoreException + */ + int getNameLength() throws CoreException; + + /** + * Returns whether this is a system include (an include specified within angle + * brackets). + * @throws CoreException + */ + boolean isSystemInclude() throws CoreException; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java index f83757f0dda..c233f8ea785 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.core.index; import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; import org.eclipse.cdt.core.index.IIndex; import org.eclipse.core.runtime.CoreException; @@ -42,7 +43,7 @@ public interface IWritableIndex extends IIndex { /** * Adds an include to the given file. */ - void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile) throws CoreException; + void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile, IASTPreprocessorIncludeStatement directive) throws CoreException; /** * Clears the entire index. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexFragment.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexFragment.java index b2681ce0d24..eabcdb07fec 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexFragment.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexFragment.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.core.index; import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; import org.eclipse.core.runtime.CoreException; @@ -38,7 +39,7 @@ public interface IWritableIndexFragment extends IIndexFragment { /** * Adds an include to the given file. */ - void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile) throws CoreException; + void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile, IASTPreprocessorIncludeStatement include) throws CoreException; /** * Adds a AST macro to the given file. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/WritableCIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/WritableCIndex.java index 009842681c3..127c1307a9b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/WritableCIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/WritableCIndex.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.core.index; import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; @@ -44,12 +45,13 @@ public class WritableCIndex extends CIndex implements IWritableIndex { return fWritableFragments[0]; } - public void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile) throws CoreException { + public void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile, + IASTPreprocessorIncludeStatement include) throws CoreException { IIndexFragment indexFragment = sourceFile.getIndexFragment(); assert isWritableFragment(indexFragment); assert isWritableFragment(destFile.getIndexFragment()); - ((IWritableIndexFragment) indexFragment).addInclude(sourceFile, destFile); + ((IWritableIndexFragment) indexFragment).addInclude(sourceFile, destFile, include); } private boolean isWritableFragment(IIndexFragment frag) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index f2ef46304d0..f0aa230bb81 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -64,7 +64,7 @@ public class PDOM extends PlatformObject implements IIndexFragment, IPDOM { private Database db; - public static final int VERSION = 14; + public static final int VERSION = 15; // 0 - the beginning of it all // 1 - first change to kick off upgrades // 2 - added file inclusions diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java index afe6a6e6ce8..21184d1d749 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java @@ -15,6 +15,7 @@ import java.text.MessageFormat; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; import org.eclipse.cdt.internal.core.index.IIndexFragmentFile; import org.eclipse.cdt.internal.core.index.IWritableIndexFragment; @@ -32,10 +33,11 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { return super.addFile(filename); } - public void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile) throws CoreException { + public void addInclude(IIndexFragmentFile sourceFile, IIndexFragmentFile destFile, + IASTPreprocessorIncludeStatement include) throws CoreException { assert sourceFile.getIndexFragment() == this; assert destFile.getIndexFragment() == this; - ((PDOMFile) sourceFile).addIncludeTo((PDOMFile) destFile); + ((PDOMFile) sourceFile).addIncludeTo((PDOMFile) destFile, include); } public void addMacro(IIndexFragmentFile sourceFile, IASTPreprocessorMacroDefinition macro) throws CoreException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Chunk.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Chunk.java index ab8dc118b62..994be08d621 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Chunk.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Chunk.java @@ -7,6 +7,7 @@ * * Contributors: * QNX - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.db; @@ -66,6 +67,14 @@ public class Chunk { return buffer.getInt(offset % Database.CHUNK_SIZE); } + public void putShort(int offset, short value) { + buffer.putShort(offset % Database.CHUNK_SIZE, value); + } + + public short getShort(int offset) { + return buffer.getShort(offset % Database.CHUNK_SIZE); + } + public long getLong(int offset) { return buffer.getLong(offset % Database.CHUNK_SIZE); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java index 82910d9c1c7..25979c566eb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java @@ -8,6 +8,7 @@ * Contributors: * QNX - Initial API and implementation * Symbian - Add some non-javadoc implementation notes + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.db; @@ -271,6 +272,16 @@ public class Database { return chunk.getInt(offset); } + public void putShort(int offset, short value) throws CoreException { + Chunk chunk = getChunk(offset); + chunk.putShort(offset, value); + } + + public short getShort(int offset) throws CoreException { + Chunk chunk = getChunk(offset); + return chunk.getShort(offset); + } + public void putLong(int offset, long value) throws CoreException { Chunk chunk= getChunk(offset); chunk.putLong(offset, value); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java index d366b36e554..dfd3f889c9e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java @@ -12,8 +12,10 @@ package org.eclipse.cdt.internal.core.pdom.dom; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; import org.eclipse.cdt.core.index.IIndexInclude; import org.eclipse.cdt.core.index.IIndexMacro; @@ -234,19 +236,19 @@ public class PDOMFile implements IIndexFragmentFile { setFirstName(null); } - public PDOMInclude addIncludeTo(PDOMFile file) throws CoreException { - PDOMInclude include = new PDOMInclude(pdom); - include.setIncludedBy(this); - include.setIncludes(file); + public PDOMInclude addIncludeTo(PDOMFile file, IASTPreprocessorIncludeStatement include) throws CoreException { + PDOMInclude pdomInclude = new PDOMInclude(pdom, include); + pdomInclude.setIncludedBy(this); + pdomInclude.setIncludes(file); PDOMInclude firstInclude = getFirstInclude(); if (firstInclude != null) { - include.setNextInIncludes(firstInclude); + pdomInclude.setNextInIncludes(firstInclude); } - setFirstInclude(include); + setFirstInclude(pdomInclude); - file.addIncludedBy(include); - return include; + file.addIncludedBy(pdomInclude); + return pdomInclude; } public void addIncludedBy(PDOMInclude include) throws CoreException { @@ -267,6 +269,7 @@ public class PDOMFile implements IIndexFragmentFile { result.add(include); include = include.getNextInIncludes(); } + Collections.reverse(result); return (IIndexInclude[]) result.toArray(new IIndexInclude[result.size()]); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMInclude.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMInclude.java index 56950e96c28..e41da9eb2e6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMInclude.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMInclude.java @@ -12,6 +12,9 @@ package org.eclipse.cdt.internal.core.pdom.dom; +import org.eclipse.cdt.core.dom.ast.IASTFileLocation; +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement; import org.eclipse.cdt.core.index.IIndexFile; import org.eclipse.cdt.internal.core.index.IIndexFragment; import org.eclipse.cdt.internal.core.index.IIndexFragmentFile; @@ -33,19 +36,36 @@ public class PDOMInclude implements IIndexFragmentInclude { private final int INCLUDES_NEXT = 8; private final int INCLUDED_BY_NEXT = 12; private final int INCLUDED_BY_PREV = 16; + private static final int NODE_OFFSET_OFFSET = 20; + private static final int NODE_LENGTH_OFFSET = 24; + private static final int FLAG_OFFSET = 26; + + private static final int FLAG_SYSTEM_INCLUDE = 1; - private final int RECORD_SIZE = 20; + private final int RECORD_SIZE = 27; public PDOMInclude(PDOM pdom, int record) { this.pdom = pdom; this.record = record; } - public PDOMInclude(PDOM pdom) throws CoreException { + public PDOMInclude(PDOM pdom, IASTPreprocessorIncludeStatement include) throws CoreException { this.pdom = pdom; this.record = pdom.getDB().malloc(RECORD_SIZE); + IASTName name= include.getName(); + IASTFileLocation loc= name.getFileLocation(); + setNameOffsetAndLength(loc.getNodeOffset(), (short) loc.getNodeLength()); + setFlag(encodeFlags(include)); } + private byte encodeFlags(IASTPreprocessorIncludeStatement include) { + byte flags= 0; + if (include.isSystemInclude()) { + flags |= FLAG_SYSTEM_INCLUDE; + } + return flags; + } + public int getRecord() { return record; } @@ -127,4 +147,29 @@ public class PDOMInclude implements IIndexFragmentInclude { public IIndexFragment getFragment() { return pdom; } + + private void setNameOffsetAndLength(int offset, short length) throws CoreException { + pdom.getDB().putInt(record + NODE_OFFSET_OFFSET, offset); + pdom.getDB().putShort(record + NODE_LENGTH_OFFSET, length); + } + + private void setFlag(byte flag) throws CoreException { + pdom.getDB().putByte(record + FLAG_OFFSET, flag); + } + + private int getFlag() throws CoreException { + return pdom.getDB().getByte(record + FLAG_OFFSET); + } + + public boolean isSystemInclude() throws CoreException { + return (getFlag() & FLAG_SYSTEM_INCLUDE) != 0; + } + + public int getNameOffset() throws CoreException { + return pdom.getDB().getInt(record + NODE_OFFSET_OFFSET); + } + + public int getNameLength() throws CoreException { + return pdom.getDB().getShort(record + NODE_LENGTH_OFFSET) & 0xffff; + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java index bb58577c103..8aa44a292bf 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java @@ -212,7 +212,7 @@ abstract class PDOMFastIndexerJob extends PDOMIndexerTask implements IPDOMIndexe for (int i = 0; i < list.size(); i++) { IASTPreprocessorIncludeStatement include= (IASTPreprocessorIncludeStatement) list.get(i); IIndexFragmentFile destFile= createIndexFile(include.getPath()); - index.addInclude(file, destFile); + index.addInclude(file, destFile, include); } // macros diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/full/PDOMFullIndexerJob.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/full/PDOMFullIndexerJob.java index 50ef71c496b..26842bbe953 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/full/PDOMFullIndexerJob.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/full/PDOMFullIndexerJob.java @@ -253,7 +253,7 @@ abstract class PDOMFullIndexerJob extends PDOMIndexerTask implements IPDOMIndexe for (int i = 0; i < list.size(); i++) { IASTPreprocessorIncludeStatement include= (IASTPreprocessorIncludeStatement) list.get(i); IIndexFragmentFile destFile= index.addFile(new Path(include.getPath())); - index.addInclude(file, destFile); + index.addInclude(file, destFile, include); } // macros diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/BasicCppCallHierarchyTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/BasicCppCallHierarchyTest.java index d19e4d4da9a..d3b8f175789 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/BasicCppCallHierarchyTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/BasicCppCallHierarchyTest.java @@ -24,7 +24,7 @@ import org.eclipse.cdt.internal.ui.editor.CEditor; public class BasicCppCallHierarchyTest extends CallHierarchyBaseTest { - private static final int MAX_TIME_INDEXER = 2000; + private static final int MAX_TIME_INDEXER = 8000; public BasicCppCallHierarchyTest(String name) { super(name);