Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 711788 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/plugins/clangformat/clangformatutils.cpp (+8 lines)
Lines 57-63 static clang::format::FormatStyle qtcStyle() Link Here
57
    style.AlignOperands = true;
57
    style.AlignOperands = true;
58
    style.AlignTrailingComments = true;
58
    style.AlignTrailingComments = true;
59
    style.AllowAllParametersOfDeclarationOnNextLine = true;
59
    style.AllowAllParametersOfDeclarationOnNextLine = true;
60
#if LLVM_VERSION_MAJOR >= 10
61
    style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
62
#else
60
    style.AllowShortBlocksOnASingleLine = false;
63
    style.AllowShortBlocksOnASingleLine = false;
64
#endif
61
    style.AllowShortCaseLabelsOnASingleLine = false;
65
    style.AllowShortCaseLabelsOnASingleLine = false;
62
    style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
66
    style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
63
#if LLVM_VERSION_MAJOR >= 9
67
#if LLVM_VERSION_MAJOR >= 9
Lines 72-78 static clang::format::FormatStyle qtcStyle() Link Here
72
    style.BinPackArguments = false;
76
    style.BinPackArguments = false;
73
    style.BinPackParameters = false;
77
    style.BinPackParameters = false;
74
    style.BraceWrapping.AfterClass = true;
78
    style.BraceWrapping.AfterClass = true;
79
#if LLVM_VERSION_MAJOR >= 10
80
    style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never;
81
#else
75
    style.BraceWrapping.AfterControlStatement = false;
82
    style.BraceWrapping.AfterControlStatement = false;
83
#endif
76
    style.BraceWrapping.AfterEnum = false;
84
    style.BraceWrapping.AfterEnum = false;
77
    style.BraceWrapping.AfterFunction = true;
85
    style.BraceWrapping.AfterFunction = true;
78
    style.BraceWrapping.AfterNamespace = false;
86
    style.BraceWrapping.AfterNamespace = false;
(-)a/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h (-1 / +16 lines)
Lines 60-65 public: Link Here
60
                                                                    diagnosticConsumer);
60
                                                                    diagnosticConsumer);
61
    }
61
    }
62
62
63
#if LLVM_VERSION_MAJOR >= 10
64
    std::unique_ptr<clang::FrontendAction> create() override
65
    {
66
        return std::make_unique<CollectBuildDependencyAction>(
67
                    m_buildDependency,
68
                    m_filePathCache,
69
                    m_excludedIncludeUIDs,
70
                    m_alreadyIncludedFileUIDs);
71
    }
72
#else
63
    clang::FrontendAction *create() override
73
    clang::FrontendAction *create() override
64
    {
74
    {
65
        return new CollectBuildDependencyAction(m_buildDependency,
75
        return new CollectBuildDependencyAction(m_buildDependency,
Lines 67-72 public: Link Here
67
                                                m_excludedIncludeUIDs,
77
                                                m_excludedIncludeUIDs,
68
                                                m_alreadyIncludedFileUIDs);
78
                                                m_alreadyIncludedFileUIDs);
69
    }
79
    }
80
#endif
70
81
71
    std::vector<uint> generateExcludedIncludeFileUIDs(clang::FileManager &fileManager) const
82
    std::vector<uint> generateExcludedIncludeFileUIDs(clang::FileManager &fileManager) const
72
    {
83
    {
Lines 77-83 public: Link Here
77
            NativeFilePath nativeFilePath{filePath};
88
            NativeFilePath nativeFilePath{filePath};
78
            const clang::FileEntry *file = fileManager.getFile({nativeFilePath.path().data(),
89
            const clang::FileEntry *file = fileManager.getFile({nativeFilePath.path().data(),
79
                                                                nativeFilePath.path().size()},
90
                                                                nativeFilePath.path().size()},
80
                                                               true);
91
                                                               true)
92
#if LLVM_VERSION_MAJOR >= 10
93
                    .get()
94
#endif
95
                    ;
81
96
82
            if (file)
97
            if (file)
83
                fileUIDs.push_back(file->getUID());
98
                fileUIDs.push_back(file->getUID());
(-)a/src/tools/clangpchmanagerbackend/source/collectusedmacroactionfactory.h (+12 lines)
Lines 61-66 public: Link Here
61
                                                                    diagnosticConsumer);
61
                                                                    diagnosticConsumer);
62
    }
62
    }
63
63
64
#if LLVM_VERSION_MAJOR >= 10
65
    std::unique_ptr<clang::FrontendAction> create() override
66
    {
67
        return std::make_unique<CollectUsedMacrosAction>(
68
                    m_usedMacros,
69
                    m_filePathCache,
70
                    m_sourceDependencies,
71
                    m_sourceFiles,
72
                    m_fileStatuses);
73
    }
