mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Cosmetics.
This commit is contained in:
parent
73c1e5e224
commit
0460895b24
1 changed files with 4 additions and 11 deletions
|
@ -267,7 +267,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the best file for the given location, linkage, and translation unit.
|
* Returns the best file for the given location, linkage, and translation unit.
|
||||||
* May return <code>null</code>, if no such file exists.
|
* May return {@code null}, if no such file exists.
|
||||||
*
|
*
|
||||||
* The "best" file (variant) is the one with the most content, as measured
|
* The "best" file (variant) is the one with the most content, as measured
|
||||||
* by the total number of macros defined in the file. The rationale is that
|
* by the total number of macros defined in the file. The rationale is that
|
||||||
|
@ -280,7 +280,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
* @param linkageID the id of the linkage in which the file has been parsed.
|
* @param linkageID the id of the linkage in which the file has been parsed.
|
||||||
* @param location the IIndexFileLocation representing the location of the file
|
* @param location the IIndexFileLocation representing the location of the file
|
||||||
* @param tu the translation unit from which 'location' originates
|
* @param tu the translation unit from which 'location' originates
|
||||||
* @return the best file for the location, or <code>null</code> if the file is not
|
* @return the best file for the location, or {@code null} if the file is not
|
||||||
* present in the index
|
* present in the index
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
|
@ -304,7 +304,8 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
if (fPathResolver != null && node != null) {
|
if (fPathResolver != null && node != null) {
|
||||||
IASTFileLocation loc= node.getFileLocation();
|
IASTFileLocation loc= node.getFileLocation();
|
||||||
if (loc != null) {
|
if (loc != null) {
|
||||||
ISignificantMacros sigMacros= getSignificantMacros(node, loc);
|
IASTPreprocessorIncludeStatement owner= loc.getContextInclusionStatement();
|
||||||
|
ISignificantMacros sigMacros= owner != null ? owner.getSignificantMacros() : ISignificantMacros.NONE;
|
||||||
if (sigMacros != null) {
|
if (sigMacros != null) {
|
||||||
IIndexFileLocation location = fPathResolver.resolveASTPath(loc.getFileName());
|
IIndexFileLocation location = fPathResolver.resolveASTPath(loc.getFileName());
|
||||||
if (uncommittedKey != null && uncommittedKey.equals(new FileContentKey(linkageID, location, sigMacros)))
|
if (uncommittedKey != null && uncommittedKey.equals(new FileContentKey(linkageID, location, sigMacros)))
|
||||||
|
@ -316,14 +317,6 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ISignificantMacros getSignificantMacros(IASTNode node, IASTFileLocation loc) throws CoreException {
|
|
||||||
IASTPreprocessorIncludeStatement owner= loc.getContextInclusionStatement();
|
|
||||||
if (owner != null)
|
|
||||||
return owner.getSignificantMacros();
|
|
||||||
|
|
||||||
return ISignificantMacros.NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasLastingDefinition(PDOMBinding binding) throws CoreException {
|
public boolean hasLastingDefinition(PDOMBinding binding) throws CoreException {
|
||||||
if (fileBeingUpdated == null) {
|
if (fileBeingUpdated == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue