aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-11-27 11:46:58 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2020-11-30 11:41:30 +0000
commitf772f098531f8218eb6c897519e3c6ce78fcc9ae (patch)
treee4061baf3fb25c81e385714733ac6ab9cb478469 /src/plugins/projectexplorer
parentbd17dd445befa6c15dca9a52da2613697f6e3b16 (diff)
ProjectExplorer: Remove unused virtual Toolchain::predefinedMacros()
Change-Id: I24e515ba1767c72cbf43ae250908f571f0229e9f Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/customtoolchain.cpp5
-rw-r--r--src/plugins/projectexplorer/customtoolchain.h1
-rw-r--r--src/plugins/projectexplorer/gcctoolchain.cpp27
-rw-r--r--src/plugins/projectexplorer/gcctoolchain.h1
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.cpp5
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.h1
-rw-r--r--src/plugins/projectexplorer/toolchain.h1
-rw-r--r--src/plugins/projectexplorer/toolchainsettingsaccessor.cpp1
8 files changed, 11 insertions, 31 deletions
diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp
index e18becd979..ab115a2dbd 100644
--- a/src/plugins/projectexplorer/customtoolchain.cpp
+++ b/src/plugins/projectexplorer/customtoolchain.cpp
@@ -123,11 +123,6 @@ ToolChain::MacroInspectionRunner CustomToolChain::createMacroInspectionRunner()
};
}
-Macros CustomToolChain::predefinedMacros(const QStringList &cxxflags) const
-{
- return createMacroInspectionRunner()(cxxflags).macros;
-}
-
Utils::LanguageExtensions CustomToolChain::languageExtensions(const QStringList &) const
{
return LanguageExtension::None;
diff --git a/src/plugins/projectexplorer/customtoolchain.h b/src/plugins/projectexplorer/customtoolchain.h
index bd1ccd367f..5bc7250e3f 100644
--- a/src/plugins/projectexplorer/customtoolchain.h
+++ b/src/plugins/projectexplorer/customtoolchain.h
@@ -70,7 +70,6 @@ public:
bool isValid() const override;
MacroInspectionRunner createMacroInspectionRunner() const override;
- Macros predefinedMacros(const QStringList &cxxflags) const override;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override;
Utils::WarningFlags warningFlags(const QStringList &cxxflags) const override;
const Macros &rawPredefinedMacros() const;
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp
index b104863c7e..eaa93a4b05 100644
--- a/src/plugins/projectexplorer/gcctoolchain.cpp
+++ b/src/plugins/projectexplorer/gcctoolchain.cpp
@@ -450,7 +450,16 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con
MacrosCache macroCache = predefinedMacrosCache();
Utils::Id lang = language();
- // This runner must be thread-safe!
+ /*
+ * Asks compiler for set of predefined macros
+ * flags are the compiler flags collected from project settings
+ * returns the list of defines, one per line, e.g. "#define __GXX_WEAK__ 1"
+ * Note: changing compiler flags sometimes changes macros set, e.g. -fopenmp
+ * adds _OPENMP macro, for full list of macro search by word "when" on this page:
+ * http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
+ *
+ * This runner must be thread-safe!
+ */
return [env, compilerCommand, platformCodeGenFlags, reinterpretOptions, macroCache, lang]
(const QStringList &flags) {
QStringList allFlags = platformCodeGenFlags + flags; // add only cxxflags is empty?
@@ -481,20 +490,6 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con
}
/**
- * @brief Asks compiler for set of predefined macros
- * @param cxxflags - compiler flags collected from project settings
- * @return defines list, one per line, e.g. "#define __GXX_WEAK__ 1"
- *
- * @note changing compiler flags sometimes changes macros set, e.g. -fopenmp
- * adds _OPENMP macro, for full list of macro search by word "when" on this page:
- * http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
- */
-ProjectExplorer::Macros GccToolChain::predefinedMacros(const QStringList &cxxflags) const
-{
- return createMacroInspectionRunner()(cxxflags).macros;
-}
-
-/**
* @brief Parses gcc flags -std=*, -fopenmp, -fms-extensions.
* @see http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
*/
@@ -874,7 +869,7 @@ GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const
{
Environment env = Environment::systemEnvironment();
addToEnvironment(env);
- ProjectExplorer::Macros macros = predefinedMacros(QStringList());
+ ProjectExplorer::Macros macros = createMacroInspectionRunner()({}).macros;
return guessGccAbi(findLocalCompiler(m_compilerCommand, env),
env.toStringList(),
macros,
diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h
index 1de34ce655..d3d05cc611 100644
--- a/src/plugins/projectexplorer/gcctoolchain.h
+++ b/src/plugins/projectexplorer/gcctoolchain.h
@@ -84,7 +84,6 @@ public:
Utils::WarningFlags warningFlags(const QStringList &cflags) const override;
MacroInspectionRunner createMacroInspectionRunner() const override;
- Macros predefinedMacros(const QStringList &cxxflags) const override;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &env) const override;
HeaderPaths builtInHeaderPaths(const QStringList &flags,
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index 4df88de60b..c7ae6943a6 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -1004,11 +1004,6 @@ ToolChain::MacroInspectionRunner MsvcToolChain::createMacroInspectionRunner() co
};
}
-Macros MsvcToolChain::predefinedMacros(const QStringList &cxxflags) const
-{
- return createMacroInspectionRunner()(cxxflags).macros;
-}
-
Utils::LanguageExtensions MsvcToolChain::languageExtensions(const QStringList &cxxflags) const
{
using Utils::LanguageExtension;
diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h
index 149e5d37b8..811d563070 100644
--- a/src/plugins/projectexplorer/msvctoolchain.h
+++ b/src/plugins/projectexplorer/msvctoolchain.h
@@ -77,7 +77,6 @@ public:
std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override;
MacroInspectionRunner createMacroInspectionRunner() const override;
- Macros predefinedMacros(const QStringList &cxxflags) const override;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override;
Utils::WarningFlags warningFlags(const QStringList &cflags) const override;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h
index 9eed36d2a0..141be73990 100644
--- a/src/plugins/projectexplorer/toolchain.h
+++ b/src/plugins/projectexplorer/toolchain.h
@@ -134,7 +134,6 @@ public:
// A MacroInspectionRunner is created in the ui thread and runs in another thread.
using MacroInspectionRunner = std::function<MacroInspectionReport(const QStringList &cxxflags)>;
virtual MacroInspectionRunner createMacroInspectionRunner() const = 0;
- virtual Macros predefinedMacros(const QStringList &cxxflags) const = 0;
// A BuiltInHeaderPathsRunner is created in the ui thread and runs in another thread.
using BuiltInHeaderPathsRunner = std::function<HeaderPaths(
diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp
index da8851a9c2..870d7b6159 100644
--- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp
+++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp
@@ -315,7 +315,6 @@ public:
Abi targetAbi() const override { return Abi::hostAbi(); }
bool isValid() const override { return m_valid; }
MacroInspectionRunner createMacroInspectionRunner() const override { return MacroInspectionRunner(); }
- Macros predefinedMacros(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags) return Macros(); }
LanguageExtensions languageExtensions(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags) return LanguageExtension::None; }
WarningFlags warningFlags(const QStringList &cflags) const override { Q_UNUSED(cflags) return WarningFlags::NoWarnings; }
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const override { return BuiltInHeaderPathsRunner(); }