mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Patch for Robert O'Callahan (robert@ocallahan.org)
Partial fix for 102602 pre-#included files aren't built by quick parser
This commit is contained in:
parent
87308501ad
commit
3ec82a67ca
2 changed files with 19 additions and 6 deletions
|
@ -20,6 +20,7 @@ import org.eclipse.cdt.core.model.ICElement;
|
|||
import org.eclipse.cdt.core.model.IParent;
|
||||
import org.eclipse.cdt.core.model.IProblemRequestor;
|
||||
import org.eclipse.cdt.core.parser.CodeReader;
|
||||
import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
|
||||
import org.eclipse.cdt.core.parser.IParser;
|
||||
import org.eclipse.cdt.core.parser.IProblem;
|
||||
import org.eclipse.cdt.core.parser.IQuickParseCallback;
|
||||
|
@ -31,7 +32,6 @@ import org.eclipse.cdt.core.parser.ParserFactoryError;
|
|||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||
import org.eclipse.cdt.core.parser.ParserMode;
|
||||
import org.eclipse.cdt.core.parser.ParserUtil;
|
||||
import org.eclipse.cdt.core.parser.ScannerInfo;
|
||||
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
|
||||
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
|
||||
import org.eclipse.cdt.core.parser.ast.ASTUtil;
|
||||
|
@ -142,7 +142,7 @@ public class CModelBuilder {
|
|||
// create the parser
|
||||
IParser parser = null;
|
||||
try {
|
||||
IScannerInfo scanInfo = new ScannerInfo();
|
||||
IScannerInfo scanInfo = null;
|
||||
IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(currentProject);
|
||||
if (provider != null){
|
||||
IScannerInfo buildScanInfo = null;
|
||||
|
@ -156,9 +156,12 @@ public class CModelBuilder {
|
|||
buildScanInfo = provider.getScannerInformation(currentProject);
|
||||
}
|
||||
if (buildScanInfo != null){
|
||||
scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths());
|
||||
scanInfo = new ExtendedScannerInfo(buildScanInfo);
|
||||
}
|
||||
}
|
||||
if (scanInfo == null) {
|
||||
scanInfo = new ExtendedScannerInfo();
|
||||
}
|
||||
|
||||
CodeReader reader =
|
||||
translationUnit.getUnderlyingResource() != null
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.Map;
|
|||
public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScannerInfo {
|
||||
|
||||
private static final String [] EMPTY_STRING_ARRAY = new String[ 0 ];
|
||||
private String [] m, i;
|
||||
private String [] m, i, localIncludePaths;
|
||||
|
||||
public ExtendedScannerInfo()
|
||||
{
|
||||
|
@ -37,7 +37,16 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
|
|||
i = includes;
|
||||
}
|
||||
|
||||
|
||||
public ExtendedScannerInfo( IScannerInfo info )
|
||||
{
|
||||
super(info.getDefinedSymbols(), info.getIncludePaths());
|
||||
if (info instanceof IExtendedScannerInfo) {
|
||||
IExtendedScannerInfo einfo = (IExtendedScannerInfo)info;
|
||||
m = einfo.getMacroFiles();
|
||||
i = einfo.getIncludeFiles();
|
||||
localIncludePaths = einfo.getLocalIncludePath();
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.IExtendedScannerInfo#getMacroFiles()
|
||||
|
@ -59,6 +68,7 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
|
|||
* @see org.eclipse.cdt.core.parser.IExtendedScannerInfo#getLocalIncludePath()
|
||||
*/
|
||||
public String[] getLocalIncludePath() {
|
||||
return EMPTY_STRING_ARRAY; //TODO add impl
|
||||
if ( localIncludePaths == null ) return EMPTY_STRING_ARRAY;
|
||||
return localIncludePaths;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue