From 04042aeeb9acf45270e8cdee39fa0d3b5bae7838 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sat, 29 Nov 2014 16:27:49 -0800 Subject: [PATCH] Bug 450888. Fixed inconsistent handling of significant macros. --- .../eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java index 744cfc83e62..f4c9e6efba9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java @@ -1248,7 +1248,9 @@ public abstract class AbstractIndexerTask extends PDOMWriter { ArrayList orderedFileKeys= new ArrayList<>(); final IIndexFileLocation topIfl = fResolver.resolveASTPath(ast.getFilePath()); - FileContentKey topKey = new FileContentKey(linkageID, topIfl, ast.getSignificantMacros()); + ISignificantMacros significantMacros = ast.isHeaderUnit() ? + ast.getSignificantMacros() : ISignificantMacros.NONE; + FileContentKey topKey = new FileContentKey(linkageID, topIfl, significantMacros); enteredFiles.add(topKey); IDependencyTree tree= ast.getDependencyTree(); IASTInclusionNode[] inclusions= tree.getInclusions(); @@ -1256,7 +1258,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter { collectOrderedFileKeys(linkageID, inclusion, enteredFiles, orderedFileKeys); } - IIndexFragmentFile newFile= selectIndexFile(linkageID, topIfl, ast.getSignificantMacros()); + IIndexFragmentFile newFile= selectIndexFile(linkageID, topIfl, significantMacros); if (ctx != null) { orderedFileKeys.add(new FileInAST(topKey, codeReader)); // File can be reused