From 8b85b095b256ccdf2e50ad7bb9ab22b1b1c32d3d Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 25 Jan 2018 15:20:47 +0100 Subject: Clang: Rename defineName in macroName Change-Id: Iaf8da991032e5ed4726384c051290a77887351fa Reviewed-by: Ivan Donchevskii --- .../source/clangrefactoringbackend-source.pri | 4 +- .../source/collectmacrospreprocessorcallbacks.h | 70 +++++++++++----------- .../source/collectmacrossourcefilecallbacks.cpp | 2 +- .../source/collectmacrossourcefilecallbacks.h | 8 +-- .../source/storagesqlitestatementfactory.h | 26 ++++---- .../source/symbolindexer.cpp | 2 +- .../source/symbolscollector.cpp | 4 +- .../source/symbolscollector.h | 2 +- .../source/symbolscollectorinterface.h | 4 +- .../clangrefactoringbackend/source/symbolstorage.h | 14 ++--- .../source/symbolstorageinterface.h | 4 +- .../clangrefactoringbackend/source/useddefines.h | 67 --------------------- .../clangrefactoringbackend/source/usedmacro.h | 67 +++++++++++++++++++++ 13 files changed, 137 insertions(+), 137 deletions(-) delete mode 100644 src/tools/clangrefactoringbackend/source/useddefines.h create mode 100644 src/tools/clangrefactoringbackend/source/usedmacro.h (limited to 'src/tools/clangrefactoringbackend/source') diff --git a/src/tools/clangrefactoringbackend/source/clangrefactoringbackend-source.pri b/src/tools/clangrefactoringbackend/source/clangrefactoringbackend-source.pri index 75739845cc..f1c1f95957 100644 --- a/src/tools/clangrefactoringbackend/source/clangrefactoringbackend-source.pri +++ b/src/tools/clangrefactoringbackend/source/clangrefactoringbackend-source.pri @@ -14,8 +14,8 @@ HEADERS += \ $$PWD/symbolindexinginterface.h \ $$PWD/collectmacrospreprocessorcallbacks.h \ $$PWD/projectpartentry.h \ - $$PWD/useddefines.h \ - $$PWD/symbolsvisitorbase.h + $$PWD/symbolsvisitorbase.h \ + $$PWD/usedmacro.h !isEmpty(LIBTOOLING_LIBS) { SOURCES += \ diff --git a/src/tools/clangrefactoringbackend/source/collectmacrospreprocessorcallbacks.h b/src/tools/clangrefactoringbackend/source/collectmacrospreprocessorcallbacks.h index 62a406f0da..972d3fc772 100644 --- a/src/tools/clangrefactoringbackend/source/collectmacrospreprocessorcallbacks.h +++ b/src/tools/clangrefactoringbackend/source/collectmacrospreprocessorcallbacks.h @@ -29,7 +29,7 @@ #include "sourcelocationsutils.h" #include "sourcelocationentry.h" #include "symbolentry.h" -#include "useddefines.h" +#include "usedmacro.h" #include #include @@ -47,7 +47,7 @@ public: CollectMacrosPreprocessorCallbacks(SymbolEntries &symbolEntries, SourceLocationEntries &sourceLocationEntries, FilePathIds &sourceFiles, - UsedDefines &usedDefines, + UsedMacros &usedMacros, FilePathCachingInterface &filePathCache, const clang::SourceManager &sourceManager, std::shared_ptr &&preprocessor) @@ -56,7 +56,7 @@ public: m_symbolEntries(symbolEntries), m_sourceLocationEntries(sourceLocationEntries), m_sourceFiles(sourceFiles), - m_usedDefines(usedDefines) + m_usedMacros(usedMacros) { } @@ -87,7 +87,7 @@ public: const clang::Token ¯oNameToken, const clang::MacroDefinition ¯oDefinition) override { - addUsedDefine(macroNameToken, macroDefinition); + addUsedMacro(macroNameToken, macroDefinition); addMacroAsSymbol(macroNameToken, firstMacroInfo(macroDefinition.getLocalDirective()), SymbolType::MacroUsage); @@ -97,7 +97,7 @@ public: const clang::Token ¯oNameToken, const clang::MacroDefinition ¯oDefinition) override { - addUsedDefine( macroNameToken, macroDefinition); + addUsedMacro( macroNameToken, macroDefinition); addMacroAsSymbol(macroNameToken, firstMacroInfo(macroDefinition.getLocalDirective()), SymbolType::MacroUsage); @@ -107,7 +107,7 @@ public: const clang::MacroDefinition ¯oDefinition, clang::SourceRange) override { - addUsedDefine(macroNameToken, macroDefinition); + addUsedMacro(macroNameToken, macroDefinition); addMacroAsSymbol(macroNameToken, firstMacroInfo(macroDefinition.getLocalDirective()), SymbolType::MacroUsage); @@ -133,7 +133,7 @@ public: clang::SourceRange, const clang::MacroArgs *) override { - addUsedDefine(macroNameToken, macroDefinition); + addUsedMacro(macroNameToken, macroDefinition); addMacroAsSymbol(macroNameToken, firstMacroInfo(macroDefinition.getLocalDirective()), SymbolType::MacroUsage); @@ -142,63 +142,63 @@ public: void EndOfMainFile() override { filterOutHeaderGuards(); - mergeUsedDefines(); + mergeUsedMacros(); filterOutExports(); } void filterOutHeaderGuards() { - auto partitionPoint = std::stable_partition(m_maybeUsedDefines.begin(), - m_maybeUsedDefines.end(), - [&] (const UsedDefine &usedDefine) { - llvm::StringRef id{usedDefine.defineName.data(), usedDefine.defineName.size()}; + auto partitionPoint = std::stable_partition(m_maybeUsedMacros.begin(), + m_maybeUsedMacros.end(), + [&] (const UsedMacro &usedMacro) { + llvm::StringRef id{usedMacro.macroName.data(), usedMacro.macroName.size()}; clang::IdentifierInfo &identifierInfo = m_preprocessor->getIdentifierTable().get(id); clang::MacroInfo *macroInfo = m_preprocessor->getMacroInfo(&identifierInfo); return !macroInfo || !macroInfo->isUsedForHeaderGuard(); }); - m_maybeUsedDefines.erase(partitionPoint, m_maybeUsedDefines.end()); + m_maybeUsedMacros.erase(partitionPoint, m_maybeUsedMacros.end()); } void filterOutExports() { - auto partitionPoint = std::stable_partition(m_usedDefines.begin(), - m_usedDefines.end(), - [&] (const UsedDefine &usedDefine) { - return !usedDefine.defineName.contains("EXPORT"); + auto partitionPoint = std::stable_partition(m_usedMacros.begin(), + m_usedMacros.end(), + [&] (const UsedMacro &usedMacro) { + return !usedMacro.macroName.contains("EXPORT"); }); - m_usedDefines.erase(partitionPoint, m_usedDefines.end()); + m_usedMacros.erase(partitionPoint, m_usedMacros.end()); } - void mergeUsedDefines() + void mergeUsedMacros() { - m_usedDefines.reserve(m_usedDefines.size() + m_maybeUsedDefines.size()); - auto insertionPoint = m_usedDefines.insert(m_usedDefines.end(), - m_maybeUsedDefines.begin(), - m_maybeUsedDefines.end()); - std::inplace_merge(m_usedDefines.begin(), insertionPoint, m_usedDefines.end()); + m_usedMacros.reserve(m_usedMacros.size() + m_maybeUsedMacros.size()); + auto insertionPoint = m_usedMacros.insert(m_usedMacros.end(), + m_maybeUsedMacros.begin(), + m_maybeUsedMacros.end()); + std::inplace_merge(m_usedMacros.begin(), insertionPoint, m_usedMacros.end()); } - static void addUsedDefine(UsedDefine &&usedDefine, UsedDefines &usedDefines) + static void addUsedMacro(UsedMacro &&usedMacro, UsedMacros &usedMacros) { - auto found = std::lower_bound(usedDefines.begin(), - usedDefines.end(), usedDefine); + auto found = std::lower_bound(usedMacros.begin(), + usedMacros.end(), usedMacro); - if (found == usedDefines.end() || *found != usedDefine) - usedDefines.insert(found, std::move(usedDefine)); + if (found == usedMacros.end() || *found != usedMacro) + usedMacros.insert(found, std::move(usedMacro)); } - void addUsedDefine(const clang::Token ¯oNameToken, + void addUsedMacro(const clang::Token ¯oNameToken, const clang::MacroDefinition ¯oDefinition) { clang::MacroInfo *macroInfo = macroDefinition.getMacroInfo(); - UsedDefine usedDefine{macroNameToken.getIdentifierInfo()->getName(), + UsedMacro usedMacro{macroNameToken.getIdentifierInfo()->getName(), filePathId(macroNameToken.getLocation())}; if (macroInfo) - addUsedDefine(std::move(usedDefine), m_usedDefines); + addUsedMacro(std::move(usedMacro), m_usedMacros); else - addUsedDefine(std::move(usedDefine), m_maybeUsedDefines); + addUsedMacro(std::move(usedMacro), m_maybeUsedMacros); } static const clang::MacroInfo *firstMacroInfo(const clang::MacroDirective *macroDirective) @@ -258,12 +258,12 @@ public: } private: - UsedDefines m_maybeUsedDefines; + UsedMacros m_maybeUsedMacros; std::shared_ptr m_preprocessor; SymbolEntries &m_symbolEntries; SourceLocationEntries &m_sourceLocationEntries; FilePathIds &m_sourceFiles; - UsedDefines &m_usedDefines; + UsedMacros &m_usedMacros; bool m_skipInclude = false; }; diff --git a/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.cpp b/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.cpp index 317d93bdc3..e7891b0b78 100644 --- a/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.cpp +++ b/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.cpp @@ -37,7 +37,7 @@ bool CollectMacrosSourceFileCallbacks::handleBeginSource(clang::CompilerInstance m_symbolEntries, m_sourceLocationEntries, m_sourceFiles, - m_usedDefines, + m_usedMacros, m_filePathCache, compilerInstance.getSourceManager(), compilerInstance.getPreprocessorPtr()); diff --git a/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.h b/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.h index 96429696d5..eeffb45cf3 100644 --- a/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.h +++ b/src/tools/clangrefactoringbackend/source/collectmacrossourcefilecallbacks.h @@ -27,7 +27,7 @@ #include "sourcelocationentry.h" #include "symbolentry.h" -#include "useddefines.h" +#include "usedmacro.h" #include @@ -64,14 +64,14 @@ public: m_sourceFiles.clear(); } - const UsedDefines &usedDefines() const + const UsedMacros &usedMacros() const { - return m_usedDefines; + return m_usedMacros; } private: FilePathIds m_sourceFiles; - UsedDefines m_usedDefines; + UsedMacros m_usedMacros; SymbolEntries &m_symbolEntries; SourceLocationEntries &m_sourceLocationEntries; FilePathCachingInterface &m_filePathCache; diff --git a/src/tools/clangrefactoringbackend/source/storagesqlitestatementfactory.h b/src/tools/clangrefactoringbackend/source/storagesqlitestatementfactory.h index 4109fb0511..ec34a43635 100644 --- a/src/tools/clangrefactoringbackend/source/storagesqlitestatementfactory.h +++ b/src/tools/clangrefactoringbackend/source/storagesqlitestatementfactory.h @@ -81,14 +81,14 @@ public: return table; } - Sqlite::Table createNewUsedDefinesTable() const + Sqlite::Table createNewUsedMacrosTable() const { Sqlite::Table table; - table.setName("newUsedDefines"); + table.setName("newUsedMacros"); table.setUseTemporaryTable(true); const Sqlite::Column &sourceIdColumn = table.addColumn("sourceId", Sqlite::ColumnType::Integer); - const Sqlite::Column &defineNameColumn = table.addColumn("defineName", Sqlite::ColumnType::Text); - table.addIndex({sourceIdColumn, defineNameColumn}); + const Sqlite::Column ¯oNameColumn = table.addColumn("macroName", Sqlite::ColumnType::Text); + table.addIndex({sourceIdColumn, macroNameColumn}); table.initialize(database); @@ -100,7 +100,7 @@ public: Database &database; Sqlite::Table newSymbolsTablet{createNewSymbolsTable()}; Sqlite::Table newLocationsTable{createNewLocationsTable()}; - Sqlite::Table newUsedDefineTable{createNewUsedDefinesTable()}; + Sqlite::Table newUsedMacroTable{createNewUsedMacrosTable()}; WriteStatement insertSymbolsToNewSymbolsStatement{ "INSERT INTO newSymbols(temporarySymbolId, usr, symbolName) VALUES(?,?,?)", database}; @@ -166,20 +166,20 @@ public: "SELECT compilerArguments FROM projectParts WHERE projectPartId = (SELECT projectPartId FROM projectPartsSources WHERE sourceId = ?)", database }; - WriteStatement insertIntoNewUsedDefinesStatement{ - "INSERT INTO newUsedDefines(sourceId, defineName) VALUES (?,?)", + WriteStatement insertIntoNewUsedMacrosStatement{ + "INSERT INTO newUsedMacros(sourceId, macroName) VALUES (?,?)", database }; - WriteStatement syncNewUsedDefinesStatement{ - "INSERT INTO usedDefines(sourceId, defineName) SELECT sourceId, defineName FROM newUsedDefines WHERE NOT EXISTS (SELECT sourceId FROM usedDefines WHERE usedDefines.sourceId == newUsedDefines.sourceId AND usedDefines.defineName == newUsedDefines.defineName)", + WriteStatement syncNewUsedMacrosStatement{ + "INSERT INTO usedMacros(sourceId, macroName) SELECT sourceId, macroName FROM newUsedMacros WHERE NOT EXISTS (SELECT sourceId FROM usedMacros WHERE usedMacros.sourceId == newUsedMacros.sourceId AND usedMacros.macroName == newUsedMacros.macroName)", database }; - WriteStatement deleteOutdatedUsedDefinesStatement{ - "DELETE FROM usedDefines WHERE sourceId IN (SELECT sourceId FROM newUsedDefines) AND NOT EXISTS (SELECT sourceId FROM newUsedDefines WHERE newUsedDefines.sourceId == usedDefines.sourceId AND newUsedDefines.defineName == usedDefines.defineName)", + WriteStatement deleteOutdatedUsedMacrosStatement{ + "DELETE FROM usedMacros WHERE sourceId IN (SELECT sourceId FROM newUsedMacros) AND NOT EXISTS (SELECT sourceId FROM newUsedMacros WHERE newUsedMacros.sourceId == usedMacros.sourceId AND newUsedMacros.macroName == usedMacros.macroName)", database }; - WriteStatement deleteNewUsedDefinesTableStatement{ - "DELETE FROM newUsedDefines", + WriteStatement deleteNewUsedMacrosTableStatement{ + "DELETE FROM newUsedMacros", database }; }; diff --git a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp index 2591ca802c..1c177c5101 100644 --- a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp +++ b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp @@ -68,7 +68,7 @@ void SymbolIndexer::updateProjectPart(V2::ProjectPartContainer &&projectPart, m_symbolStorage.updateProjectPartSources(projectPart.projectPartId(), m_symbolsCollector.sourceFiles()); - m_symbolStorage.insertOrUpdateUsedDefines(m_symbolsCollector.usedDefines()); + m_symbolStorage.insertOrUpdateUsedMacros(m_symbolsCollector.usedMacros()); transaction.commit(); diff --git a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp index dd16cdfd8e..1433424588 100644 --- a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp +++ b/src/tools/clangrefactoringbackend/source/symbolscollector.cpp @@ -77,9 +77,9 @@ const FilePathIds &SymbolsCollector::sourceFiles() const return m_collectMacrosSourceFileCallbacks.sourceFiles(); } -const UsedDefines &SymbolsCollector::usedDefines() const +const UsedMacros &SymbolsCollector::usedMacros() const { - return m_collectMacrosSourceFileCallbacks.usedDefines(); + return m_collectMacrosSourceFileCallbacks.usedMacros(); } } // namespace ClangBackEnd diff --git a/src/tools/clangrefactoringbackend/source/symbolscollector.h b/src/tools/clangrefactoringbackend/source/symbolscollector.h index 5347de13c4..a46b783a85 100644 --- a/src/tools/clangrefactoringbackend/source/symbolscollector.h +++ b/src/tools/clangrefactoringbackend/source/symbolscollector.h @@ -51,7 +51,7 @@ public: const SymbolEntries &symbols() const override; const SourceLocationEntries &sourceLocations() const override; const FilePathIds &sourceFiles() const override; - const UsedDefines &usedDefines() const override; + const UsedMacros &usedMacros() const override; private: ClangTool m_clangTool; diff --git a/src/tools/clangrefactoringbackend/source/symbolscollectorinterface.h b/src/tools/clangrefactoringbackend/source/symbolscollectorinterface.h index b8438d57e0..b0c6b78a9f 100644 --- a/src/tools/clangrefactoringbackend/source/symbolscollectorinterface.h +++ b/src/tools/clangrefactoringbackend/source/symbolscollectorinterface.h @@ -27,7 +27,7 @@ #include "symbolentry.h" #include "sourcelocationentry.h" -#include "useddefines.h" +#include "usedmacro.h" #include @@ -53,7 +53,7 @@ public: virtual const SymbolEntries &symbols() const = 0; virtual const SourceLocationEntries &sourceLocations() const = 0; virtual const FilePathIds &sourceFiles() const = 0; - virtual const UsedDefines &usedDefines() const = 0; + virtual const UsedMacros &usedMacros() const = 0; }; } // namespace ClangBackEnd diff --git a/src/tools/clangrefactoringbackend/source/symbolstorage.h b/src/tools/clangrefactoringbackend/source/symbolstorage.h index 2a86746cde..19f3637bce 100644 --- a/src/tools/clangrefactoringbackend/source/symbolstorage.h +++ b/src/tools/clangrefactoringbackend/source/symbolstorage.h @@ -81,15 +81,15 @@ public: } } - void insertOrUpdateUsedDefines(const UsedDefines &usedDefines) override + void insertOrUpdateUsedMacros(const UsedMacros &usedMacros) override { - WriteStatement &insertStatement = m_statementFactory.insertIntoNewUsedDefinesStatement; - for (const UsedDefine &usedDefine : usedDefines) - insertStatement.write(usedDefine.filePathId.filePathId, usedDefine.defineName); + WriteStatement &insertStatement = m_statementFactory.insertIntoNewUsedMacrosStatement; + for (const UsedMacro &usedMacro : usedMacros) + insertStatement.write(usedMacro.filePathId.filePathId, usedMacro.macroName); - m_statementFactory.syncNewUsedDefinesStatement.execute(); - m_statementFactory.deleteOutdatedUsedDefinesStatement.execute(); - m_statementFactory.deleteNewUsedDefinesTableStatement.execute(); + m_statementFactory.syncNewUsedMacrosStatement.execute(); + m_statementFactory.deleteOutdatedUsedMacrosStatement.execute(); + m_statementFactory.deleteNewUsedMacrosTableStatement.execute(); } void updateProjectPartSources(Utils::SmallStringView projectPartName, diff --git a/src/tools/clangrefactoringbackend/source/symbolstorageinterface.h b/src/tools/clangrefactoringbackend/source/symbolstorageinterface.h index 7c58d2fbde..38a76029fa 100644 --- a/src/tools/clangrefactoringbackend/source/symbolstorageinterface.h +++ b/src/tools/clangrefactoringbackend/source/symbolstorageinterface.h @@ -28,7 +28,7 @@ #include "projectpartentry.h" #include "sourcelocationentry.h" #include "symbolentry.h" -#include "useddefines.h" +#include "usedmacro.h" #include @@ -48,7 +48,7 @@ public: const Utils::SmallStringVector &commandLineArguments) = 0; virtual void updateProjectPartSources(Utils::SmallStringView projectPartName, const FilePathIds &sourceFilePathIds) = 0; - virtual void insertOrUpdateUsedDefines(const UsedDefines &usedDefines) = 0; + virtual void insertOrUpdateUsedMacros(const UsedMacros &usedMacros) = 0; }; } // namespace ClangBackEnd diff --git a/src/tools/clangrefactoringbackend/source/useddefines.h b/src/tools/clangrefactoringbackend/source/useddefines.h deleted file mode 100644 index 64e9b8d7e6..0000000000 --- a/src/tools/clangrefactoringbackend/source/useddefines.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include - -#include - -#include - -namespace ClangBackEnd { - -class UsedDefine -{ -public: - constexpr UsedDefine() = default; - UsedDefine(Utils::SmallStringView defineName, FilePathId filePathId) - : defineName(defineName), - filePathId(filePathId) - {} - - friend bool operator<(const UsedDefine &first, const UsedDefine &second) - { - return std::tie(first.filePathId, first.defineName) - < std::tie(second.filePathId, second.defineName); - } - - friend bool operator==(const UsedDefine &first, const UsedDefine &second) - { - return first.filePathId == second.filePathId && first.defineName == second.defineName; - } - - friend bool operator!=(const UsedDefine &first, const UsedDefine &second) - { - return !(first == second); - } -public: - Utils::SmallString defineName; - FilePathId filePathId; -}; - -using UsedDefines = std::vector; - -} // ClangBackEnd diff --git a/src/tools/clangrefactoringbackend/source/usedmacro.h b/src/tools/clangrefactoringbackend/source/usedmacro.h new file mode 100644 index 0000000000..2c3588da7e --- /dev/null +++ b/src/tools/clangrefactoringbackend/source/usedmacro.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include + +#include + +#include + +namespace ClangBackEnd { + +class UsedMacro +{ +public: + constexpr UsedMacro() = default; + UsedMacro(Utils::SmallStringView macroName, FilePathId filePathId) + : macroName(macroName), + filePathId(filePathId) + {} + + friend bool operator<(const UsedMacro &first, const UsedMacro &second) + { + return std::tie(first.filePathId, first.macroName) + < std::tie(second.filePathId, second.macroName); + } + + friend bool operator==(const UsedMacro &first, const UsedMacro &second) + { + return first.filePathId == second.filePathId && first.macroName == second.macroName; + } + + friend bool operator!=(const UsedMacro &first, const UsedMacro &second) + { + return !(first == second); + } +public: + Utils::SmallString macroName; + FilePathId filePathId; +}; + +using UsedMacros = std::vector; + +} // ClangBackEnd -- cgit v1.2.1