Skip to content

Commit

Permalink
[clangd] Revert define-inline action changes to un-break windows buil…
Browse files Browse the repository at this point in the history
…d-bots
  • Loading branch information
kadircet committed Oct 25, 2019
1 parent b85b4e5 commit 8e567b0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 1,159 deletions.
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ClangdServer.cpp
Expand Up @@ -367,7 +367,7 @@ tweakSelection(const Range &Sel, const InputsAndAST &AST) {
auto End = positionToOffset(AST.Inputs.Contents, Sel.end);
if (!End)
return End.takeError();
return Tweak::Selection(AST.Inputs.Index, AST.AST, *Begin, *End);
return Tweak::Selection(AST.AST, *Begin, *End);
}

void ClangdServer::enumerateTweaks(PathRef File, Range Sel,
Expand Down
8 changes: 3 additions & 5 deletions clang-tools-extra/clangd/refactor/Tweak.cpp
Expand Up @@ -9,7 +9,6 @@
#include "Logger.h"
#include "Path.h"
#include "SourceCode.h"
#include "index/Index.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
Expand Down Expand Up @@ -45,10 +44,9 @@ void validateRegistry() {
}
} // namespace

Tweak::Selection::Selection(const SymbolIndex *Index, ParsedAST &AST,
unsigned RangeBegin, unsigned RangeEnd)
: Index(Index), AST(AST), SelectionBegin(RangeBegin),
SelectionEnd(RangeEnd),
Tweak::Selection::Selection(ParsedAST &AST, unsigned RangeBegin,
unsigned RangeEnd)
: AST(AST), SelectionBegin(RangeBegin), SelectionEnd(RangeEnd),
ASTSelection(AST.getASTContext(), AST.getTokens(), RangeBegin, RangeEnd) {
auto &SM = AST.getSourceManager();
Code = SM.getBufferData(SM.getMainFileID());
Expand Down
6 changes: 1 addition & 5 deletions clang-tools-extra/clangd/refactor/Tweak.h
Expand Up @@ -24,7 +24,6 @@
#include "Protocol.h"
#include "Selection.h"
#include "SourceCode.h"
#include "index/Index.h"
#include "clang/Tooling/Core/Replacement.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringMap.h"
Expand All @@ -47,12 +46,9 @@ class Tweak {
public:
/// Input to prepare and apply tweaks.
struct Selection {
Selection(const SymbolIndex *Index, ParsedAST &AST, unsigned RangeBegin,
unsigned RangeEnd);
Selection(ParsedAST &AST, unsigned RangeBegin, unsigned RangeEnd);
/// The text of the active document.
llvm::StringRef Code;
/// The Index for handling codebase related queries.
const SymbolIndex *Index = nullptr;
/// Parsed AST of the active file.
ParsedAST *
/// A location of the cursor in the editor.
Expand Down
1 change: 0 additions & 1 deletion clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
Expand Up @@ -14,7 +14,6 @@ set(LLVM_LINK_COMPONENTS
add_clang_library(clangDaemonTweaks OBJECT
AnnotateHighlightings.cpp
DumpAST.cpp
DefineInline.cpp
ExpandAutoType.cpp
ExpandMacro.cpp
ExtractFunction.cpp
Expand Down

0 comments on commit 8e567b0

Please sign in to comment.