Skip to content

Manually merge apple/stable/20190619-> swift/master up to bitstream remarks #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
0bd0718
Reordering KextImageInfo::LoadImageUsingMemoryModule
jasonmolenda Nov 8, 2019
745cff2
Remove stale copy of moved test. (NFC)
adrian-prantl Nov 11, 2019
aeb1b9b
[Reproducer] Quit the debugger after generating a reproducer
JDevlieghere Nov 11, 2019
608c7fc
Merge pull request #273 from adrian-prantl/move
adrian-prantl Nov 11, 2019
c557706
Merge pull request #241 from jasonmolenda/r50523558-kernel-double-rea…
jasonmolenda Nov 11, 2019
6b639b1
Merge pull request #274 from JDevlieghere/cherrypick/0cf86da1741fb1a4…
JDevlieghere Nov 11, 2019
61eda0e
[CMake] Fix the value of `config.target_cflags` for non-macOS Apple p…
delcypher Oct 1, 2019
350ff2b
BitStream reader: propagate errors
jfbastien Jun 26, 2019
de568bf
Fix Bitcode/invalid.test
jfbastien Jun 26, 2019
e074fdd
Fix GCC 4 build after r364464
zmodem Jun 27, 2019
7d9be5a
Fix -Wunused-variable warnings after r364464
zmodem Jun 27, 2019
9567d22
Bitstream reader: Fix undefined behavior seen after rL364464
bjope Jul 5, 2019
7f70ecc
Fix APINotes following bitstream reader API update
jfbastien Jun 27, 2019
74ef814
Fix index while building following bitstream reader API update
jfbastien Jun 27, 2019
ef106b6
[clang] Fix build after FileManager/BitStream changes
francisvm Nov 5, 2019
e9c60e2
[Bitcode] Move Bitstream to a separate library
francisvm Jul 3, 2019
50e4d27
[llvm-bcanalyzer] Refactor and move to libLLVMBitReader
francisvm Jul 8, 2019
5f775a7
[Bitcode][NFC] Remove unused variable from BitcodeAnalyzer
francisvm Jul 8, 2019
8f995de
[Frontend] Explicitly include Bitstream/BitCodes.h and BitstreamWriter.h
francisvm Jul 8, 2019
8934701
[Bitcode] Explicitly include Bitstream/BitCodes.h and BitstreamWriter.h
francisvm Jul 9, 2019
a74e105
RecordLayout.h: llvm/Bitcode -> llvm/Bitstream
francisvm Jul 4, 2019
6243ab9
[Bitcode] Update includes: llvm/Bitcode -> llvm/Bitstream
francisvm Jul 4, 2019
df2a8f8
[Remarks] Add cl::Hidden to -remarks-yaml-string-table
francisvm Jul 10, 2019
7feb781
[Remarks][NFC] Move the string table parsing out of the parser constr…
francisvm Jul 4, 2019
aea2786
[Remarks] Require an explicit format to the parser
francisvm Jul 4, 2019
956cac1
[Remarks][NFC] Combine ParserFormat and SerializerFormat
francisvm Jul 16, 2019
1f9d80a
[Remarks] Simplify and refactor the RemarkParser interface
francisvm Jul 16, 2019
359ff49
[Remarks] Add unit tests for YAML serialization
francisvm Jul 23, 2019
d59cae2
[Remarks][NFC] Move the YAML serializer to its own header
francisvm Jul 23, 2019
14b9370
[Remarks] Introduce a new format: yaml-strtab
francisvm Jul 23, 2019
157ab88
[Remarks] String tables should be move-only
francisvm Jul 23, 2019
79de460
[Remarks] Simplify the creation of remark serializers
francisvm Jul 24, 2019
cfbe3e8
[Remarks][NFC] Rename remarks::Serializer to remarks::RemarkSerializer
francisvm Jul 24, 2019
2e326fc
[Remarks][NFC] Rename remarks::Parser to remarks::RemarkParser
francisvm Jul 25, 2019
19bac50
Reland: [Remarks] Add support for serializing metadata for every rema…
francisvm Jul 26, 2019
04761ce
Reland: [Remarks] Support parsing remark metadata in the YAML remark …
francisvm Jul 26, 2019
7a87644
Fix remarks unit test on Windows
rnk Jul 26, 2019
e8ef216
[Remarks] Update unit test to use StringRef::lower
francisvm Jul 26, 2019
2626244
[Remarks] Silence Wreturn-type warning
francisvm Jul 26, 2019
8fc5d9e
[Remarks] Update error message format string
francisvm Jul 29, 2019
c85eb1a
[Remarks] Add two serialization modes for remarks: separate and stand…
francisvm Jul 30, 2019
a24becc
Reland: [Remarks] Add an LLVM-bitstream-based remark serializer
francisvm Jul 31, 2019
d66cf11
[Remarks] Don't serialize metadata if a string table is not used
francisvm Sep 5, 2019
3d7fbac
[Remarks] Add comparison operators to the Remark object
francisvm Sep 5, 2019
0093701
[Remarks] Add support for internalizing a remark in a string table
francisvm Sep 6, 2019
f4b5ca5
[Remarks] Add parser for bitstream remarks
francisvm Sep 9, 2019
36c703b
[Remarks][NFC] Use StringLiteral for magic numbers
francisvm Sep 13, 2019
a7cf9cc
[Remarks][NFC] Forward declare ParsedStringTable
francisvm Sep 13, 2019
5d68674
[llvm-opt-report] Improve error handling
francisvm Sep 13, 2019
f554158
[Remarks] Allow remarks::Format::YAML to take a string table
francisvm Sep 16, 2019
e2becf8
[Remarks] Allow the RemarkStreamer to be used directly with a stream
francisvm Sep 18, 2019
008f453
[Remarks] Add support for prepending a path to external files
francisvm Oct 16, 2019
64c7a12
[Remarks] Use StringRef::contains to avoid differences in error string
francisvm Oct 16, 2019
9492c50
[Remarks] Fix unit test by only checking for the path
francisvm Oct 16, 2019
87f72c3
[Remarks] Fix warning for ambigous `else` behind EXPECT macro
francisvm Oct 16, 2019
d0c57fc
[Remarks] Emit the remarks section by default for certain formats
francisvm Oct 28, 2019
a244862
[Remarks] Remove references to ELF support
francisvm Oct 28, 2019
30da365
[Remarks] Add bitstream to the list of supported formats in clang
francisvm Oct 28, 2019
4e6f7c4
[Remarks] Fix Sphinx formatting
francisvm Oct 28, 2019
40f39d9
[Remarks] Add support for linking remarks
francisvm Sep 10, 2019
755861e
[Remarks] Fix error message check in unit test
francisvm Oct 31, 2019
92f3148
[dsymutil] Add support for linking remarks
francisvm Sep 30, 2019
9eeaf94
[dsymutil] Require darwin in fat binary test
francisvm Nov 1, 2019
eff1a99
[dsymutil] Second attempt to fix dsymutil tests on non-darwin platforms
francisvm Nov 2, 2019
8303678
clang/Modules: Remove unused parameter from ModuleManager::removeModules
dexonsmith Nov 10, 2019
26929f4
clang/Modules: Delay err_module_file_conflict if a diagnostic is in f…
dexonsmith Nov 10, 2019
96f3363
clang/Modules: Use range-based for in ASTReader::ReadAST, NFC
dexonsmith Nov 11, 2019
5660a18
clang/Modules: Split loop in ReadAST between failable and not
dexonsmith Nov 10, 2019
96ed062
clang/Modules: Add missing diagnostics for malformed AST files
dexonsmith Nov 10, 2019
e41c301
clang/Modules: Clean up modules on error in ReadAST
dexonsmith Nov 10, 2019
1ce3d17
clang/Modules: Error if ReadASTBlock does not find the main module
dexonsmith Nov 10, 2019
7101c16
Merge pull request #287 from francisvm/bitstream-remarks/apple/stable…
francisvm Nov 12, 2019
1674eaa
Merge branch 'apple/stable/20190619' into clang/Modules/20190619/cher…
dexonsmith Nov 12, 2019
02e0f68
[LLDB] Adding caching to libc++ std::function formatter for lookups t…
shafik Nov 6, 2019
1a7a586
Merge pull request #292 from shafik/53840445_add_cache_std_function_f…
shafik Nov 13, 2019
9a5e075
Merge pull request #288 from dexonsmith/clang/Modules/20190619/cherry…
dexonsmith Nov 13, 2019
101681c
[ODRHash] Fix null pointer dereference for ObjC selectors with empty …
vsapsai Jun 28, 2019
8748ea7
[LLDB][Formatters] Re-enable std::function formatter with fixes to im…
shafik Nov 12, 2019
db54fd0
Merge pull request #299 from shafik/53840445_reenable_std_func_format…
shafik Nov 13, 2019
edc98ef
[llvm-bcanalyzer] Don't dump the contents if -dump is not passed
francisvm Nov 13, 2019
c555ebe
[dsymutil] Add -dump to llvm-bcanalyzer invocations
francisvm Nov 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 64 additions & 29 deletions clang-tools-extra/clang-doc/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,24 +489,27 @@ template <typename T>
llvm::Error ClangDocBitcodeReader::readRecord(unsigned ID, T I) {
Record R;
llvm::StringRef Blob;
unsigned RecID = Stream.readRecord(ID, R, &Blob);
return parseRecord(R, RecID, Blob, I);
llvm::Expected<unsigned> MaybeRecID = Stream.readRecord(ID, R, &Blob);
if (!MaybeRecID)
return MaybeRecID.takeError();
return parseRecord(R, MaybeRecID.get(), Blob, I);
}

