From 1214623cf9b2c11cb9596977ec4c5d4fa15d6a3b Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 26 Apr 2007 10:11:53 +0000 Subject: [PATCH] Fix CCE --- .../eclipse/cdt/internal/core/model/ASTCache.java | 6 +----- .../internal/core/parser/scanner2/LocationMap.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java index f50e9b9b7b1..22f23372052 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java @@ -411,11 +411,7 @@ public class ASTCache { if (ast == null) return "null"; //$NON-NLS-1$ - IASTNode[] nodes= ast.getDeclarations(); - if (nodes != null && nodes.length > 0) - return nodes[0].getRawSignature(); - else - return "AST without any declaration"; //$NON-NLS-1$ + return ast.getFilePath(); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java index 76e41acce70..205c478a7c5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java @@ -1719,11 +1719,11 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog { * @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getIncludeDirectives() */ public IASTPreprocessorIncludeStatement[] getIncludeDirectives() { - int size = collectContexts(V_INCLUSIONS, tu, null, 0); + int size = collectContexts(V_INCLUDE_DIRECTIVES, tu, null, 0); if (size == 0) return EMPTY_INCLUDES_ARRAY; _Context[] contexts = new _Context[size]; - collectContexts(V_INCLUSIONS, tu, contexts, 0); + collectContexts(V_INCLUDE_DIRECTIVES, tu, contexts, 0); IASTPreprocessorIncludeStatement[] result = new IASTPreprocessorIncludeStatement[size]; for (int i = 0; i < size; ++i) result[i] = (IASTPreprocessorIncludeStatement)createPreprocessorStatement(contexts[i]); @@ -2482,6 +2482,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog { protected static final int V_MACRODEFSUNDEFS = 6; + protected static final int V_INCLUDE_DIRECTIVES = 7; + private static final char[] EMPTY_CHAR_ARRAY = "".toCharArray(); //$NON-NLS-1$ private static final IASTName[] EMPTY_NAME_ARRAY = new IASTName[0]; @@ -2503,6 +2505,13 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog { ++count; break; case V_INCLUSIONS: + if (source instanceof _Inclusion) { + if (result != null) + result[startAt++] = source; + ++count; + } + break; + case V_INCLUDE_DIRECTIVES: if (source instanceof _IPreprocessorIncludeDirective) { if (result != null) result[startAt++] = source;