mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
In parser log, report unresolved includes only once.
This commit is contained in:
parent
3ddfd62af8
commit
24820b7e12
1 changed files with 7 additions and 3 deletions
|
@ -252,15 +252,19 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
|||
private void outputUnresolvedIncludes(ICProject prj, IIndex index, PrintStream out, String indent,
|
||||
IASTPreprocessorIncludeStatement[] includeDirectives, int linkageID) throws CoreException {
|
||||
ASTFilePathResolver resolver= new ProjectIndexerInputAdapter(prj);
|
||||
HashSet<IIndexFileLocation> handled= new HashSet<IIndexFileLocation>();
|
||||
for (IASTPreprocessorIncludeStatement include : includeDirectives) {
|
||||
if (include.isActive() && include.isResolved()) {
|
||||
outputUnresolvedIncludes(index, out, indent, resolver.resolveASTPath(include.getPath()), linkageID);
|
||||
outputUnresolvedIncludes(index, out, indent, resolver.resolveASTPath(include.getPath()), linkageID, handled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void outputUnresolvedIncludes(IIndex index, PrintStream out, String indent,
|
||||
IIndexFileLocation ifl, int linkageID) throws CoreException {
|
||||
IIndexFileLocation ifl, int linkageID, HashSet<IIndexFileLocation> handled) throws CoreException {
|
||||
if (!handled.add(ifl)) {
|
||||
return;
|
||||
}
|
||||
IIndexFile ifile= index.getFile(linkageID, ifl);
|
||||
if (ifile == null) {
|
||||
out.println(indent + ifl.getURI() + " is not indexed"); //$NON-NLS-1$
|
||||
|
@ -270,7 +274,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
|||
for (IIndexInclude inc : includes) {
|
||||
if (inc.isActive()) {
|
||||
if (inc.isResolved()) {
|
||||
outputUnresolvedIncludes(index, out, indent, inc.getIncludesLocation(), linkageID);
|
||||
outputUnresolvedIncludes(index, out, indent, inc.getIncludesLocation(), linkageID, handled);
|
||||
}
|
||||
else {
|
||||
out.println(indent + "Unresolved inclusion: " + inc.getName() + " in file " + //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
|
Loading…
Add table
Reference in a new issue