BUILD: modified method which returns build option
authorGun Kim <gune.kim@samsung.com>
Fri, 9 Sep 2016 04:52:41 +0000 (13:52 +0900)
committerGun Kim <gune.kim@samsung.com>
Fri, 9 Sep 2016 05:29:10 +0000 (14:29 +0900)
.c file's build option doesn't same with .cpp file's build option.
The modified method returns proper build option of them.

Change-Id: I4633fdfa6511fb3c86728e38e1d0e4e7db39a6b1
Signed-off-by: Gun Kim <gune.kim@samsung.com>
core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java

index 6473a4f..a571eaa 100644 (file)
@@ -101,8 +101,9 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
 
        private static final Pattern HEADERNAME_PATTERN = Pattern.compile("@headername\\{(?<header>[^\\}]+)\\}");  //$NON-NLS-1$
        /* Tizen */
-       private boolean isReusage = false;
-       private IScannerInfo scannerInfo;
+       private boolean isReuse = false;
+       private IScannerInfo cScannerInfo;
+       private IScannerInfo cppScannerInfo;
        /* ===== */
 
        private static class LinkageTask {
@@ -1020,20 +1021,30 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
        }
 
        /* Tizen */
-       public void setReuseBuildOption(boolean isReusage) {
-               this.isReusage = isReusage;
+       public void setReuseBuildOption(boolean isReuse) {
+               this.isReuse = isReuse;
        }
        /* ===== */
 
        /* Tizen */
-//             final IScannerInfo scannerInfo = fResolver.getBuildConfiguration(linkageID, contextTu);
        private IScannerInfo getScannerInfo(int linkageID, Object contextTu) {
-               if (isReusage) {
-                       if (scannerInfo != null) {
-                               return scannerInfo;
+               if (isReuse) {
+                       if (ILinkage.C_LINKAGE_ID == linkageID) {
+                               if (cScannerInfo != null) {
+                                       return cScannerInfo;
+                               }
+                       } else if (ILinkage.CPP_LINKAGE_ID == linkageID) {
+                               if (cppScannerInfo != null) {
+                                       return cppScannerInfo;
+                               }
                        }
                }
-               scannerInfo = fResolver.getBuildConfiguration(linkageID, contextTu);
+               final IScannerInfo scannerInfo = fResolver.getBuildConfiguration(linkageID, contextTu);
+               if (ILinkage.C_LINKAGE_ID == linkageID) {
+                       cScannerInfo = scannerInfo;
+               } else if (ILinkage.CPP_LINKAGE_ID == linkageID) {
+                       cppScannerInfo = scannerInfo;
+               }
        /* ===== */
                if (scannerInfo instanceof ExtendedScannerInfo) {
                        ExtendedScannerInfo extendedScannerInfo = (ExtendedScannerInfo) scannerInfo;