forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge from 'main' to 'sycl-web' (intel#68)
CONFLICT (content): Merge conflict in clang/lib/Frontend/CompilerInvocation.cpp
- Loading branch information
Showing
341 changed files
with
9,486 additions
and
2,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
clang-tools-extra/clangd/index/remote/monitor/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
Support | ||
) | ||
add_clang_executable(clangd-index-server-monitor | ||
Monitor.cpp | ||
|
||
DEPENDS | ||
RemoteIndexServiceProto | ||
) | ||
|
||
target_link_libraries(clangd-index-server-monitor | ||
PRIVATE | ||
clangBasic | ||
clangdSupport | ||
|
||
MonitoringServiceProto | ||
RemoteIndexServiceProto | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
//===--- Monitor.cpp - Request server monitoring information through CLI --===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "MonitoringService.grpc.pb.h" | ||
#include "MonitoringService.pb.h" | ||
|
||
#include "support/Logger.h" | ||
#include "clang/Basic/Version.h" | ||
#include "llvm/Support/CommandLine.h" | ||
#include "llvm/Support/Signals.h" | ||
|
||
#include <chrono> | ||
#include <google/protobuf/util/json_util.h> | ||
#include <grpc++/grpc++.h> | ||
|
||
namespace clang { | ||
namespace clangd { | ||
namespace remote { | ||
namespace { | ||
|
||
static constexpr char Overview[] = R"( | ||
This tool requests monitoring information (uptime, index freshness) from the | ||
server and prints it to stdout. | ||
)"; | ||
|
||
llvm::cl::opt<std::string> | ||
ServerAddress("server-address", llvm::cl::Positional, | ||
llvm::cl::desc("Address of the invoked server."), | ||
llvm::cl::Required); | ||
|
||
} // namespace | ||
} // namespace remote | ||
} // namespace clangd | ||
} // namespace clang | ||
|
||
int main(int argc, char *argv[]) { | ||
using namespace clang::clangd::remote; | ||
llvm::cl::ParseCommandLineOptions(argc, argv, Overview); | ||
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); | ||
|
||
const auto Channel = | ||
grpc::CreateChannel(ServerAddress, grpc::InsecureChannelCredentials()); | ||
const auto Stub = clang::clangd::remote::v1::Monitor::NewStub(Channel); | ||
grpc::ClientContext Context; | ||
Context.set_deadline(std::chrono::system_clock::now() + | ||
std::chrono::seconds(10)); | ||
Context.AddMetadata("version", clang::getClangToolFullVersion("clangd")); | ||
const clang::clangd::remote::v1::MonitoringInfoRequest Request; | ||
clang::clangd::remote::v1::MonitoringInfoReply Response; | ||
const auto Status = Stub->MonitoringInfo(&Context, Request, &Response); | ||
if (!Status.ok()) { | ||
clang::clangd::elog("Can not request monitoring information ({0}): {1}\n", | ||
Status.error_code(), Status.error_message()); | ||
return -1; | ||
} | ||
std::string Output; | ||
google::protobuf::util::JsonPrintOptions Options; | ||
Options.add_whitespace = true; | ||
Options.always_print_primitive_fields = true; | ||
Options.preserve_proto_field_names = true; | ||
const auto JsonStatus = | ||
google::protobuf::util::MessageToJsonString(Response, &Output, Options); | ||
if (!JsonStatus.ok()) { | ||
clang::clangd::elog("Can not convert response ({0}) to JSON ({1}): {2}\n", | ||
Response.DebugString(), JsonStatus.error_code(), | ||
JsonStatus.error_message().as_string()); | ||
return -1; | ||
} | ||
llvm::outs() << Output; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
...tools-extra/test/clang-tidy/checkers/bugprone-argument-comment-ignore-single-argument.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment-literals.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment-strict.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
clang-tools-extra/test/clang-tidy/checkers/bugprone-assert-side-effect.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...g-tools-extra/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-explicit-only.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ools-extra/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-implicit-enabled.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s-extra/test/clang-tidy/checkers/bugprone-not-null-terminated-result-memcpy-before-safe.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
clang-tools-extra/test/clang-tidy/checkers/bugprone-reserved-identifier-invert.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
clang-tools-extra/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
clang-tools-extra/test/clang-tidy/checkers/bugprone-suspicious-enum-usage-strict.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.