mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fix for 100598: DOM Indexer encodes weird things when indexing a CPP file in a C project. Fixed correlation between parser's parser language and indexer visitor.
This commit is contained in:
parent
229dce01a0
commit
b66ffc6cd2
3 changed files with 16 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-06-21 Vladimir Hirsl
|
||||||
|
Fix for 100598: DOM Indexer encodes weird things when indexing a CPP file in a C project
|
||||||
|
Fixed correlation between parser's parser language and indexer visitor.
|
||||||
|
|
||||||
|
* index/org/eclipse/cdt/internal/core/index/domsourceindexer/CGenerateIndexVisitor.java
|
||||||
|
* index/org/eclipse/cdt/internal/core/index/domsourceindexer/DOMSoureIndexerRunner.java
|
||||||
|
|
||||||
2005-06-20 Vladimir Hirsl
|
2005-06-20 Vladimir Hirsl
|
||||||
Completed optimization #2 in PR 91801: [Indexer] Optimize header file visiting/indexing
|
Completed optimization #2 in PR 91801: [Indexer] Optimize header file visiting/indexing
|
||||||
Encountered headers are removed before instead of after indexing the whole project, thus
|
Encountered headers are removed before instead of after indexing the whole project, thus
|
||||||
|
|
|
@ -185,10 +185,13 @@ public class CGenerateIndexVisitor extends CASTVisitor {
|
||||||
if (entryKind != IIndex.REFERENCE) {
|
if (entryKind != IIndex.REFERENCE) {
|
||||||
modifiers = IndexVisitorUtil.getModifiers(name, binding);
|
modifiers = IndexVisitorUtil.getModifiers(name, binding);
|
||||||
}
|
}
|
||||||
TypeEntry indexEntry = new TypeEntry(iEntryType, entryKind, qualifiedName, modifiers, fileNumber);
|
// guard against cpp entities in c project
|
||||||
indexEntry.setNameOffset(fileLoc.getNodeOffset(), fileLoc.getNodeLength(), IIndex.OFFSET);
|
if (iEntryType != 0) {
|
||||||
|
TypeEntry indexEntry = new TypeEntry(iEntryType, entryKind, qualifiedName, modifiers, fileNumber);
|
||||||
|
indexEntry.setNameOffset(fileLoc.getNodeOffset(), fileLoc.getNodeLength(), IIndex.OFFSET);
|
||||||
|
|
||||||
indexEntry.serialize(indexer.getOutput());
|
indexEntry.serialize(indexer.getOutput());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (binding instanceof IEnumeration){
|
else if (binding instanceof IEnumeration){
|
||||||
int modifiers = 0;
|
int modifiers = 0;
|
||||||
|
|
|
@ -105,9 +105,6 @@ public class DOMSourceIndexerRunner extends AbstractIndexerRunner {
|
||||||
// Add the name of the file to the index
|
// Add the name of the file to the index
|
||||||
output.addIndexedFile(file.getFullPath().toString());
|
output.addIndexedFile(file.getFullPath().toString());
|
||||||
|
|
||||||
//C or CPP?
|
|
||||||
ParserLanguage language = CoreModel.hasCCNature(resourceFile.getProject()) ?
|
|
||||||
ParserLanguage.CPP : ParserLanguage.C;
|
|
||||||
IASTTranslationUnit tu = null;
|
IASTTranslationUnit tu = null;
|
||||||
long startTime = 0, parseTime = 0, endTime = 0;
|
long startTime = 0, parseTime = 0, endTime = 0;
|
||||||
String error = null;
|
String error = null;
|
||||||
|
@ -122,7 +119,8 @@ public class DOMSourceIndexerRunner extends AbstractIndexerRunner {
|
||||||
parseTime = System.currentTimeMillis();
|
parseTime = System.currentTimeMillis();
|
||||||
|
|
||||||
ASTVisitor visitor = null;
|
ASTVisitor visitor = null;
|
||||||
if (language == ParserLanguage.CPP) {
|
//C or CPP?
|
||||||
|
if (tu.getParserLanguage() == ParserLanguage.CPP) {
|
||||||
visitor = new CPPGenerateIndexVisitor(this);
|
visitor = new CPPGenerateIndexVisitor(this);
|
||||||
} else {
|
} else {
|
||||||
visitor = new CGenerateIndexVisitor(this);
|
visitor = new CGenerateIndexVisitor(this);
|
||||||
|
|
Loading…
Add table
Reference in a new issue