Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-12-21 13:24:23 -0500
committerMike Kucera2009-12-21 13:24:23 -0500
commitc721612b1358b137489d3b3c8bb8f7396d5212e3 (patch)
tree33bb94a8d9bae0126e7bf9d93250bd44d088809f
parent06978cf46bfc70b77328051f8f3b25a6dc0267b9 (diff)
downloadorg.eclipse.cdt-c721612b1358b137489d3b3c8bb8f7396d5212e3.tar.gz
org.eclipse.cdt-c721612b1358b137489d3b3c8bb8f7396d5212e3.tar.xz
org.eclipse.cdt-c721612b1358b137489d3b3c8bb8f7396d5212e3.zip
Bug 298314 - Scanner Discovery misses some xlC defines because the compiler does not export them when instructed
-rw-r--r--xlc/org.eclipse.cdt.make.xlc.core/src/org/eclipse/cdt/make/xlc/core/scannerconfig/XlCSpecsConsoleParser.java19
1 files changed, 18 insertions, 1 deletions
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 ac9c6a84f1..c96bf082f5 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
@@ -46,7 +46,15 @@ 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
+ final static String [] compilerConstants = {
+ "__IBMCPP__", //$NON-NLS-1$
+ "__xlC__", //$NON-NLS-1$
+ "__IBMC__", //$NON-NLS-1$
+ "__xlc__" //$NON-NLS-1$
+ };
+
private IProject fProject = null;
private IScannerInfoCollector fCollector = null;
@@ -130,8 +138,17 @@ public class XlCSpecsConsoleParser implements IScannerInfoConsoleParser {
*/
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))
+ symbols.add(constant);
+ }
+
+ // 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;

Back to the top