Skip to content

Commit

Permalink
fix(cxx_common): update LLVM to r367622 (#3944)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahms committed Aug 5, 2019
1 parent b10bcff commit 1d7123f
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 198 deletions.
10 changes: 5 additions & 5 deletions kythe/cxx/extractor/cxx_extractor.cc
Expand Up @@ -774,11 +774,11 @@ std::string ExtractorPPCallbacks::AddFile(const clang::FileEntry* file,
llvm::StringRef search_path,
llvm::StringRef relative_path) {
CHECK(!current_files_.top().file_path.empty());
const auto* search_path_entry =
const auto search_path_entry =
source_manager_->getFileManager().getDirectory(search_path);
const auto* current_file_parent_entry =
source_manager_->getFileManager()
.getFile(current_files_.top().file_path.c_str())
const auto current_file_parent_entry =
(*source_manager_->getFileManager().getFile(
current_files_.top().file_path.c_str()))
->getDir();
// If the include file was found relatively to the current file's parent
// directory or a search path, we need to normalize it. This is necessary
Expand All @@ -787,7 +787,7 @@ std::string ExtractorPPCallbacks::AddFile(const clang::FileEntry* file,
// we will get an error when we replay the compilation, as the virtual
// file system is not aware of inodes.
llvm::SmallString<1024> out_name;
if (search_path_entry == current_file_parent_entry) {
if (*search_path_entry == current_file_parent_entry) {
auto parent =
llvm::sys::path::parent_path(current_files_.top().file_path.c_str())
.str();
Expand Down
7 changes: 3 additions & 4 deletions kythe/cxx/indexer/cxx/IndexerFrontendAction.h
Expand Up @@ -115,11 +115,10 @@ class IndexerFrontendAction : public clang::ASTFrontendAction {
std::vector<clang::DirectoryLookup> Lookups;
unsigned CurrentIdx = 0;
for (const auto& Path : HeaderConfig.paths) {
const clang::DirectoryEntry* DirEnt =
FileManager.getDirectory(Path.path);
if (DirEnt != nullptr) {
const auto DirEnt = FileManager.getDirectory(Path.path);
if (DirEnt) {
Lookups.push_back(clang::DirectoryLookup(
DirEnt, Path.characteristic_kind, Path.is_framework));
*DirEnt, Path.characteristic_kind, Path.is_framework));
++CurrentIdx;
} else {
// This can happen if a path was included in the HeaderSearchInfo,
Expand Down
2 changes: 1 addition & 1 deletion kythe/cxx/indexer/cxx/marked_source.cc
Expand Up @@ -93,7 +93,7 @@ std::string Reformat(const clang::LangOptions& lang_options,
auto Source = llvm::MemoryBuffer::getMemBuffer(source_text);
InMemoryFileSystem->addFileNoOwn(kReplacementFile, 0, Source.get());
clang::FileID ID =
Sources.createFileID(Files.getFile(kReplacementFile),
Sources.createFileID(*Files.getFile(kReplacementFile),
clang::SourceLocation(), clang::SrcMgr::C_User);
clang::Rewriter Rewrite(Sources, lang_options);
clang::tooling::applyAllReplacements(*replacements, Rewrite);
Expand Down
83 changes: 50 additions & 33 deletions tools/build_rules/llvm/generated_cmake_targets.bzl

Large diffs are not rendered by default.

305 changes: 154 additions & 151 deletions tools/build_rules/llvm/generated_llvm_build_targets.bzl

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions tools/build_rules/llvm/llvm.BUILD
Expand Up @@ -26,12 +26,17 @@ TARGET_DEFAULTS = {
"include/llvm/*.h",
]),
},
"LLVMTransformUtils": {
"hdrs": glob(["include/llvm-c/Transforms/**/*.h"]),
"LLVMRemarks": {
# Technically BitstreamWriter, but it's header-only
# and BitstreamReader is equivalent.
"deps": [":LLVMBitstreamReader"],
},
"LLVMScalarOpts": {
"deps": [":LLVMTarget"],
},
"LLVMTransformUtils": {
"hdrs": glob(["include/llvm-c/Transforms/**/*.h"]),
},
"LLVMX86CodeGen": {
"deps": [":LLVMipo"],
},
Expand Down
4 changes: 2 additions & 2 deletions tools/build_rules/llvm/repo.bzl
Expand Up @@ -39,12 +39,12 @@ git_llvm_repository = repository_rule(
implementation = _git,
attrs = {
"_commit": attr.string(
default = "ed4cd4487082d0e6bc44e5b42ee7b5e2451cec8a",
default = "e86fffcd4489f4862a514a0fd85276b968313739",
),
"_sha256": attr.string(
# Make sure to update this along with the commit as its presence will cache the download,
# even if the rules or commit change.
default = "fb103937c635befe2010219bdc33bd3f0330c25753e5c8305951575abdfdbaa0",
default = "b659d2eac868698432207cd870aecbfced896ea78bf1f91700839a1a307bb224",
),
},
)
Expand Down

0 comments on commit 1d7123f

Please sign in to comment.