Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'xlc/org.eclipse.cdt.make.xlc.core')
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/activator/Activator.java12
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java17
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java320
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java58
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java20
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java16
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java29
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsRunSIProvider.java6
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/util/XLCCommandDSC.java4
9 files changed, 260 insertions, 222 deletions
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/activator/Activator.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/activator/Activator.java
index 7c510d2533..483cd5f155 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/activator/Activator.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/activator/Activator.java
@@ -25,7 +25,7 @@ public class Activator extends Plugin {
private static Activator fInstance;
/**
- *
+ *
*/
public Activator() {
super();
@@ -33,18 +33,18 @@ public class Activator extends Plugin {
fInstance = this;
}
}
-
+
public static void log(String e) {
log(createStatus(e));
}
-
+
public static void log(Throwable e) {
log("Error", e); //$NON-NLS-1$
}
-
+
public static void log(String message, Throwable e) {
Throwable nestedException;
- if (e instanceof CModelException
+ if (e instanceof CModelException
&& (nestedException = ((CModelException)e).getException()) != null) {
e = nestedException;
}
@@ -58,7 +58,7 @@ public class Activator extends Plugin {
public static IStatus createStatus(String msg, Throwable e) {
return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, msg, e);
}
-
+
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java
index 8bbacedb0c..115a69ded7 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/AbstractXLCBuildOutputParser.java
@@ -21,8 +21,8 @@ import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCProfileInstance;
-import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfile.BuildOutputProvider;
+import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
import org.eclipse.cdt.make.xlc.core.activator.Activator;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -33,7 +33,7 @@ import org.eclipse.core.runtime.content.IContentTypeManager;
/**
* @author crecoskie
- *
+ *
*/
public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsoleParser {
@@ -76,7 +76,7 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol
/**
* Returns array of additional compiler commands to look for
- *
+ *
* @return String[]
*/
protected String[] computeCompilerCommands() {
@@ -103,11 +103,12 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#processLine
* (java.lang.String)
*/
+ @Override
public boolean processLine(String line) {
boolean rc = false;
int lineBreakPos = line.length() - 1;
@@ -183,16 +184,17 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#shutdown
* ()
*/
+ @Override
public void shutdown() {
if (getUtility() != null) {
getUtility().reportProblems();
}
-
+
if(fCollector != null && fCollector instanceof IScannerInfoCollector2) {
IScannerInfoCollector2 collector = (IScannerInfoCollector2) fCollector;
try {
@@ -211,7 +213,7 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol
* back-quotes a backslash escapes white-spaces, all quotes, the backslash,
* '&' and '|'. A backslash used for escaping is removed. Quotes other than
* the back-quote plus '&&', '||', ';' are removed, also.
- *
+ *
* @param line
* to tokenize
* @return array of commands
@@ -365,6 +367,7 @@ public abstract class AbstractXLCBuildOutputParser implements IScannerInfoConsol
return -1;
}
+ @Override
public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector,
IMarkerGenerator markerGenerator) {
fProject = project;
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java
index 5a3d7bbd2c..01c6606993 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/PerFileXLCScannerInfoCollector.java
@@ -52,7 +52,6 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
-import org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector;
import org.eclipse.cdt.make.xlc.core.activator.Activator;
import org.eclipse.cdt.make.xlc.core.messages.Messages;
import org.eclipse.cdt.make.xlc.core.scannerconfig.util.XLCCommandDSC;
@@ -89,12 +88,12 @@ import org.w3c.dom.NodeList;
public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, IManagedScannerInfoCollector {
protected class ScannerConfigUpdateJob extends Job {
-
+
private InfoContext fContext;
private IDiscoveredPathInfo fPathInfo;
private boolean fIsDefaultContext;
private List<IResource> fChangedResources;
-
+
public ScannerConfigUpdateJob(InfoContext context, IDiscoveredPathInfo pathInfo, boolean isDefaultContext, List<IResource> changedResources) {
super(Messages.getString("PerFileXLCScannerInfoCollector.0")); //$NON-NLS-1$);
fContext = context;
@@ -106,24 +105,24 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
-
+
// get the scanner info profile ID
-
+
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration config = info.getDefaultConfiguration();
-
+
String profileID = config.getToolChain().getScannerConfigDiscoveryProfileId();
IDiscoveredPathManager manager = MakeCorePlugin.getDefault().getDiscoveryManager();
-
+
if(manager instanceof DiscoveredPathManager) {
((DiscoveredPathManager)manager).updateDiscoveredInfo(fContext, fPathInfo, fIsDefaultContext, fChangedResources, profileID);
}
-
+
// reload project description to hopefully get the data to take
ICProjectDescriptionManager descriptionManager = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription cProjectDescription = descriptionManager.getProjectDescription(project, true /* writable */);
ICConfigurationDescription configDes = cProjectDescription.getActiveConfiguration();
-
+
IToolChain toolchain = config.getToolChain();
for(ITool tool : toolchain.getTools()) {
for(IInputType inputType : tool.getInputTypes()) {
@@ -132,14 +131,14 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(IResource resource : fChangedResources) {
// get language settings for the resource
ICLanguageSetting langSetting = configDes.getLanguageSettingForFile(resource.getProjectRelativePath(), false);
-
+
if(langSetting == null) {
continue;
}
-
+
// get content type IDs for the setting
String[] contentTypeIDs = langSetting.getSourceContentTypeIds();
-
+
// if the setting doesn't handle our content type ID, then go to the next resource
boolean found = false;
for(String id : contentTypeIDs) {
@@ -148,23 +147,23 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
break;
}
}
-
+
if(!found) {
continue;
}
-
+
// update all the scanner config entries on the setting
updateIncludeSettings(langSetting);
updateMacroSettings(langSetting);
-
+
}
}
-
+
}
}
-
+
descriptionManager.setProjectDescription(project, cProjectDescription, true /* force */, monitor);
-
+
} catch (CoreException e) {
Activator.log(e);
return Activator.createStatus(Messages.getString("PerFileXLCScannerInfoCollector.1")); //$NON-NLS-1$
@@ -178,22 +177,22 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(ICLanguageSettingEntry entry : entries) {
newEntries.add(entry);
}
-
-
+
+
boolean entriesChanged = false;
-
+
// look for settings corresponding to each path we discovered
Map<String, String> discSymbols = fPathInfo.getSymbols();
for (String symbol : discSymbols.keySet()) {
boolean symbolFound = false;
-
+
for (ICLanguageSettingEntry entry : entries) {
if (((CMacroEntry) entry).getName().equals(symbol)) {
symbolFound = true; // it's already there, so don't set it
break;
}
}
-
+
// if we didn't find the path, add it
if(!symbolFound) {
entriesChanged = true;
@@ -201,13 +200,13 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
newEntries.add(newEntry);
}
}
-
+
// if we changed the entries, then set the new ones
if(entriesChanged) {
langSetting.setSettingEntries(ICSettingEntry.MACRO, newEntries.toArray(new ICLanguageSettingEntry[0]));
}
-
- return entriesChanged;
+
+ return entriesChanged;
}
private boolean updateIncludeSettings(ICLanguageSetting langSetting) {
@@ -216,22 +215,22 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(ICLanguageSettingEntry entry : entries) {
newEntries.add(entry);
}
-
-
+
+
boolean entriesChanged = false;
-
+
// look for settings corresponding to each path we discovered
IPath[] discPaths = fPathInfo.getIncludePaths();
for (IPath path : discPaths) {
boolean pathFound = false;
-
+
for (ICLanguageSettingEntry entry : entries) {
if (((CIncludePathEntry) entry).getLocation().equals(path)) {
pathFound = true; // it's already there, so don't set it
break;
}
}
-
+
// if we didn't find the path, add it
if(!pathFound) {
entriesChanged = true;
@@ -239,20 +238,20 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
newEntries.add(newEntry);
}
}
-
+
// if we changed the entries, then set the new ones
if(entriesChanged) {
langSetting.setSettingEntries(ICSettingEntry.INCLUDE_PATH, newEntries.toArray(new ICLanguageSettingEntry[0]));
}
-
+
return entriesChanged;
}
}
-
+
protected class MergedPerFileDiscoveredPathInfo implements IPerFileDiscoveredPathInfo2 {
private IDiscoveredPathInfo fInfo1;
private IPerFileDiscoveredPathInfo2 fInfo2;
-
+
public MergedPerFileDiscoveredPathInfo(IDiscoveredPathInfo info1, IPerFileDiscoveredPathInfo2 info2) {
fInfo1 = info1;
fInfo2 = info2;
@@ -262,12 +261,13 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
if(fInfo1 instanceof IPerFileDiscoveredPathInfo2) {
return (IPerFileDiscoveredPathInfo2) fInfo1;
}
-
+
else {
return null;
}
}
-
+
+ @Override
public Map<IResource, PathInfo> getPathInfoMap() {
synchronized (fLock) {
IPerFileDiscoveredPathInfo2 info1 = getPerFileInfo1();
@@ -287,6 +287,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getIncludeFiles(org.eclipse.core.runtime.IPath)
*/
+ @Override
public IPath[] getIncludeFiles(IPath path) {
synchronized (fLock) {
IPerFileDiscoveredPathInfo2 info1 = getPerFileInfo1();
@@ -308,6 +309,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
+ @Override
public IPath[] getIncludePaths(IPath path) {
synchronized (fLock) {
@@ -339,6 +341,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
+ @Override
public IPath[] getMacroFiles(IPath path) {
synchronized (fLock) {
Set<IPath> pathSet = new HashSet<IPath>();
@@ -360,6 +363,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
+ @Override
public IPath[] getQuoteIncludePaths(IPath path) {
synchronized (fLock) {
@@ -382,13 +386,14 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
+ @Override
public Map<String, String> getSymbols(IPath path) {
synchronized (fLock) {
Map<String, String> symbols = new HashMap<String, String>();
// add project level settings
- Map<String, String> projectSymbols = (Map<String, String>) fInfo1.getSymbols();
+ Map<String, String> projectSymbols = fInfo1.getSymbols();
for (String symbol : projectSymbols.keySet()) {
symbols.put(symbol, projectSymbols.get(symbol));
}
@@ -409,6 +414,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#isEmpty(org.eclipse.core.runtime.IPath)
*/
+ @Override
public boolean isEmpty(IPath path) {
synchronized (fLock) {
boolean info1empty = false;
@@ -424,40 +430,45 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
+ @Override
public IPath[] getIncludePaths() {
synchronized (fLock) {
return fInfo1.getIncludePaths();
}
}
+ @Override
public IProject getProject() {
return fInfo1.getProject();
}
+ @Override
public IDiscoveredScannerInfoSerializable getSerializable() {
return fInfo2.getSerializable();
}
+ @Override
public Map<String, String> getSymbols() {
synchronized (fLock) {
return fInfo1.getSymbols();
}
}
-
+
}
-
+
/**
* Per file DPI object
- *
+ *
* @author vhirsl
*/
protected class PerFileDiscoveredPathInfo implements IPerFileDiscoveredPathInfo2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getIncludeFiles(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getIncludeFiles(IPath path) {
+ @Override
+ public IPath[] getIncludeFiles(IPath path) {
synchronized (fLock) {
-
+
Set<IPath> pathSet = new LinkedHashSet<IPath>();
// get the command
CCommandDSC cmd = getCommand(path);
@@ -473,7 +484,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(IPath path2 : psi.includeFiles) {
pathSet.add(path2);
}
-
+
return pathSet.toArray(new IPath[0]);
}
}
@@ -481,7 +492,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getIncludePaths()
*/
- public IPath[] getIncludePaths() {
+ @Override
+ public IPath[] getIncludePaths() {
final IPath[] includepaths;
final IPath[] quotepaths;
synchronized (fLock) {
@@ -504,7 +516,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getIncludePaths(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getIncludePaths(IPath path) {
+ @Override
+ public IPath[] getIncludePaths(IPath path) {
synchronized (fLock) {
Set<IPath> pathSet = new LinkedHashSet<IPath>();
// get the command
@@ -521,7 +534,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(IPath path2 : psi.includePaths) {
pathSet.add(path2);
}
-
+
return pathSet.toArray(new IPath[0]);
}
}
@@ -529,7 +542,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getMacroFiles(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getMacroFiles(IPath path) {
+ @Override
+ public IPath[] getMacroFiles(IPath path) {
synchronized (fLock) {
Set<IPath> pathSet = new LinkedHashSet<IPath>();
// get the command
@@ -546,12 +560,13 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(IPath path2 : psi.macrosFiles) {
pathSet.add(path2);
}
-
+
return pathSet.toArray(new IPath[0]);
}
}
- public Map<IResource, PathInfo> getPathInfoMap() {
+ @Override
+ public Map<IResource, PathInfo> getPathInfoMap() {
synchronized (fLock) {
//TODO: do we need to cache this?
return calculatePathInfoMap();
@@ -561,14 +576,16 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getProject()
*/
- public IProject getProject() {
+ @Override
+ public IProject getProject() {
return project;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getQuoteIncludePaths(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getQuoteIncludePaths(IPath path) {
+ @Override
+ public IPath[] getQuoteIncludePaths(IPath path) {
synchronized (fLock) {
Set<IPath> pathSet = new LinkedHashSet<IPath>();
// get the command
@@ -585,7 +602,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
for(IPath path2 : psi.quoteIncludePaths) {
pathSet.add(path2);
}
-
+
return pathSet.toArray(new IPath[0]);
}
}
@@ -593,7 +610,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getSerializable()
*/
- public IDiscoveredScannerInfoSerializable getSerializable() {
+ @Override
+ public IDiscoveredScannerInfoSerializable getSerializable() {
synchronized (fLock) {
return sid;
}
@@ -602,7 +620,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getSymbols()
*/
- public Map<String, String> getSymbols() {
+ @Override
+ public Map<String, String> getSymbols() {
// return new HashMap();
synchronized (fLock) {
return getAllSymbols();
@@ -611,10 +630,11 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/*
* (non-Javadoc)
- *
+ *
* @seeorg.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.
* IDiscoveredPathInfo#getSymbols(org.eclipse.core.runtime.IPath)
*/
+ @Override
public Map<String, String> getSymbols(IPath path) {
synchronized (fLock) {
Map<String, String> definedSymbols = new HashMap<String, String>();
@@ -650,6 +670,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#isEmpty(org.eclipse.core.runtime.IPath)
*/
+ @Override
public boolean isEmpty(IPath path) {
synchronized (fLock) {
boolean rc = true;
@@ -690,7 +711,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public static final String INCLUDE_PATH = "includePath"; //$NON-NLS-1$
private static final String NAME = "name"; //$NON-NLS-1$
-
+
public static final String PATH = "path"; //$NON-NLS-1$
private static final String PROJECT = "project"; //$NON-NLS-1$
public static final String REMOVED = "removed"; //$NON-NLS-1$
@@ -698,7 +719,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public final Map<Integer, CCommandDSC> commandIdCommandMap; // map of all commands
public final Map<Integer, Set<IFile>> commandIdToFilesMap; // command id and set of files it applies to
public final Map<IFile, Integer> fileToCommandIdMap; // maps each file to the corresponding command id
-
+
public ScannerInfoData() {
commandIdCommandMap = new LinkedHashMap<Integer, CCommandDSC>(); // [commandId, command]
fileToCommandIdMap = new HashMap<IFile, Integer>(); // [file, commandId]
@@ -708,21 +729,22 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#deserialize(org.w3c.dom.Element)
*/
- public void deserialize(Element collectorElem) {
+ @Override
+ public void deserialize(Element collectorElem) {
synchronized (fLock) {
-
+
for (Node child = collectorElem.getFirstChild(); child != null; child = child.getNextSibling()) {
if(child.getNodeName().equals(PROJECT)) {
Element projectElement = (Element) child;
String projectName = projectElement.getAttribute(NAME);
-
+
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
-
+
Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>();
-
+
List<String> includes = new LinkedList<String>();
List<String> symbols = new LinkedList<String>();
-
+
// iterate over children
for(Node projectChild = projectElement.getFirstChild(); projectChild != null; projectChild = projectChild.getNextSibling()) {
if(projectChild.getNodeName().equals(INCLUDE_PATH)) {
@@ -735,21 +757,21 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
else if(projectChild.getNodeName().equals(DEFINED_SYMBOL)) {
Element childElem = (Element) projectChild;
String symbol = childElem.getAttribute(SYMBOL);
-
+
if(symbol != null) {
symbols.add(symbol);
}
}
}
-
+
// add loaded scanner info to project settings for this collector
scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes);
scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols);
fProjectSettingsMap.put(project, scannerInfo);
}
-
-
- else if (child.getNodeName().equals(CC_ELEM)) {
+
+
+ else if (child.getNodeName().equals(CC_ELEM)) {
Element cmdElem = (Element) child;
boolean cppFileType = cmdElem.getAttribute(FILE_TYPE_ATTR).equals("c++"); //$NON-NLS-1$
XLCCommandDSC command = new XLCCommandDSC(cppFileType, project);
@@ -777,27 +799,29 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#getCollectorId()
*/
- public String getCollectorId() {
+ @Override
+ public String getCollectorId() {
return COLLECTOR_ID;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#serialize(org.w3c.dom.Element)
*/
- public void serialize(Element collectorElem) {
+ @Override
+ public void serialize(Element collectorElem) {
try {
synchronized (fLock) {
Document doc = collectorElem.getOwnerDocument();
-
+
// serialize project level info
for (IProject project : fProjectSettingsMap.keySet()) {
// create a project node
Element projectElement = doc.createElement(PROJECT);
projectElement.setAttribute(NAME, project.getName());
-
+
Map<ScannerInfoTypes, List<String>> scannerInfo = (Map<ScannerInfoTypes, List<String>>) fProjectSettingsMap.get(project);
-
- List<String> includes = scannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS);
+
+ List<String> includes = scannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS);
for(String include : includes) {
Element pathElement = doc.createElement(INCLUDE_PATH);
pathElement.setAttribute(PATH, include);
@@ -808,10 +832,10 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
pathElement.setAttribute(REMOVED, "false"); //$NON-NLS-1$
projectElement.appendChild(pathElement);
}
-
+
// Now do the same for the symbols
List<String> symbols = scannerInfo.get(ScannerInfoTypes.SYMBOL_DEFINITIONS);
-
+
for(String symbol : symbols) {
Element symbolElement = doc.createElement(DEFINED_SYMBOL);
symbolElement.setAttribute(SYMBOL, symbol);
@@ -819,36 +843,36 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
collectorElem.appendChild(projectElement);
}
-
+
// serialize file level info
List<Integer> commandIds = new ArrayList<Integer>(commandIdCommandMap.keySet());
Collections.sort(commandIds);
for (Iterator<Integer> i = commandIds.iterator(); i.hasNext(); ) {
Integer commandId = i.next();
CCommandDSC command = commandIdCommandMap.get(commandId);
-
- Element cmdElem = doc.createElement(CC_ELEM);
+
+ Element cmdElem = doc.createElement(CC_ELEM);
collectorElem.appendChild(cmdElem);
- cmdElem.setAttribute(ID_ATTR, commandId.toString());
+ cmdElem.setAttribute(ID_ATTR, commandId.toString());
cmdElem.setAttribute(FILE_TYPE_ATTR, command.appliesToCPPFileType() ? "c++" : "c"); //$NON-NLS-1$ //$NON-NLS-2$
// write command and scanner info
command.serialize(cmdElem);
// write files command applies to
- Element filesElem = doc.createElement(APPLIES_TO_ATTR);
+ Element filesElem = doc.createElement(APPLIES_TO_ATTR);
cmdElem.appendChild(filesElem);
Set<IFile> files = commandIdToFilesMap.get(commandId);
if (files != null) {
for (Iterator<IFile> j = files.iterator(); j.hasNext(); ) {
- Element fileElem = doc.createElement(FILE_ELEM);
+ Element fileElem = doc.createElement(FILE_ELEM);
IFile file = j.next();
IPath path = file.getProjectRelativePath();
- fileElem.setAttribute(PATH_ATTR, path.toString());
+ fileElem.setAttribute(PATH_ATTR, path.toString());
filesElem.appendChild(fileElem);
}
}
}
}
-
+
}
catch(Throwable e) {
e.printStackTrace();
@@ -856,7 +880,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
-
+
protected static final String APPLIES_TO_ATTR = "appliesToFiles"; //$NON-NLS-1$
protected static final String CC_ELEM = "compilerCommand"; //$NON-NLS-1$
@@ -872,15 +896,15 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
protected static final int INCLUDE_FILE = 3;
protected static final int INCLUDE_PATH = 1;
-
-
+
+
protected static final int MACROS_FILE = 4;
protected static final String PATH_ATTR = "path"; //$NON-NLS-1$
protected static final int QUOTE_INCLUDE_PATH = 2;
-
+
protected static PathInfo createFilePathInfo(CCommandDSC cmd){
IPath[] includes = stringListToPathArray(cmd.getIncludes());
IPath[] quotedIncludes = stringListToPathArray(cmd.getQuoteIncludes());
@@ -894,7 +918,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
String value = ScannerConfigUtil.getSymbolValue(symbol);
definedSymbols.put(key, value);
}
-
+
return new PathInfo(includes, quotedIncludes, definedSymbols, incFiles, macroFiles);
}
/**
@@ -914,12 +938,12 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
protected int commandIdCounter = 0;
protected InfoContext context;
-
+
/** monitor for data access */
protected final Object fLock = new Object();
-
+
private Map<IProject, Map<?, ?>> fProjectSettingsMap = new HashMap<IProject, Map<?, ?>>();
-
+
protected final SortedSet<Integer> freeCommandIdPool; // sorted set of free command ids
protected IProject project;
protected ProjectScannerInfo psi = null; // sum of all scanner info
@@ -927,22 +951,22 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
// protected List siChangedForFileList; // list of files for which scanner info has changed
protected final Map<IResource, Integer> siChangedForFileMap; // (file, comandId) map for deltas
protected ScannerInfoData sid; // scanner info data
-
+
/**
- *
+ *
*/
public PerFileXLCScannerInfoCollector() {
sid = new ScannerInfoData();
-
+
// siChangedForFileList = new ArrayList();
siChangedForFileMap = new HashMap<IResource, Integer>();
siChangedForCommandIdList = new ArrayList<Integer>();
-
+
freeCommandIdPool = new TreeSet<Integer>();
}
-
+
/**
- * @param file
+ * @param file
* @param object
*/
protected void addCompilerCommand(IFile file, CCommandDSC cmd) {
@@ -967,7 +991,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
generateFileDelta(file, cmd);
}
}
-
+
/**
* @param commandId
* @param scannerInfo
@@ -991,14 +1015,14 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
}
-
+
/**
* @param type
* @param object
*/
protected void addScannerInfo(ScannerInfoTypes type, List delta) {
// TODO Auto-generated method stub
-
+
}
/**
* @param file
@@ -1049,7 +1073,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
generateProjectScannerInfo();
}
}
-
+
protected Map<IResource, PathInfo> calculatePathInfoMap() {
synchronized (fLock) {
@@ -1083,7 +1107,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
return map;
}
}
-
+
+ @Override
public void contributeToScannerConfig(Object resource, Map scannerInfo) {
// check the resource
String errorMessage = null;
@@ -1096,7 +1121,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
return;
}
-
+
if ((resource instanceof IFile)) {
if (((IFile) resource).getProject() == null) {
@@ -1125,24 +1150,25 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
}
-
+
else if(resource instanceof IProject) {
// save to project level settings
synchronized (fLock) {
fProjectSettingsMap.put(((IProject) resource), scannerInfo);
}
}
-
+
else { // error
TraceUtil.outputError("PerFileSICollector.contributeToScannerConfig : ", "Not a project or file."); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#createPathInfoObject()
*/
- public IDiscoveredPathInfo createPathInfoObject() {
+ @Override
+ public IDiscoveredPathInfo createPathInfoObject() {
return new PerFileDiscoveredPathInfo();
}
/* (non-Javadoc)
@@ -1151,11 +1177,11 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public void deleteAll(IResource resource) {
synchronized (fLock) {
if (resource instanceof IProject) {
- fProjectSettingsMap.remove(((IProject) resource));
+ fProjectSettingsMap.remove(resource);
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner#deleteAll(org.eclipse.core.resources.IResource)
*/
@@ -1171,10 +1197,10 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
// siChangedForFileList.add(path);
siChangedForFileMap.put(file, null);
}
-
+
sid = new ScannerInfoData();
psi = null;
-
+
commandIdCounter = 0;
freeCommandIdPool.clear();
}
@@ -1183,7 +1209,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector#
* deleteAllPaths(org.eclipse.core.resources.IResource)
@@ -1191,14 +1217,14 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public void deleteAllPaths(IResource resource) {
synchronized (fLock) {
if (resource instanceof IProject && fProjectSettingsMap != null) {
- fProjectSettingsMap.remove(((IProject) resource));
+ fProjectSettingsMap.remove(resource);
}
}
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector#
* deleteAllSymbols(org.eclipse.core.resources.IResource)
@@ -1206,14 +1232,14 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public void deleteAllSymbols(IResource resource) {
synchronized (fLock) {
if (resource instanceof IProject && fProjectSettingsMap != null) {
- fProjectSettingsMap.remove(((IProject) resource));
+ fProjectSettingsMap.remove(resource);
}
}
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector#
* deletePath(org.eclipse.core.resources.IResource, java.lang.String)
@@ -1221,14 +1247,14 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public void deletePath(IResource resource, String path) {
synchronized (fLock) {
if (resource instanceof IProject && fProjectSettingsMap != null) {
- fProjectSettingsMap.remove(((IProject) resource));
+ fProjectSettingsMap.remove(resource);
}
}
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector#
* deleteSymbol(org.eclipse.core.resources.IResource, java.lang.String)
@@ -1236,7 +1262,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
public void deleteSymbol(IResource resource, String symbol) {
synchronized (fLock) {
if (resource instanceof IProject && fProjectSettingsMap != null) {
- fProjectSettingsMap.remove(((IProject) resource));
+ fProjectSettingsMap.remove(resource);
}
}
}
@@ -1309,7 +1335,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
* <li><code>QUOTE_INCLUDE_PATH</code>
* <li><code>INCLUDE_FILE</code>
* <li><code>MACROS_FILE</code>
- *
+ *
* @return list of IPath(s).
*/
protected IPath[] getAllIncludePaths1(int type) {
@@ -1354,7 +1380,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollector#
* getAllSymbols()
@@ -1386,7 +1412,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
return symbols;
}
}
-
+
/**
* @return
*/
@@ -1413,14 +1439,15 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#getCollectedScannerInfo(java.lang.Object, org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes)
*/
- public List<CCommandDSC> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
-
+ @Override
+ public List<CCommandDSC> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
+
List<CCommandDSC> rv = new ArrayList<CCommandDSC>();
// check the resource
String errorMessage = null;
if (resource == null) {
errorMessage = "resource is null";//$NON-NLS-1$
- }
+ }
else if (!(resource instanceof IResource)) {
errorMessage = "resource is not an IResource";//$NON-NLS-1$
}
@@ -1430,7 +1457,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
else if (((IResource) resource).getProject() != project) {
errorMessage = "wrong project";//$NON-NLS-1$
}
-
+
if (errorMessage != null) {
TraceUtil.outputError("PerProjectSICollector.getCollectedScannerInfo : ", errorMessage); //$NON-NLS-1$
return rv;
@@ -1509,15 +1536,17 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#getDefinedSymbols()
*/
+ @Override
public Map getDefinedSymbols() {
synchronized (fLock) {
return getAllSymbols();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#getIncludePaths()
*/
+ @Override
public List<String> getIncludePaths() {
synchronized (fLock) {
List<String> pathStrings = new LinkedList<String>();
@@ -1532,7 +1561,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
return pathStrings;
}
}
-
+
protected InfoContext getInfoContext() {
return context;
}
@@ -1571,7 +1600,8 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
}
- public void setInfoContext(InfoContext context) {
+ @Override
+ public void setInfoContext(InfoContext context) {
synchronized (fLock) {
this.project = context.getProject();
this.context = context;
@@ -1588,13 +1618,15 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#setProject(org.eclipse.core.resources.IProject)
*/
- public void setProject(IProject project) {
+ @Override
+ public void setProject(IProject project) {
synchronized (fLock) {
setInfoContext(new InfoContext(project));
}
}
- public void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException {
+ @Override
+ public void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
@@ -1609,10 +1641,10 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
siChangedForFileMap.clear();
}
siChangedForCommandIdList.clear();
-
+
// add in any projects that got project level info (from the specs provider)
changedResources.addAll(fProjectSettingsMap.keySet());
-
+
monitor.worked(50);
if (!changedResources.isEmpty()) {
// update outside monitor scope
@@ -1626,7 +1658,7 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
}
else {
PerFileDiscoveredPathInfo perFilePathInfo = new PerFileDiscoveredPathInfo();
-
+
// merge them
if (!(pathInfo instanceof IPerFileDiscoveredPathInfo)) {
pathInfo = new MergedPerFileDiscoveredPathInfo(pathInfo, perFilePathInfo);
@@ -1635,32 +1667,32 @@ public class PerFileXLCScannerInfoCollector implements IScannerInfoCollector3, I
pathInfo = perFilePathInfo;
}
}
-
-
+
+
Job job = new ScannerConfigUpdateJob(context, pathInfo, context.isDefaultContext(), changedResources);
ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
job.setRule(rule);
job.schedule();
-
-
+
+
// } finally {
// manager.endRule(rule);
// }
-
+
} catch (CoreException e) {
MakeCorePlugin.log(e);
}
-
+
catch (Throwable e) {
e.printStackTrace();
}
}
}
-
+
monitor.worked(50);
monitor.done();
}
-
+
} \ No newline at end of file
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java
index 8885320442..fe785919df 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCBuildOutputParserUtility.java
@@ -87,7 +87,7 @@ public class XLCBuildOutputParserUtility {
private IProject project;
private int workingDirsN = 0;
-
+
/*
* For tracking the location of files being compiled
*/
@@ -102,10 +102,10 @@ public class XLCBuildOutputParserUtility {
if (workingDirectory != null) {
pushDirectory(workingDirectory);
}
-
+
}
/**
- *
+ *
*/
public XLCBuildOutputParserUtility(IProject project, IPath workingDirectory,
IMarkerGenerator markerGenerator) {
@@ -136,7 +136,7 @@ public class XLCBuildOutputParserUtility {
if (compiledFileList.contains(longFileName))
return;
compiledFileList.add(longFileName);
-
+
String workingDir = getWorkingDirectory().toString();
List directoryCommandList = (List) directoryCommandListMap.get(workingDir);
if (directoryCommandList == null) {
@@ -219,7 +219,7 @@ public class XLCBuildOutputParserUtility {
}
/**
- *
+ *
*/
void generateReport() {
TraceUtil.metricsTrace("Stats for directory ", //$NON-NLS-1$
@@ -227,7 +227,7 @@ public class XLCBuildOutputParserUtility {
directoryCommandListMap);
TraceUtil.summaryTrace("Discovery summary", workingDirsN, commandsN, filesN); //$NON-NLS-1$
}
-
+
/**
* @param filePath : String
* @return filePath : IPath - not <code>null</code>
@@ -239,7 +239,7 @@ public class XLCBuildOutputParserUtility {
}
else if (filePath.startsWith("\\") || //$NON-NLS-1$
(!filePath.startsWith(".") && //$NON-NLS-1$
- filePath.length() > 2 && filePath.charAt(1) == ':' &&
+ filePath.length() > 2 && filePath.charAt(1) == ':' &&
(filePath.charAt(2) == '\\' || filePath.charAt(2) == '/'))) {
// absolute path
pFilePath = new Path(filePath);
@@ -268,7 +268,7 @@ public class XLCBuildOutputParserUtility {
public IPath getBaseDirectory() {
return fBaseDirectory;
}
-
+
/**
* Returns all CCommandDSC collected so far.
* Currently this list is not filled, so it will always return an empty list.
@@ -277,7 +277,7 @@ public class XLCBuildOutputParserUtility {
public List getCCommandDSCList() {
return new ArrayList(commandsList2);
}
-
+
protected int getDirectoryLevel() {
return fDirectoryStack.size();
}
@@ -303,7 +303,7 @@ public class XLCBuildOutputParserUtility {
/**
* @param genericLine
* @param cppFileType
- * @return CCommandDSC compile command description
+ * @return CCommandDSC compile command description
*/
public CCommandDSC getNewCCommandDSC(String[] tokens, final int idxOfCompilerCommand, boolean cppFileType) {
ArrayList dirafter = new ArrayList();
@@ -327,7 +327,7 @@ public class XLCBuildOutputParserUtility {
token.equals("-fno-signed-char") || //$NON-NLS-1$
token.equals("-fsigned-char") || //$NON-NLS-1$
token.startsWith("-fabi-version=") //$NON-NLS-1$
- ) {
+ ) {
command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), token));
continue;
}
@@ -343,7 +343,7 @@ public class XLCBuildOutputParserUtility {
for (Iterator iter=includes.iterator(); iter.hasNext(); ) {
option = (String)iter.next();
KVStringPair pair = new KVStringPair(SCDOptionsEnum.IQUOTE.toString(), option);
- command.addSCOption(pair);
+ command.addSCOption(pair);
}
includes = new ArrayList();
// -I- has no parameter
@@ -356,17 +356,17 @@ public class XLCBuildOutputParserUtility {
}
else break;
}
-
+
if (option.length() > 0 && (
optionKind.equals(SCDOptionsEnum.INCLUDE) ||
optionKind.equals(SCDOptionsEnum.INCLUDE_FILE) ||
optionKind.equals(SCDOptionsEnum.IMACROS_FILE) ||
optionKind.equals(SCDOptionsEnum.IDIRAFTER) ||
- optionKind.equals(SCDOptionsEnum.ISYSTEM) ||
+ optionKind.equals(SCDOptionsEnum.ISYSTEM) ||
optionKind.equals(SCDOptionsEnum.IQUOTE) )) {
option = (getAbsolutePath(option)).toString();
}
-
+
if (optionKind.equals(SCDOptionsEnum.IDIRAFTER)) {
KVStringPair pair = new KVStringPair(SCDOptionsEnum.INCLUDE.toString(), option);
dirafter.add(pair);
@@ -391,10 +391,10 @@ public class XLCBuildOutputParserUtility {
for (Iterator iter=includes.iterator(); iter.hasNext(); ) {
option = (String)iter.next();
KVStringPair pair = new KVStringPair(SCDOptionsEnum.INCLUDE.toString(), option);
- command.addSCOption(pair);
+ command.addSCOption(pair);
}
for (Iterator iter=dirafter.iterator(); iter.hasNext(); ) {
- command.addSCOption((KVStringPair)iter.next());
+ command.addSCOption((KVStringPair)iter.next());
}
return command;
}
@@ -470,11 +470,11 @@ public class XLCBuildOutputParserUtility {
fDefaultMacroDefinitionValue= val;
}
}
-
+
public String getDefaultMacroDefinitionValue() {
return fDefaultMacroDefinitionValue;
}
-
+
public String normalizePath(String path) {
int column = path.indexOf(':');
if (column > 0) {
@@ -534,12 +534,12 @@ public class XLCBuildOutputParserUtility {
}
}
newBuf.append(buf.substring(scp, len));
-
+
IPath orgPath = new Path(newBuf.toString());
return orgPath.toString();
}
-
+
/**
* Called by the console line parsers to find a file with a given name.
* @param fileName
@@ -554,7 +554,7 @@ public class XLCBuildOutputParserUtility {
// If there is a conflict then try all files in the project.
if (isConflictingName(fileName)) {
file = null;
-
+
// Create a problem marker
final String error = MakeMessages.getString("ConsoleParser.Ambiguous_Filepath_Error_Message"); //$NON-NLS-1$
TraceUtil.outputError(error, fileName);
@@ -564,7 +564,7 @@ public class XLCBuildOutputParserUtility {
}
return file;
}
-
+
/**
* @param filePath
* @return
@@ -611,7 +611,7 @@ public class XLCBuildOutputParserUtility {
*/
protected IFile findFileName(String fileName) {
IPath path = new Path(fileName);
- return (IFile) fFilesInProject.get(path.lastSegment());
+ return fFilesInProject.get(path.lastSegment());
}
protected IFile findFileInWorkspace(IPath path) {
@@ -672,7 +672,7 @@ public class XLCBuildOutputParserUtility {
if (!cwd.isAbsolute()) {
cwd = getBaseDirectory().append(cwd);
}
-
+
IPath filePath = new Path(fileName);
if (!filePath.isAbsolute()) {
// check if the cwd is the right one
@@ -686,11 +686,11 @@ public class XLCBuildOutputParserUtility {
// probably multiple choices for cwd, hopeless
final String error = MakeMessages.getString("ConsoleParser.Working_Directory_Error_Message"); //$NON-NLS-1$
TraceUtil.outputError(error, fileName);
- generateMarker(file, -1, error, IMarkerGenerator.SEVERITY_WARNING, fileName);
+ generateMarker(file, -1, error, IMarkerGenerator.SEVERITY_WARNING, fileName);
break;
}
else {
- // remove common segments at the end
+ // remove common segments at the end
IPath tPath = new Path(fileName);
if (fileName.startsWith(".")) { //$NON-NLS-1$
tPath = tPath.removeFirstSegments(1);
@@ -703,14 +703,14 @@ public class XLCBuildOutputParserUtility {
}
}
}
-
+
IPath candidatePath = cwd.append(includePath);
File dir = candidatePath.toFile();
include = candidatePath.toString();
if (!dir.exists()) {
final String error = MakeMessages.getString("ConsoleParser.Nonexistent_Include_Path_Error_Message"); //$NON-NLS-1$
TraceUtil.outputError(error, include);
-// generateMarker(file, -1, error+include, IMarkerGenerator.SEVERITY_WARNING, fileName);
+// generateMarker(file, -1, error+include, IMarkerGenerator.SEVERITY_WARNING, fileName);
}
}
// TODO VMIR for now add unresolved paths as well
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java
index 3482c1a790..4fd45a07cb 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerFileBuildOutputParser.java
@@ -36,7 +36,7 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
@Override
protected boolean processCommand(String[] tokens) {
try {
-
+
// GCC C/C++ compiler invocation
int compilerInvocationIndex = findCompilerInvocation(tokens);
if (compilerInvocationIndex < 0) {
@@ -47,7 +47,7 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
int extensionsIndex = -1;
boolean found = false;
String filePath = null;
-
+
// check for automake format first
// e.g. line will start with
// source='/some/path/source.cpp'
@@ -63,7 +63,7 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
}
}
}
-
+
if (!found) {
for (int i = compilerInvocationIndex + 1; i < tokens.length; i++) {
String token = tokens[i];
@@ -79,7 +79,7 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
}
}
}
-
+
if (!found) {
TraceUtil.outputTrace("Error identifying file name :1", tokens, TraceUtil.EOL); //$NON-NLS-1$
return false;
@@ -150,12 +150,12 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
// cmdList.add(cmd);
Map<ScannerInfoTypes, List<?>> sc = new HashMap<ScannerInfoTypes, List<?>>();
// sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList);
-
-
+
+
// put in empty info for the other types
sc.put(ScannerInfoTypes.INCLUDE_PATHS, new LinkedList<String>());
sc.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, new LinkedList<String>());
-
+
getCollector().contributeToScannerConfig(getProject(), sc);
if (fCollector != null && fCollector instanceof IScannerInfoCollector2) {
IScannerInfoCollector2 collector = (IScannerInfoCollector2) fCollector;
@@ -166,12 +166,12 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
Activator.log(e);
}
}
-
+
*/
}
}
return true;
-
+
}
catch(Throwable e) {
e.printStackTrace();
@@ -190,7 +190,7 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
int equalsIndex = string.indexOf('=');
if(equalsIndex != -1 && equalsIndex < string.length())
return string.substring(equalsIndex+1);
-
+
}
return null;
}
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java
index cae37f6b94..61aef0ff86 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XLCPerProjectBuildOutputParser.java
@@ -31,7 +31,7 @@ import org.eclipse.core.runtime.CoreException;
*/
public class XLCPerProjectBuildOutputParser extends
AbstractXLCBuildOutputParser {
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.xlc.core.scannerconfig.AbstractXLCBuildOutputParser#processCommand(java.lang.String[])
*/
@@ -41,7 +41,7 @@ public class XLCPerProjectBuildOutputParser extends
if (compilerInvocationIdx<0) {
return false;
}
-
+
if (compilerInvocationIdx+1 >= tokens.length) {
return false;
}
@@ -102,14 +102,14 @@ public class XLCPerProjectBuildOutputParser extends
}
}
}
-
+
else if (fileName == null) {
int extIndex = token.lastIndexOf('.');
String extension=null;
-
+
if(extIndex != -1)
extension = token.substring(extIndex);
-
+
List<String> extensions = getFileExtensionsList();
if(extension != null && extensions.contains(extension))
fileName = token;
@@ -120,7 +120,7 @@ public class XLCPerProjectBuildOutputParser extends
return false; // return when no file was given (analogous to GCCPerFileBOPConsoleParser)
}
- IProject project = getProject();
+ IProject project = getProject();
IFile file = null;
List<String> translatedIncludes = includes;
if (includes.size() > 0) {
@@ -139,7 +139,7 @@ public class XLCPerProjectBuildOutputParser extends
line.append(tokens[j]);
line.append(' ');
}
- final String error = MakeMessages.getString("ConsoleParser.Filename_Missing_Error_Message"); //$NON-NLS-1$
+ final String error = MakeMessages.getString("ConsoleParser.Filename_Missing_Error_Message"); //$NON-NLS-1$
TraceUtil.outputError(error, line.toString());
if (getUtility() != null) {
getUtility().generateMarker(getProject(), -1, error + line.toString(), IMarkerGenerator.SEVERITY_WARNING, null);
@@ -175,5 +175,5 @@ public class XLCPerProjectBuildOutputParser extends
}
-
+
}
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java
index d4fbeb094a..04cd1c42b9 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java
@@ -10,27 +10,27 @@
*******************************************************************************/
package org.eclipse.cdt.make.xlc.core.scannerconfig;
-import java.util.List;
import java.util.ArrayList;
-import java.util.Map;
import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.cdt.core.IMarkerGenerator;
+import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser;
-import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
import org.eclipse.cdt.make.xlc.core.activator.Activator;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.cdt.core.IMarkerGenerator;
/**
* Parses output of ppuxlc -E -v specs.c or ppuxlc -E -v specs.cpp command
- *
+ *
* @author laggarcia
* @since 1.0.0
*/
@@ -46,7 +46,7 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
// pattern for the includes arguments
final Pattern includePattern = Pattern
.compile("-(?:qgcc_c_stdinc|qc_stdinc|qgcc_cpp_stdinc|qcpp_stdinc)=(.*)"); //$NON-NLS-1$
-
+
// xlC compiler constants
protected final static String [] compilerConstants = {
"__IBMCPP__", //$NON-NLS-1$
@@ -54,7 +54,7 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
"__IBMC__", //$NON-NLS-1$
"__xlc__" //$NON-NLS-1$
};
-
+
private IProject fProject = null;
protected IScannerInfoCollector fCollector = null;
@@ -65,13 +65,14 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#startup(org.eclipse.core.resources.IProject,
* org.eclipse.core.runtime.IPath,
* org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector,
* org.eclipse.cdt.core.IMarkerGenerator)
* @since 1.0
*/
+ @Override
public void startup(IProject project, IPath workingDirectory,
IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
this.fProject = project;
@@ -83,13 +84,14 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
* standard information about the compiler being used. <p> During the
* processing, builds two List objects, one with the standard symbols
* defined in the compiler and other with the standard include directories.
- *
+ *
* @param line the output line from the compiler command line used @return
* boolean
- *
+ *
* @see org.eclipse.cdt.make.intrenal.core.scannerconfig.gnu.GCCSpecsConsoleParser#processLine(java.lang.String)
* @since 1.0
*/
+ @Override
public boolean processLine(String line) {
boolean rc = false;
TraceUtil.outputTrace(
@@ -132,13 +134,14 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParser#shutdown()
* @since 1.0
*/
+ @Override
public void shutdown() {
Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>();
-
+
// insert compiler constants, work around buggy xlC option for dumping symbols (it misses a few)
for (String constant : compilerConstants) {
if (!symbols.contains(constant))
@@ -148,7 +151,7 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
// add the scanner info
scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes);
scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols);
-
+
fCollector.contributeToScannerConfig(fProject, scannerInfo);
if(fCollector != null && fCollector instanceof IScannerInfoCollector2) {
IScannerInfoCollector2 collector = (IScannerInfoCollector2) fCollector;
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsRunSIProvider.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsRunSIProvider.java
index 343f5f56a2..450b080f50 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsRunSIProvider.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsRunSIProvider.java
@@ -12,14 +12,13 @@ package org.eclipse.cdt.make.xlc.core.scannerconfig;
import org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
import org.eclipse.core.runtime.Path;
/**
* @author laggarcia
- *
+ *
*/
public class XlCSpecsRunSIProvider extends GCCSpecsRunSIProvider {
@@ -27,9 +26,10 @@ public class XlCSpecsRunSIProvider extends GCCSpecsRunSIProvider {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider#initialize()
*/
+ @Override
protected boolean initialize() {
boolean rc = super.initialize();
diff --git a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/util/XLCCommandDSC.java b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/util/XLCCommandDSC.java
index f1bf2a7cca..4840345d62 100644
--- a/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/util/XLCCommandDSC.java
+++ b/xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/util/XLCCommandDSC.java
@@ -18,14 +18,14 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Path;
/**
- * Class that represents a XL C/C++ compiler command and related scanner configuration
+ * Class that represents a XL C/C++ compiler command and related scanner configuration
*/
public class XLCCommandDSC extends CCommandDSC {
public XLCCommandDSC(boolean cppFileType) {
super(cppFileType);
}
-
+
public XLCCommandDSC(boolean cppFileType, IProject project) {
super(cppFileType, project);
}

Back to the top