Skip to content

Commit

Permalink
fix some remaining formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Oct 14, 2023
1 parent 5956fc2 commit 01983b4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
3 changes: 1 addition & 2 deletions clang/include/clang/Lex/Preprocessor.h
Expand Up @@ -2446,8 +2446,7 @@ class Preprocessor {
/// reference is for system \#include's or not (i.e. using <> instead of "").
OptionalFileEntryRef
LookupEmbedFile(SourceLocation FilenameLoc, StringRef Filename, bool isAngled,
bool OpenFile,
const FileEntry *LookupFromFile = nullptr,
bool OpenFile, const FileEntry *LookupFromFile = nullptr,
SmallVectorImpl<char> *SearchPath = nullptr,
SmallVectorImpl<char> *RelativePath = nullptr);

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Frontend/DependencyGraph.cpp
Expand Up @@ -53,7 +53,7 @@ class DependencyGraphCallback : public PPCallbacks {
DependencyGraphCallback(const Preprocessor *_PP, StringRef OutputFile,
StringRef SysRoot,
DirectiveBehavior Action = IgnoreEmbed)
: PP(_PP), OutputFile(OutputFile.str()), SysRoot(SysRoot.str()) { }
: PP(_PP), OutputFile(OutputFile.str()), SysRoot(SysRoot.str()) {}

void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
StringRef FileName, bool IsAngled,
Expand Down
10 changes: 5 additions & 5 deletions clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
Expand Up @@ -463,11 +463,11 @@ void InclusionRewriter::Process(FileID FileId,
// Add line marker to indicate we're returning from an included
// file.
LineInfoExtra = " 2";
}
// fix up lineinfo (since commented out directive changed line
// numbers) for inclusions that were skipped due to header guards
WriteLineInfo(FileName, Line, FileType, LineInfoExtra);
break;
}
// fix up lineinfo (since commented out directive changed line
// numbers) for inclusions that were skipped due to header guards
WriteLineInfo(FileName, Line, FileType, LineInfoExtra);
break;
}
case tok::pp_pragma: {
StringRef Identifier = NextIdentifierName(RawLex, RawToken);
Expand Down
8 changes: 4 additions & 4 deletions clang/lib/Lex/PPDirectives.cpp
Expand Up @@ -4193,16 +4193,16 @@ void Preprocessor::HandleEmbedDirective(SourceLocation HashLoc, Token &EmbedTok,
if (Callbacks && Callbacks->EmbedFileNotFound(OriginalFilename)) {
return;
}
Diag(FilenameTok, diag::err_pp_file_not_found)
<< Filename;
Diag(FilenameTok, diag::err_pp_file_not_found) << Filename;
return;
}
std::optional<int64_t> MaybeSignedLimit{};
if (Params.MaybeLimitParam) {
MaybeSignedLimit = static_cast<int64_t>(Params.MaybeLimitParam->Limit);
}
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> MaybeFile = getFileManager().getBufferForFile(
*MaybeFileRef, false, false, MaybeSignedLimit);
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> MaybeFile =
getFileManager().getBufferForFile(*MaybeFileRef, false, false,
MaybeSignedLimit);
if (!MaybeFile) {
// could not find file
Diag(FilenameTok, diag::err_cannot_open_file)
Expand Down
9 changes: 9 additions & 0 deletions clang/lib/Parse/ParseExpr.cpp
Expand Up @@ -742,6 +742,8 @@ class CastExpressionIdValidator final : public CorrectionCandidateCallback {
};
}

// clang-format off

/// Parse a cast-expression, or, if \pisUnaryExpression is true, parse
/// a unary-expression.
///
Expand Down Expand Up @@ -926,6 +928,9 @@ class CastExpressionIdValidator final : public CorrectionCandidateCallback {
/// '__is_rvalue_expr'
/// \endverbatim
///

// clang-format on

ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
bool isAddressOfOperand,
bool &NotCastExpr,
Expand Down Expand Up @@ -2564,6 +2569,8 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
return Operand;
}

// clang-format off

/// ParseBuiltinPrimaryExpression
///
/// \verbatim
Expand All @@ -2588,6 +2595,8 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
/// [GNU] offsetof-member-designator '.' identifier
/// [GNU] offsetof-member-designator '[' expression ']'
/// \endverbatim

// clang-format on
ExprResult Parser::ParseBuiltinPrimaryExpression() {
ExprResult Res;
const IdentifierInfo *BuiltinII = Tok.getIdentifierInfo();
Expand Down

0 comments on commit 01983b4

Please sign in to comment.