template <>
llvm::Error ClangDocBitcodeReader::readRecord(unsigned ID, Reference *I) {
Record R;
llvm::StringRef Blob;
unsigned RecID = Stream.readRecord(ID, R, &Blob);
return parseRecord(R, RecID, Blob, I, CurrentReferenceField);
llvm::Expected<unsigned> MaybeRecID = Stream.readRecord(ID, R, &Blob);
if (!MaybeRecID)
return MaybeRecID.takeError();
return parseRecord(R, MaybeRecID.get(), Blob, I, CurrentReferenceField);
}

// Read a block of records into a single info.
template <typename T>
llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) {
if (Stream.EnterSubBlock(ID))
return llvm::make_error<llvm::StringError>("Unable to enter subblock.\n",
llvm::inconvertibleErrorCode());
if (llvm::Error Err = Stream.EnterSubBlock(ID))
return Err;

while (true) {
unsigned BlockOrCode = 0;
Expand All @@ -519,9 +522,9 @@ llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) {
case Cursor::BlockEnd:
return llvm::Error::success();
case Cursor::BlockBegin:
if (auto Err = readSubBlock(BlockOrCode, I)) {
if (!Stream.SkipBlock())
continue;
if (llvm::Error Err = readSubBlock(BlockOrCode, I)) {
if (llvm::Error Skipped = Stream.SkipBlock())
return joinErrors(std::move(Err), std::move(Skipped));
return Err;
}
continue;
Expand Down Expand Up @@ -603,24 +606,41 @@ ClangDocBitcodeReader::skipUntilRecordOrBlock(unsigned &BlockOrRecordID) {
BlockOrRecordID = 0;

while (!Stream.AtEndOfStream()) {
unsigned Code = Stream.ReadCode();
Expected<unsigned> MaybeCode = Stream.ReadCode();
if (!MaybeCode) {
// FIXME this drops the error on the floor.
consumeError(MaybeCode.takeError());
return Cursor::BadBlock;
}

switch ((llvm::bitc::FixedAbbrevIDs)Code) {
unsigned Code = MaybeCode.get();
if (Code >= static_cast<unsigned>(llvm::bitc::FIRST_APPLICATION_ABBREV)) {
BlockOrRecordID = Code;
return Cursor::Record;
}
switch (static_cast<llvm::bitc::FixedAbbrevIDs>(Code)) {
case llvm::bitc::ENTER_SUBBLOCK:
BlockOrRecordID = Stream.ReadSubBlockID();
if (Expected<unsigned> MaybeID = Stream.ReadSubBlockID())
BlockOrRecordID = MaybeID.get();
else {
// FIXME this drops the error on the floor.
consumeError(MaybeID.takeError());
}
return Cursor::BlockBegin;
case llvm::bitc::END_BLOCK:
if (Stream.ReadBlockEnd())
return Cursor::BadBlock;
return Cursor::BlockEnd;
case llvm::bitc::DEFINE_ABBREV:
Stream.ReadAbbrevRecord();
if (llvm::Error Err = Stream.ReadAbbrevRecord()) {
// FIXME this drops the error on the floor.
consumeError(std::move(Err));
}
continue;
case llvm::bitc::UNABBREV_RECORD:
return Cursor::BadBlock;
default:
BlockOrRecordID = Code;
return Cursor::Record;
case llvm::bitc::FIRST_APPLICATION_ABBREV:
llvm_unreachable("Unexpected abbrev id.");
}
}
llvm_unreachable("Premature stream end.");
Expand All @@ -632,17 +652,24 @@ llvm::Error ClangDocBitcodeReader::validateStream() {
llvm::inconvertibleErrorCode());

// Sniff for the signature.
if (Stream.Read(8) != BitCodeConstants::Signature[0] ||
Stream.Read(8) != BitCodeConstants::Signature[1] ||
Stream.Read(8) != BitCodeConstants::Signature[2] ||
Stream.Read(8) != BitCodeConstants::Signature[3])
return llvm::make_error<llvm::StringError>("Invalid bitcode signature.\n",
llvm::inconvertibleErrorCode());
for (int Idx = 0; Idx != 4; ++Idx) {
Expected<llvm::SimpleBitstreamCursor::word_t> MaybeRead = Stream.Read(8);
if (!MaybeRead)
return MaybeRead.takeError();
else if (MaybeRead.get() != BitCodeConstants::Signature[Idx])
return llvm::make_error<llvm::StringError>(
"Invalid bitcode signature.\n", llvm::inconvertibleErrorCode());
}
return llvm::Error::success();
}

llvm::Error ClangDocBitcodeReader::readBlockInfoBlock() {
BlockInfo = Stream.ReadBlockInfoBlock();
Expected<Optional<llvm::BitstreamBlockInfo>> MaybeBlockInfo =
Stream.ReadBlockInfoBlock();
if (!MaybeBlockInfo)
return MaybeBlockInfo.takeError();
else
BlockInfo = MaybeBlockInfo.get();
if (!BlockInfo)
return llvm::make_error<llvm::StringError>(
"Unable to parse BlockInfoBlock.\n", llvm::inconvertibleErrorCode());
Expand Down Expand Up @@ -685,11 +712,16 @@ ClangDocBitcodeReader::readBitcode() {

// Read the top level blocks.
while (!Stream.AtEndOfStream()) {
unsigned Code = Stream.ReadCode();
if (Code != llvm::bitc::ENTER_SUBBLOCK)
Expected<unsigned> MaybeCode = Stream.ReadCode();
if (!MaybeCode)
return MaybeCode.takeError();
if (MaybeCode.get() != llvm::bitc::ENTER_SUBBLOCK)
return llvm::make_error<llvm::StringError>(
"No blocks in input.\n", llvm::inconvertibleErrorCode());
unsigned ID = Stream.ReadSubBlockID();
Expected<unsigned> MaybeID = Stream.ReadSubBlockID();
if (!MaybeID)
return MaybeID.takeError();
unsigned ID = MaybeID.get();
switch (ID) {
// NamedType and Comment blocks should not appear at the top level
case BI_TYPE_BLOCK_ID:
Expand Down Expand Up @@ -718,8 +750,11 @@ ClangDocBitcodeReader::readBitcode() {
return std::move(Err);
continue;
default:
if (!Stream.SkipBlock())
continue;
if (llvm::Error Err = Stream.SkipBlock()) {
// FIXME this drops the error on the floor.
consumeError(std::move(Err));
}
continue;
}
}
return std::move(Infos);
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-doc/BitcodeReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "clang/AST/AST.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Bitcode/BitstreamReader.h"
#include "llvm/Bitstream/BitstreamReader.h"
#include "llvm/Support/Error.h"

namespace clang {
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-doc/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static const std::vector<std::pair<BlockId, std::vector<RecordId>>>

// AbbreviationMap

constexpr char BitCodeConstants::Signature[];
constexpr unsigned char BitCodeConstants::Signature[];

void ClangDocBitcodeWriter::AbbreviationMap::add(RecordId RID,
unsigned AbbrevID) {
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-doc/BitcodeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Bitcode/BitstreamWriter.h"
#include "llvm/Bitstream/BitstreamWriter.h"
#include <initializer_list>
#include <vector>

Expand All @@ -44,7 +44,7 @@ struct BitCodeConstants {
static constexpr unsigned ReferenceTypeSize = 8U;
static constexpr unsigned USRLengthSize = 6U;
static constexpr unsigned USRBitLengthSize = 8U;
static constexpr char Signature[4] = {'D', 'O', 'C', 'S'};
static constexpr unsigned char Signature[4] = {'D', 'O', 'C', 'S'};
static constexpr int USRHashSize = 20;
};

Expand Down
3 changes: 1 addition & 2 deletions clang-tools-extra/clang-doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(LLVM_LINK_COMPONENTS
support
BitReader
BitWriter
BitstreamReader
)

add_clang_library(clangDoc
Expand Down
5 changes: 3 additions & 2 deletions clang-tools-extra/clangd/ClangdUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ ParsedAST::build(std::unique_ptr<CompilerInvocation> CI,
collectIWYUHeaderMaps(&CanonIncludes);
Clang->getPreprocessor().addCommentHandler(IWYUHandler.get());

if (!Action->Execute())
log("Execute() failed when building AST for {0}", MainInput.getFile());
if (llvm::Error Err = Action->Execute())
log("Execute() failed when building AST for {0}: {1}", MainInput.getFile(),
toString(std::move(Err)));

std::vector<Decl *> ParsedDecls = Action->takeTopLevelDecls();
// AST traversals should exclude the preamble, to avoid performance cliffs.
Expand Down
5 changes: 3 additions & 2 deletions clang-tools-extra/clangd/CodeComplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,9 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
if (Includes)
Clang->getPreprocessor().addPPCallbacks(
collectIncludeStructureCallback(Clang->getSourceManager(), Includes));
if (!Action.Execute()) {
log("Execute() failed when running codeComplete for {0}", Input.FileName);
if (llvm::Error Err = Action.Execute()) {
log("Execute() failed when running codeComplete for {0}: {1}",
Input.FileName, toString(std::move(Err)));
return false;
}
Action.EndSourceFile();
Expand Down
6 changes: 3 additions & 3 deletions clang-tools-extra/clangd/index/Background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ llvm::Error BackgroundIndex::index(tooling::CompileCommand Cmd,
if (!Action->BeginSourceFile(*Clang, Input))
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"BeginSourceFile() failed");
if (!Action->Execute())
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"Execute() failed");
if (llvm::Error Err = Action->Execute())
return Err;

Action->EndSourceFile();
if (Clang->hasDiagnostics() &&
Clang->getDiagnostics().hasUncompilableErrorOccurred()) {
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/unittests/HeadersTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class HeadersTest : public ::testing::Test {
IncludeStructure Includes;
Clang->getPreprocessor().addPPCallbacks(
collectIncludeStructureCallback(Clang->getSourceManager(), &Includes));
EXPECT_TRUE(Action.Execute());
EXPECT_FALSE(Action.Execute());
Action.EndSourceFile();
return Includes;
}
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/unittests/clang-doc/BitcodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "BitcodeWriter.h"
#include "ClangDocTest.h"
#include "Representation.h"
#include "llvm/Bitcode/BitstreamReader.h"
#include "llvm/Bitcode/BitstreamWriter.h"
#include "llvm/Bitstream/BitstreamReader.h"
#include "llvm/Bitstream/BitstreamWriter.h"
#include "gtest/gtest.h"

namespace clang {
Expand Down
3 changes: 1 addition & 2 deletions clang-tools-extra/unittests/clang-doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(LLVM_LINK_COMPONENTS
support
BitReader
BitWriter
BitstreamReader
)

get_filename_component(CLANG_DOC_SOURCE_DIR
Expand Down
5 changes: 5 additions & 0 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ output format of the diagnostics that it generates.

``-fsave-optimization-record=yaml``: A structured YAML format.

- .. _opt_fsave_optimization_record_bitstream:

``-fsave-optimization-record=bitstream``: A binary format based on LLVM
Bitstream.

.. _opt_foptimization-record-file:

**-foptimization-record-file**
Expand Down
16 changes: 15 additions & 1 deletion clang/include/clang/Basic/Diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cassert>
#include <cstdint>
#include <limits>
Expand Down Expand Up @@ -472,6 +473,9 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
/// Second string argument for the delayed diagnostic.
std::string DelayedDiagArg2;

/// Third string argument for the delayed diagnostic.
std::string DelayedDiagArg3;

/// Optional flag value.
///
/// Some flags accept values, for instance: -Wframe-larger-than=<value> and
Expand Down Expand Up @@ -875,8 +879,12 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
/// \param Arg2 A string argument that will be provided to the
/// diagnostic. A copy of this string will be stored in the
/// DiagnosticsEngine object itself.
///
/// \param Arg3 A string argument that will be provided to the
/// diagnostic. A copy of this string will be stored in the
/// DiagnosticsEngine object itself.
void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "",
StringRef Arg2 = "");
StringRef Arg2 = "", StringRef Arg3 = "");

/// Clear out the current diagnostic.
void Clear() { CurDiagID = std::numeric_limits<unsigned>::max(); }
Expand Down Expand Up @@ -1303,6 +1311,12 @@ inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc,
return DiagnosticBuilder(this);
}

inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
llvm::Error &&E) {
DB.AddString(toString(std::move(E)));
return DB;
}

inline DiagnosticBuilder DiagnosticsEngine::Report(unsigned DiagID) {
return Report(SourceLocation(), DiagID);
}
Expand Down
2 changes: 2 additions & 0 deletions clang/include/clang/Basic/DiagnosticSerializationKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def note_module_file_imported_by : Note<
"imported by %select{|module '%2' in }1'%0'">;
def err_module_file_not_module : Error<
"AST file '%0' was not built as a module">, DefaultFatal;
def err_module_file_missing_top_level_submodule : Error<
"module file '%0' is missing its top-level submodule">, DefaultFatal;

def remark_module_import : Remark<
"importing module '%0'%select{| into '%3'}2 from '%1'">,
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Frontend/FrontendAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/FrontendOptions.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -229,7 +230,7 @@ class FrontendAction {
bool BeginSourceFile(CompilerInstance &CI, const FrontendInputFile &Input);

/// Set the source manager's main input file, and run the action.
bool Execute();
llvm::Error Execute();

/// Perform any per-file post processing, deallocate per-file
/// objects, and run statistics and output file cleanup code.
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Frontend/SerializedDiagnosticPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "clang/Basic/LLVM.h"
#include "clang/Frontend/SerializedDiagnostics.h"
#include "llvm/Bitcode/BitstreamWriter.h"
#include "llvm/Bitstream/BitstreamWriter.h"

namespace llvm {
class raw_ostream;
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Frontend/SerializedDiagnosticReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICREADER_H

#include "clang/Basic/LLVM.h"
#include "llvm/Bitcode/BitstreamReader.h"
#include "llvm/Bitstream/BitstreamReader.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorOr.h"
#include <system_error>
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Frontend/SerializedDiagnostics.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef LLVM_CLANG_FRONTEND_SERIALIZE_DIAGNOSTICS_H_
#define LLVM_CLANG_FRONTEND_SERIALIZE_DIAGNOSTICS_H_

#include "llvm/Bitcode/BitCodes.h"
#include "llvm/Bitstream/BitCodes.h"

namespace clang {
namespace serialized_diags {
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Serialization/ASTBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Bitcode/BitCodes.h"
#include "llvm/Bitstream/BitCodes.h"
#include <cassert>
#include <cstdint>

Expand Down
Loading