74
#else
64
    clang::FrontendAction *create() override
75
    clang::FrontendAction *create() override
65
    {
76
    {
66
        return new CollectUsedMacrosAction(m_usedMacros,
77
        return new CollectUsedMacrosAction(m_usedMacros,
Lines 69-74 public: Link Here
69
                                           m_sourceFiles,
80
                                           m_sourceFiles,
70
                                           m_fileStatuses);
81
                                           m_fileStatuses);
71
    }
82
    }
83
#endif
72
84
73
private:
85
private:
74
    UsedMacros &m_usedMacros;
86
    UsedMacros &m_usedMacros;
(-)a/src/tools/clangpchmanagerbackend/source/generatepchactionfactory.h (+7 lines)
Lines 68-77 public: Link Here
68
        , m_fileContent(fileContent)
68
        , m_fileContent(fileContent)
69
    {}
69
    {}
70
70
71
#if LLVM_VERSION_MAJOR >= 10
72
    std::unique_ptr<clang::FrontendAction> create() override
73
    {
74
        return std::make_unique<GeneratePCHAction>(m_filePath, m_fileContent);
75
    }
76
#else
71
    clang::FrontendAction *create() override
77
    clang::FrontendAction *create() override
72
    {
78
    {
73
        return new GeneratePCHAction{m_filePath, m_fileContent};
79
        return new GeneratePCHAction{m_filePath, m_fileContent};
74
    }
80
    }
81
#endif
75
82
76
private:
83
private:
77
    llvm::StringRef m_filePath;
84
    llvm::StringRef m_filePath;
(-)a/src/tools/clangrefactoringbackend/source/clangquery.cpp (-1 / +2 lines)
Lines 78-84 void ClangQuery::findLocations() Link Here
78
                   std::make_move_iterator(asts.end()),
78
                   std::make_move_iterator(asts.end()),
