aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/generator/iarew
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/generator/iarew')
-rw-r--r--src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp56
-rw-r--r--src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp4
-rw-r--r--src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp4
-rw-r--r--src/plugins/generator/iarew/iarew.pri1
-rw-r--r--src/plugins/generator/iarew/iarew.pro131
-rw-r--r--src/plugins/generator/iarew/iarewutils.cpp4
6 files changed, 26 insertions, 174 deletions
diff --git a/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp b/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp
index b0c4b9368..b3b68377f 100644
--- a/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp
+++ b/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp
@@ -95,17 +95,15 @@ struct TargetPageOptions final
const QString core = IarewUtils::flagValue(
flags, QStringLiteral("--core"))
.toLower();
- if (core == QLatin1String("plain")) {
+ // If the core variant is not set, then choose the
+ // default value, CorePlain (see the compiler datasheet for
+ // '--core' option).
+ if (core == QLatin1String("plain") || core.isEmpty()) {
cpuCore = TargetPageOptions::CorePlain;
} else if (core == QLatin1String("extended1")) {
cpuCore = TargetPageOptions::CoreExtended1;
} else if (core == QLatin1String("extended2")) {
cpuCore = TargetPageOptions::CoreExtended2;
- } else {
- // If the core variant is not set, then choose the
- // default values (see the compiler datasheet for
- // '--core' option).
- cpuCore = TargetPageOptions::CorePlain;
}
const QString cm = IarewUtils::flagValue(
@@ -119,7 +117,7 @@ struct TargetPageOptions final
codeModel = TargetPageOptions::CodeModelFar;
} else if (cm == QLatin1String("banked_ext2")) {
codeModel = TargetPageOptions::CodeModelBankedExtended2;
- } else {
+ } else if (cm.isEmpty()) {
// If the code model is not set, then choose the
// default values (see the compiler datasheet for
// '--code_model' option).
@@ -145,7 +143,7 @@ struct TargetPageOptions final
dataModel = TargetPageOptions::DataModelFarGeneric;
} else if (dm == QLatin1String("far")) {
dataModel = TargetPageOptions::DataModelFar;
- } else {
+ } else if (dm.isEmpty()) {
// If the data model is not set, then choose the
// default values (see the compiler datasheet for
// '--data_model' option).
@@ -172,26 +170,26 @@ struct TargetPageOptions final
const QString constPlace = IarewUtils::flagValue(
flags, QStringLiteral("--place_constants"))
.toLower();
- if (constPlace == QLatin1String("data")) {
+ // If this option is not set, then choose the
+ // default value (see the compiler datasheet for
+ // '--place_constants' option).
+ if (constPlace == QLatin1String("data") || constPlace.isEmpty()) {
constPlacement = TargetPageOptions::RamMemoryPlace;
} else if (constPlace == QLatin1String("data_rom")) {
constPlacement = TargetPageOptions::RomMemoryPlace;
} else if (constPlace == QLatin1String("code")) {
constPlacement = TargetPageOptions::CodeMemoryPlace;
- } else {
- // If this option is not set, then choose the
- // default value (see the compiler datasheet for
- // '--place_constants' option).
- constPlacement = TargetPageOptions::RamMemoryPlace;
}
-
const QString cc = IarewUtils::flagValue(
flags, QStringLiteral("--calling_convention")).toLower();
if (cc == QLatin1String("data_overlay")) {
callingConvention = TargetPageOptions::DataOverlayConvention;
} else if (cc == QLatin1String("idata_overlay")) {
callingConvention = TargetPageOptions::IDataOverlayConvention;
- } else if (cc == QLatin1String("idata_reentrant")) {
+ } else if (cc == QLatin1String("idata_reentrant") || cc.isEmpty()) {
+ // If this option is not set, then choose the
+ // default value (see the compiler datasheet for
+ // '--calling_convention' option).
callingConvention = TargetPageOptions::IDataReentrantConvention;
} else if (cc == QLatin1String("pdata_reentrant")) {
callingConvention = TargetPageOptions::PDataReentrantConvention;
@@ -199,11 +197,6 @@ struct TargetPageOptions final
callingConvention = TargetPageOptions::XDataReentrantConvention;
} else if (cc == QLatin1String("ext_stack_reentrant")) {
callingConvention = TargetPageOptions::ExtendedStackReentrantConvention;
- } else {
- // If this option is not set, then choose the
- // default value (see the compiler datasheet for
- // '--calling_convention' option).
- callingConvention = TargetPageOptions::IDataReentrantConvention;
}
}
@@ -237,7 +230,7 @@ struct TargetPageOptions final
}
const QString toolkitPath = IarewUtils::toolkitRootPath(qbsProduct);
- for (const QVariant &configPath : qAsConst(configPaths)) {
+ for (const QVariant &configPath : std::as_const(configPaths)) {
const QString fullConfigPath = configPath.toString();
// We interested only in a config paths shipped inside of a toolkit.
if (!fullConfigPath.startsWith(toolkitPath, Qt::CaseInsensitive))
@@ -446,13 +439,12 @@ struct DptrPageOptions final
case VisibilityIndex:
if (part == QLatin1String("shadowed"))
dptrVisibility = DptrPageOptions::DptrShadowed;
- else if (part == QLatin1String("separate"))
- dptrVisibility = DptrPageOptions::DptrSeparate;
- else
- // If this option is not set, then choose the
+ else if (part == QLatin1String("separate") || part.isEmpty()) {
+ // If this option is not set or set to "separate", then choose the
// default value (see the compiler datasheet for
// '--dptr' option).
dptrVisibility = DptrPageOptions::DptrSeparate;
+ }
break;
case SwitchMethodIndex:
if (part == QLatin1String("inc")) {
@@ -647,30 +639,22 @@ struct LibraryOptionsPageOptions final
Qt::CaseInsensitive)) {
const QString prop = flag.split(
QLatin1Char('=')).at(0).toLower();
+ // see the compiler datasheet for the '_formatted_write' option.
if (prop == QLatin1String("-e_large_write"))
printfFormatter = LibraryOptionsPageOptions::PrintfLargeFormatter;
else if (prop == QLatin1String("-e_medium_write"))
printfFormatter = LibraryOptionsPageOptions::PrintfMediumFormatter;
else if (prop == QLatin1String("-e_small_write"))
printfFormatter = LibraryOptionsPageOptions::PrintfSmallFormatter;
- else
- // If this option is not set, then choose the
- // default value (see the compiler datasheet for
- // '_formatted_write' option).
- printfFormatter = LibraryOptionsPageOptions::PrintfMediumFormatter;
} else if (flag.endsWith(QLatin1String("_formatted_read"),
Qt::CaseInsensitive)) {
const QString prop = flag.split(QLatin1Char('='))
.at(0).toLower();
+ // see the compiler datasheet for the '_formatted_read' option.
if (prop == QLatin1String("-e_large_read"))
scanfFormatter = LibraryOptionsPageOptions::ScanfLargeFormatter;
else if (prop == QLatin1String("-e_medium_read"))
scanfFormatter = LibraryOptionsPageOptions::ScanfMediumFormatter;
- else
- // If this option is not set, then choose the
- // default value (see the compiler datasheet for
- // '_formatted_read' option).
- scanfFormatter = LibraryOptionsPageOptions::ScanfMediumFormatter;
}
}
}
diff --git a/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp b/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp
index d99e15bb2..7b330ca7f 100644
--- a/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp
+++ b/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp
@@ -281,7 +281,7 @@ struct LibraryOptionsPageOptions final
else if (prop == QLatin1String("_printflarge"))
printfFormatter = PrintfLargeFormatter;
else if (prop == QLatin1String("_printflargenomb"))
- printfFormatter = PrintfLargeFormatter;
+ printfFormatter = PrintfLargeNoMultibytesFormatter;
else if (prop == QLatin1String("_printfsmall"))
printfFormatter = PrintfSmallFormatter;
else if (prop == QLatin1String("_printfsmallnomb"))
@@ -299,7 +299,7 @@ struct LibraryOptionsPageOptions final
else if (prop == QLatin1String("_scanflarge"))
scanfFormatter = ScanfLargeFormatter;
else if (prop == QLatin1String("_scanflargenomb"))
- scanfFormatter = ScanfLargeFormatter;
+ scanfFormatter = ScanfLargeNoMultibytesFormatter;
else if (prop == QLatin1String("_scanfsmall"))
scanfFormatter = ScanfSmallFormatter;
else if (prop == QLatin1String("_scanfsmallnomb"))
diff --git a/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp b/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp
index 9477bc36e..83766442b 100644
--- a/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp
+++ b/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp
@@ -205,7 +205,7 @@ struct LibraryOptionsPageOptions final
else if (prop == QLatin1String("_printffullnomb"))
printfFormatter = PrintfFullNoMultibytesFormatter;
else if (prop == QLatin1String("_printflarge"))
- printfFormatter = PrintfLargeFormatter;
+ printfFormatter = PrintfLargeNoMultibytesFormatter;
else if (prop == QLatin1String("_printflargenomb"))
printfFormatter = PrintfLargeFormatter;
else if (prop == QLatin1String("_printfsmall"))
@@ -223,7 +223,7 @@ struct LibraryOptionsPageOptions final
else if (prop == QLatin1String("_scanffullnomb"))
scanfFormatter = ScanfFullNoMultibytesFormatter;
else if (prop == QLatin1String("_scanflarge"))
- scanfFormatter = ScanfLargeFormatter;
+ scanfFormatter = ScanfLargeNoMultibytesFormatter;
else if (prop == QLatin1String("_scanflargenomb"))
scanfFormatter = ScanfLargeFormatter;
else if (prop == QLatin1String("_scanfsmall"))
diff --git a/src/plugins/generator/iarew/iarew.pri b/src/plugins/generator/iarew/iarew.pri
deleted file mode 100644
index 68a3593fa..000000000
--- a/src/plugins/generator/iarew/iarew.pri
+++ /dev/null
@@ -1 +0,0 @@
-qbsPluginTarget = iarewgenerator
diff --git a/src/plugins/generator/iarew/iarew.pro b/src/plugins/generator/iarew/iarew.pro
deleted file mode 100644
index 542449510..000000000
--- a/src/plugins/generator/iarew/iarew.pro
+++ /dev/null
@@ -1,131 +0,0 @@
-include(iarew.pri)
-include(../../plugins.pri)
-include(../../../shared/json/json.pri)
-
-QT = core
-
-# Plugin file.
-
-SOURCES += \
- $$PWD/iarewgeneratorplugin.cpp \
-
-# Common files.
-
-HEADERS += \
- $$PWD/iarewfileversionproperty.h \
- $$PWD/iarewgenerator.h \
- $$PWD/iarewoptionpropertygroup.h \
- $$PWD/iarewproject.h \
- $$PWD/iarewprojectwriter.h \
- $$PWD/iarewsettingspropertygroup.h \
- $$PWD/iarewsourcefilepropertygroup.h \
- $$PWD/iarewsourcefilespropertygroup.h \
- $$PWD/iarewtoolchainpropertygroup.h \
- $$PWD/iarewutils.h \
- $$PWD/iarewversioninfo.h \
- $$PWD/iarewworkspace.h \
- $$PWD/iarewworkspacewriter.h
-
-SOURCES += \
- $$PWD/iarewfileversionproperty.cpp \
- $$PWD/iarewgenerator.cpp \
- $$PWD/iarewoptionpropertygroup.cpp \
- $$PWD/iarewproject.cpp \
- $$PWD/iarewprojectwriter.cpp \
- $$PWD/iarewsettingspropertygroup.cpp \
- $$PWD/iarewsourcefilepropertygroup.cpp \
- $$PWD/iarewsourcefilespropertygroup.cpp \
- $$PWD/iarewtoolchainpropertygroup.cpp \
- $$PWD/iarewutils.cpp \
- $$PWD/iarewworkspace.cpp \
- $$PWD/iarewworkspacewriter.cpp
-
-# For ARM architecture.
-
-HEADERS += \
- $$PWD/archs/arm/armarchiversettingsgroup_v8.h \
- $$PWD/archs/arm/armassemblersettingsgroup_v8.h \
- $$PWD/archs/arm/armbuildconfigurationgroup_v8.h \
- $$PWD/archs/arm/armcompilersettingsgroup_v8.h \
- $$PWD/archs/arm/armgeneralsettingsgroup_v8.h \
- $$PWD/archs/arm/armlinkersettingsgroup_v8.h
-
-SOURCES += \
- $$PWD/archs/arm/armarchiversettingsgroup_v8.cpp \
- $$PWD/archs/arm/armassemblersettingsgroup_v8.cpp \
- $$PWD/archs/arm/armbuildconfigurationgroup_v8.cpp \
- $$PWD/archs/arm/armcompilersettingsgroup_v8.cpp \
- $$PWD/archs/arm/armgeneralsettingsgroup_v8.cpp \
- $$PWD/archs/arm/armlinkersettingsgroup_v8.cpp
-
-# For AVR architecture.
-
-HEADERS += \
- $$PWD/archs/avr/avrarchiversettingsgroup_v7.h \
- $$PWD/archs/avr/avrassemblersettingsgroup_v7.h \
- $$PWD/archs/avr/avrbuildconfigurationgroup_v7.h \
- $$PWD/archs/avr/avrcompilersettingsgroup_v7.h \
- $$PWD/archs/avr/avrgeneralsettingsgroup_v7.h \
- $$PWD/archs/avr/avrlinkersettingsgroup_v7.h
-
-SOURCES += \
- $$PWD/archs/avr/avrarchiversettingsgroup_v7.cpp \
- $$PWD/archs/avr/avrassemblersettingsgroup_v7.cpp \
- $$PWD/archs/avr/avrbuildconfigurationgroup_v7.cpp \
- $$PWD/archs/avr/avrcompilersettingsgroup_v7.cpp \
- $$PWD/archs/avr/avrgeneralsettingsgroup_v7.cpp \
- $$PWD/archs/avr/avrlinkersettingsgroup_v7.cpp
-
-# For MCS51 architecture.
-
-HEADERS += \
- $$PWD/archs/mcs51/mcs51archiversettingsgroup_v10.h \
- $$PWD/archs/mcs51/mcs51assemblersettingsgroup_v10.h \
- $$PWD/archs/mcs51/mcs51buildconfigurationgroup_v10.h \
- $$PWD/archs/mcs51/mcs51compilersettingsgroup_v10.h \
- $$PWD/archs/mcs51/mcs51generalsettingsgroup_v10.h \
- $$PWD/archs/mcs51/mcs51linkersettingsgroup_v10.h
-
-SOURCES += \
- $$PWD/archs/mcs51/mcs51archiversettingsgroup_v10.cpp \
- $$PWD/archs/mcs51/mcs51assemblersettingsgroup_v10.cpp \
- $$PWD/archs/mcs51/mcs51buildconfigurationgroup_v10.cpp \
- $$PWD/archs/mcs51/mcs51compilersettingsgroup_v10.cpp \
- $$PWD/archs/mcs51/mcs51generalsettingsgroup_v10.cpp \
- $$PWD/archs/mcs51/mcs51linkersettingsgroup_v10.cpp
-
-# For STM8 architecture.
-
-HEADERS += \
- $$PWD/archs/stm8/stm8archiversettingsgroup_v3.h \
- $$PWD/archs/stm8/stm8assemblersettingsgroup_v3.h \
- $$PWD/archs/stm8/stm8buildconfigurationgroup_v3.h \
- $$PWD/archs/stm8/stm8compilersettingsgroup_v3.h \
- $$PWD/archs/stm8/stm8generalsettingsgroup_v3.h \
- $$PWD/archs/stm8/stm8linkersettingsgroup_v3.h
-
-SOURCES += \
- $$PWD/archs/stm8/stm8archiversettingsgroup_v3.cpp \
- $$PWD/archs/stm8/stm8assemblersettingsgroup_v3.cpp \
- $$PWD/archs/stm8/stm8buildconfigurationgroup_v3.cpp \
- $$PWD/archs/stm8/stm8compilersettingsgroup_v3.cpp \
- $$PWD/archs/stm8/stm8generalsettingsgroup_v3.cpp \
- $$PWD/archs/stm8/stm8linkersettingsgroup_v3.cpp
-
-# For MSP430 architecture.
-
-HEADERS += \
- $$PWD/archs/msp430/msp430archiversettingsgroup_v7.h \
- $$PWD/archs/msp430/msp430assemblersettingsgroup_v7.h \
- $$PWD/archs/msp430/msp430buildconfigurationgroup_v7.h \
- $$PWD/archs/msp430/msp430compilersettingsgroup_v7.h \
- $$PWD/archs/msp430/msp430generalsettingsgroup_v7.h \
- $$PWD/archs/msp430/msp430linkersettingsgroup_v7.h
-
-SOURCES += \
- $$PWD/archs/msp430/msp430archiversettingsgroup_v7.cpp \
- $$PWD/archs/msp430/msp430assemblersettingsgroup_v7.cpp \
- $$PWD/archs/msp430/msp430buildconfigurationgroup_v7.cpp \
- $$PWD/archs/msp430/msp430compilersettingsgroup_v7.cpp \
- $$PWD/archs/msp430/msp430generalsettingsgroup_v7.cpp \
- $$PWD/archs/msp430/msp430linkersettingsgroup_v7.cpp
diff --git a/src/plugins/generator/iarew/iarewutils.cpp b/src/plugins/generator/iarew/iarewutils.cpp
index 7196a391c..9d39ab264 100644
--- a/src/plugins/generator/iarew/iarewutils.cpp
+++ b/src/plugins/generator/iarew/iarewutils.cpp
@@ -105,9 +105,9 @@ QString flagValue(const QStringList &flags, const QString &flagKey)
// Check that option is in form of 'flagKey=<flagValue>'.
if (flagIt->contains(QLatin1Char('='))) {
value = flagIt->split(QLatin1Char('=')).at(1).trimmed();
- } else if (flagKey.count() < flagIt->count()) {
+ } else if (flagKey.size() < flagIt->size()) {
// In this case an option is in form of 'flagKey<flagValue>'.
- value = flagIt->mid(flagKey.count()).trimmed();
+ value = flagIt->mid(flagKey.size()).trimmed();
} else {
// In this case an option is in form of 'flagKey <flagValue>'.
++flagIt;