summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2023-03-06 08:04:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-03-06 08:04:38 +0000
commit80c14b0393968462aa668529f09b4f4e9307bb87 (patch)
tree9b3060b9e4ea72d6e704b26a9d983a0d9f856716
parentaf58a1a6d90dceb795f8975b75cf3769b0318575 (diff)
downloadkythe-80c14b0393968462aa668529f09b4f4e9307bb87.tar.gz
Revert^2 "Cherrypick upstream change to fix build."
af58a1a6d90dceb795f8975b75cf3769b0318575 Change-Id: I848a08fc5455dea04ee77ad3c62ec1d3d5d072f9
-rw-r--r--kythe/cxx/extractor/cxx_extractor.cc4
-rw-r--r--kythe/cxx/extractor/path_utils.cc2
-rw-r--r--kythe/cxx/extractor/testlib.cc4
-rw-r--r--kythe/cxx/indexer/cxx/IndexerPPCallbacks.cc7
-rw-r--r--kythe/cxx/indexer/cxx/IndexerPPCallbacks.h2
-rw-r--r--kythe/cxx/indexer/cxx/marked_source.cc3
-rw-r--r--kythe/cxx/tools/fyi/fyi.cc8
-rw-r--r--setup.bzl2
8 files changed, 15 insertions, 17 deletions
diff --git a/kythe/cxx/extractor/cxx_extractor.cc b/kythe/cxx/extractor/cxx_extractor.cc
index c244aca01..e17039857 100644
--- a/kythe/cxx/extractor/cxx_extractor.cc
+++ b/kythe/cxx/extractor/cxx_extractor.cc
@@ -454,7 +454,7 @@ class ExtractorPPCallbacks : public clang::PPCallbacks {
void InclusionDirective(
clang::SourceLocation HashLoc, const clang::Token& IncludeTok,
llvm::StringRef FileName, bool IsAngled, clang::CharSourceRange Range,
- llvm::Optional<clang::FileEntryRef> File, llvm::StringRef SearchPath,
+ clang::OptionalFileEntryRef File, llvm::StringRef SearchPath,
llvm::StringRef RelativePath, const clang::Module* Imported,
clang::SrcMgr::CharacteristicKind FileType) override;
@@ -843,7 +843,7 @@ std::string IncludeDirGroupToString(const clang::frontend::IncludeDirGroup& G) {
void ExtractorPPCallbacks::InclusionDirective(
clang::SourceLocation HashLoc, const clang::Token& IncludeTok,
llvm::StringRef FileName, bool IsAngled, clang::CharSourceRange Range,
- llvm::Optional<clang::FileEntryRef> File, llvm::StringRef SearchPath,
+ clang::OptionalFileEntryRef File, llvm::StringRef SearchPath,
llvm::StringRef RelativePath, const clang::Module* Imported,
clang::SrcMgr::CharacteristicKind FileType) {
if (!File) {
diff --git a/kythe/cxx/extractor/path_utils.cc b/kythe/cxx/extractor/path_utils.cc
index bacc8283e..42a76d56c 100644
--- a/kythe/cxx/extractor/path_utils.cc
+++ b/kythe/cxx/extractor/path_utils.cc
@@ -66,7 +66,7 @@ const clang::FileEntry* LookupFileForIncludePragma(
} else {
result_filename->append(filename.begin(), filename.end());
}
- llvm::Optional<clang::FileEntryRef> file = preprocessor->LookupFile(
+ clang::OptionalFileEntryRef file = preprocessor->LookupFile(
filename_token.getLocation(),
preprocessor->getLangOpts().MSVCCompat ? normalized_path.c_str()
: filename,
diff --git a/kythe/cxx/extractor/testlib.cc b/kythe/cxx/extractor/testlib.cc
index f21548399..1dc2f19d7 100644
--- a/kythe/cxx/extractor/testlib.cc
+++ b/kythe/cxx/extractor/testlib.cc
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <iostream>
+#include <optional>
#include <utility>
#include "absl/container/flat_hash_map.h"
@@ -36,7 +37,6 @@
#include "kythe/proto/analysis.pb.h"
#include "kythe/proto/cxx.pb.h"
#include "kythe/proto/filecontext.pb.h"
-#include "llvm/ADT/None.h"
#include "llvm/Support/Program.h"
#include "tools/cpp/runfiles/runfiles.h"
@@ -209,7 +209,7 @@ bool ExecuteAndWait(const std::string& program,
int exit_code = llvm::sys::ExecuteAndWait(
program, VectorForExecute(argv),
llvm::makeArrayRef(VectorForExecute(env)),
- /* Redirects */ llvm::None,
+ /* Redirects */ std::nullopt,
/* SecondsToWait */ 0, /* MemoryLimit */ 0, &error, &execution_failed);
if (!error.empty() || execution_failed || exit_code != 0) {
LOG(ERROR) << "unable to run extractor (" << exit_code << "): " << error;
diff --git a/kythe/cxx/indexer/cxx/IndexerPPCallbacks.cc b/kythe/cxx/indexer/cxx/IndexerPPCallbacks.cc
index fdd875eeb..db62eb724 100644
--- a/kythe/cxx/indexer/cxx/IndexerPPCallbacks.cc
+++ b/kythe/cxx/indexer/cxx/IndexerPPCallbacks.cc
@@ -240,10 +240,9 @@ void IndexerPPCallbacks::Ifndef(clang::SourceLocation Location,
void IndexerPPCallbacks::InclusionDirective(
clang::SourceLocation HashLocation, const clang::Token& IncludeToken,
llvm::StringRef Filename, bool IsAngled,
- clang::CharSourceRange FilenameRange,
- llvm::Optional<clang::FileEntryRef> FileRef, llvm::StringRef SearchPath,
- llvm::StringRef RelativePath, const clang::Module* Imported,
- clang::SrcMgr::CharacteristicKind FileType) {
+ clang::CharSourceRange FilenameRange, clang::OptionalFileEntryRef FileRef,
+ llvm::StringRef SearchPath, llvm::StringRef RelativePath,
+ const clang::Module* Imported, clang::SrcMgr::CharacteristicKind FileType) {
// TODO(zarko) (Modules): Check if `Imported` is non-null; if so, this
// was transformed to a module import.
if (FileRef) {
diff --git a/kythe/cxx/indexer/cxx/IndexerPPCallbacks.h b/kythe/cxx/indexer/cxx/IndexerPPCallbacks.h
index 1e332e9f7..bc0c42a73 100644
--- a/kythe/cxx/indexer/cxx/IndexerPPCallbacks.h
+++ b/kythe/cxx/indexer/cxx/IndexerPPCallbacks.h
@@ -66,7 +66,7 @@ class IndexerPPCallbacks : public clang::PPCallbacks {
const clang::Token& IncludeToken,
llvm::StringRef Filename, bool IsAngled,
clang::CharSourceRange FilenameRange,
- llvm::Optional<clang::FileEntryRef> FileRef,
+ clang::OptionalFileEntryRef FileRef,
llvm::StringRef SearchPath,
llvm::StringRef RelativePath,
const clang::Module* Imported,
diff --git a/kythe/cxx/indexer/cxx/marked_source.cc b/kythe/cxx/indexer/cxx/marked_source.cc
index a92bf6aae..be0a345fa 100644
--- a/kythe/cxx/indexer/cxx/marked_source.cc
+++ b/kythe/cxx/indexer/cxx/marked_source.cc
@@ -509,8 +509,7 @@ class DeclAnnotator : public clang::DeclVisitor<DeclAnnotator> {
/// is placed to the left of types, _Nullable is placed to the right of types.
bool ShouldSkipDecl(const clang::Decl* decl, const clang::QualType& qt,
const clang::SourceRange& sr) {
- clang::Optional<clang::NullabilityKind> k =
- qt->getNullability(decl->getASTContext());
+ clang::Optional<clang::NullabilityKind> k = qt->getNullability();
return k && sr.getBegin().getRawEncoding() > sr.getEnd().getRawEncoding();
}
diff --git a/kythe/cxx/tools/fyi/fyi.cc b/kythe/cxx/tools/fyi/fyi.cc
index e9560343e..6c32d77a3 100644
--- a/kythe/cxx/tools/fyi/fyi.cc
+++ b/kythe/cxx/tools/fyi/fyi.cc
@@ -280,7 +280,7 @@ class PreprocessorHooks : public clang::PPCallbacks {
const clang::Token& include_token,
llvm::StringRef file_name, bool is_angled,
clang::CharSourceRange file_name_range,
- llvm::Optional<clang::FileEntryRef> include_file,
+ clang::OptionalFileEntryRef include_file,
llvm::StringRef search_path,
llvm::StringRef relative_path,
const clang::Module* imported,
@@ -490,9 +490,9 @@ void PreprocessorHooks::InclusionDirective(
clang::SourceLocation hash_location, const clang::Token& include_token,
llvm::StringRef file_name, bool is_angled,
clang::CharSourceRange file_name_range,
- llvm::Optional<clang::FileEntryRef> include_file,
- llvm::StringRef search_path, llvm::StringRef relative_path,
- const clang::Module* imported, clang::SrcMgr::CharacteristicKind FileType) {
+ clang::OptionalFileEntryRef include_file, llvm::StringRef search_path,
+ llvm::StringRef relative_path, const clang::Module* imported,
+ clang::SrcMgr::CharacteristicKind FileType) {
if (!enclosing_pass_ || !enclosing_pass_->tracker()) {
return;
}
diff --git a/setup.bzl b/setup.bzl
index bfd9ae74f..e4a4c2c71 100644
--- a/setup.bzl
+++ b/setup.bzl
@@ -141,7 +141,7 @@ def kythe_rule_repositories():
maybe(
github_archive,
repo_name = "llvm/llvm-project",
- commit = "4c564940a14f55d2315d2676b10fea0660ea814a",
+ commit = "77fad4c31e9c32a61da78946f41e8db28ec6a6a7",
name = "llvm-project-raw",
build_file_content = "#empty",
patch_args = ["-p1"],