79
                   [&] (std::unique_ptr<clang::ASTUnit> &&ast) {
79
                   [&] (std::unique_ptr<clang::ASTUnit> &&ast) {
80
        Diagnostics diagnostics;
80
        Diagnostics diagnostics;
81
        auto optionalMatcher = Parser::parseMatcherExpression({m_query.data(), m_query.size()},
81
        llvm::StringRef query{m_query.data(), m_query.size()};
82
        auto optionalMatcher = Parser::parseMatcherExpression(query,
82
                                                              nullptr,
83
                                                              nullptr,
83
                                                              &diagnostics);
84
                                                              &diagnostics);
84
        parseDiagnostics(diagnostics);
85
        parseDiagnostics(diagnostics);
(-)a/src/tools/clangrefactoringbackend/source/collectsymbolsaction.h (-1 / +5 lines)
Lines 48-54 class CollectSymbolsAction : public clang::WrapperFrontendAction Link Here
48
public:
48
public:
49
    CollectSymbolsAction(std::shared_ptr<IndexDataConsumer> indexDataConsumer)
49
    CollectSymbolsAction(std::shared_ptr<IndexDataConsumer> indexDataConsumer)
50
        : clang::WrapperFrontendAction(
50
        : clang::WrapperFrontendAction(
51
            clang::index::createIndexingAction(indexDataConsumer, createIndexingOptions(), nullptr))
51
            clang::index::createIndexingAction(indexDataConsumer, createIndexingOptions()
52
#if LLVM_VERSION_MAJOR < 10
53
                                               , nullptr
54
#endif
55
                                               ))
52
        , m_indexDataConsumer(indexDataConsumer)
56
        , m_indexDataConsumer(indexDataConsumer)
53
    {}
57
    {}
54
58
(-)a/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp (-9 / +19 lines)
Lines 118-128 bool IndexDataConsumer::isAlreadyParsed(clang::FileID fileId, SourcesManager &so Link Here
118
    return sourcesManager.alreadyParsed(filePathId(fileEntry), fileEntry->getModificationTime());
118
    return sourcesManager.alreadyParsed(filePathId(fileEntry), fileEntry->getModificationTime());
119
}
119
}
120
120
121
bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration,
121
#if LLVM_VERSION_MAJOR >= 10
122
                                            clang::index::SymbolRoleSet symbolRoles,
122
    bool IndexDataConsumer::handleDeclOccurrence(
123
                                            llvm::ArrayRef<clang::index::SymbolRelation> /*symbolRelations*/,
123
#else
124
                                            clang::SourceLocation sourceLocation,
124
    bool IndexDataConsumer::handleDeclOccurence(
125
                                            IndexDataConsumer::ASTNodeInfo /*astNodeInfo*/)
125
#endif
126
        const clang::Decl *declaration,
127
        clang::index::SymbolRoleSet symbolRoles,
128
        llvm::ArrayRef<clang::index::SymbolRelation> /*symbolRelations*/,
129
        clang::SourceLocation sourceLocation,
130
        IndexDataConsumer::ASTNodeInfo /*astNodeInfo*/)
126
{
131
{
127
    const auto *namedDeclaration = clang::dyn_cast<clang::NamedDecl>(declaration);
132
    const auto *namedDeclaration = clang::dyn_cast<clang::NamedDecl>(declaration);
128
    if (namedDeclaration) {
133
    if (namedDeclaration) {
Lines 175-184 SourceLocationKind macroSymbolType(clang::index::SymbolRoleSet roles) Link Here
175
180
176
} // namespace
181
} // namespace
177
182
178
bool IndexDataConsumer::handleMacroOccurence(const clang::IdentifierInfo *identifierInfo,
183
#if LLVM_VERSION_MAJOR >= 10
179
                                             const clang::MacroInfo *macroInfo,
184
bool IndexDataConsumer::handleMacroOccurrence(
180
                                             clang::index::SymbolRoleSet roles,
185
#else
181
                                             clang::SourceLocation sourceLocation)
186
bool IndexDataConsumer::handleMacroOccurence(
187
#endif
188
        const clang::IdentifierInfo *identifierInfo,
189
        const clang::MacroInfo *macroInfo,
190
        clang::index::SymbolRoleSet roles,
191
        clang::SourceLocation sourceLocation)
182
{
192
{
183
    if (macroInfo && sourceLocation.isFileID()
193
    if (macroInfo && sourceLocation.isFileID()
184
        && !isAlreadyParsed(m_sourceManager->getFileID(sourceLocation), m_macroSourcesManager)
194
        && !isAlreadyParsed(m_sourceManager->getFileID(sourceLocation), m_macroSourcesManager)
(-)a/src/tools/clangrefactoringbackend/source/indexdataconsumer.h (-9 / +19 lines)
Lines 57-72 public: Link Here
57
    IndexDataConsumer(const IndexDataConsumer &) = delete;
57
    IndexDataConsumer(const IndexDataConsumer &) = delete;
58
    IndexDataConsumer &operator=(const IndexDataConsumer &) = delete;
58
    IndexDataConsumer &operator=(const IndexDataConsumer &) = delete;
59
59
60
    bool handleDeclOccurence(const clang::Decl *declaration,
60
#if LLVM_VERSION_MAJOR >= 10
61
                             clang::index::SymbolRoleSet symbolRoles,
61
    bool handleDeclOccurrence(
62
                             llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations,
62
#else
63
                             clang::SourceLocation sourceLocation,
63
    bool handleDeclOccurence(
64
                             ASTNodeInfo astNodeInfo) override;
64
#endif
65
            const clang::Decl *declaration,
66
            clang::index::SymbolRoleSet symbolRoles,
67
            llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations,
68
            clang::SourceLocation sourceLocation,
69
            ASTNodeInfo astNodeInfo) override;
65
70
66
    bool handleMacroOccurence(const clang::IdentifierInfo *identifierInfo,
71
#if LLVM_VERSION_MAJOR >= 10
67
                              const clang::MacroInfo *macroInfo,
72
    bool handleMacroOccurrence(
68
                              clang::index::SymbolRoleSet roles,
73
#else
69
                              clang::SourceLocation sourceLocation) override;
74
    bool handleMacroOccurence(
75
#endif
76
                const clang::IdentifierInfo *identifierInfo,
77
                const clang::MacroInfo *macroInfo,
78
                clang::index::SymbolRoleSet roles,
79
                clang::SourceLocation sourceLocation) override;
70
80
71
    void finish() override;
81
    void finish() override;
72
82
(-)a/src/tools/clangrefactoringbackend/source/symbolscollector.cpp (-1 / +4 lines)
Lines 74-80 std::unique_ptr<clang::tooling::FrontendActionFactory> newFrontendActionFactory( Link Here
74
            : m_action(consumerFactory)
74
            : m_action(consumerFactory)
75
        {}
75
        {}
76
76
77
#if LLVM_VERSION_MAJOR >= 10
78
        std::unique_ptr<clang::FrontendAction> create() override { return std::make_unique<AdaptorAction>(m_action); }
79
#else
77
        clang::FrontendAction *create() override { return new AdaptorAction(m_action); }
80
        clang::FrontendAction *create() override { return new AdaptorAction(m_action); }
81
#endif
78
82
79
    private:
83
    private:
80
        class AdaptorAction : public clang::ASTFrontendAction
84
        class AdaptorAction : public clang::ASTFrontendAction
81
- 

Return to bug 711788