Skip to content

Commit 3a58c88

Browse files
committed
clang-format
1 parent cf2568d commit 3a58c88

File tree

9 files changed

+35
-41
lines changed

9 files changed

+35
-41
lines changed

clang/include/clang/AST/DeclBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ class DeclContext {
19541954
LLVM_PREFERRED_TYPE(DeclContextBitfields)
19551955
uint64_t : NumDeclContextBits;
19561956

1957-
uint64_t AtStart: SourceLocation::Bits;
1957+
uint64_t AtStart : SourceLocation::Bits;
19581958
};
19591959

19601960
/// Number of inherited and non-inherited bits in ObjCContainerDeclBitfields.

clang/include/clang/AST/Expr.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,9 @@ class DeclRefExpr final
12711271
friend class ASTStmtReader;
12721272
friend class ASTStmtWriter;
12731273
friend TrailingObjects;
1274-
1275-
/// The location of the declaration name itself.
1276-
SourceLocation Loc;
1274+
1275+
/// The location of the declaration name itself.
1276+
SourceLocation Loc;
12771277

12781278
/// The declaration that we are referencing.
12791279
ValueDecl *D;
@@ -2008,8 +2008,8 @@ class PredefinedExpr final
20082008
private llvm::TrailingObjects<PredefinedExpr, Stmt *> {
20092009
friend class ASTStmtReader;
20102010
friend TrailingObjects;
2011-
/// The location of this PredefinedExpr.
2012-
SourceLocation Loc;
2011+
/// The location of this PredefinedExpr.
2012+
SourceLocation Loc;
20132013
// PredefinedExpr is optionally followed by a single trailing
20142014
// "Stmt *" for the predefined identifier. It is present if and only if
20152015
// hasFunctionName() is true and is always a "StringLiteral *".
@@ -3123,7 +3123,9 @@ class CallExpr : public Expr {
31233123
/// Bluntly set a new number of arguments without doing any checks whatsoever.
31243124
/// Only used during construction of a CallExpr in a few places in Sema.
31253125
/// FIXME: Find a way to remove it.
3126-
void setNumArgsUnsafe(unsigned NewNumArgs) { CallExprBits.NumArgs = NewNumArgs; }
3126+
void setNumArgsUnsafe(unsigned NewNumArgs) {
3127+
CallExprBits.NumArgs = NewNumArgs;
3128+
}
31273129

31283130
typedef ExprIterator arg_iterator;
31293131
typedef ConstExprIterator const_arg_iterator;
@@ -3308,7 +3310,7 @@ class MemberExpr final
33083310

33093311
/// MemberLoc - This is the location of the member name.
33103312
SourceLocation MemberLoc;
3311-
3313+
33123314
SourceLocation OperatorLoc;
33133315

33143316
size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>) const {

clang/include/clang/AST/Stmt.h

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,6 @@ class alignas(void *) Stmt {
455455
unsigned NonOdrUseReason : 2;
456456
LLVM_PREFERRED_TYPE(bool)
457457
unsigned IsImmediateEscalating : 1;
458-
459-
460458
};
461459

462460

@@ -526,8 +524,6 @@ class alignas(void *) Stmt {
526524
/// It is 0 otherwise.
527525
LLVM_PREFERRED_TYPE(bool)
528526
unsigned HasFPFeatures : 1;
529-
530-
531527
};
532528

533529
class UnaryExprOrTypeTraitExprBitfields {
@@ -582,8 +578,8 @@ class alignas(void *) Stmt {
582578
/// Trailing objects. See the definition of CallExpr.
583579
LLVM_PREFERRED_TYPE(bool)
584580
unsigned HasTrailingSourceLoc : 1;
585-
586-
unsigned NumArgs:20;
581+
582+
unsigned NumArgs : 20;
587583
};
588584
enum { NumCallExprBits = 52 };
589585

@@ -629,7 +625,7 @@ class alignas(void *) Stmt {
629625
/// This is the location of the -> or . in the expression.
630626
// SourceLocation OperatorLoc;
631627
};
632-
628+
633629
// 8 bytes
634630
class CastExprBitfields {
635631
friend class CastExpr;
@@ -1047,8 +1043,6 @@ class alignas(void *) Stmt {
10471043
unsigned ConstructionKind : 3;
10481044
LLVM_PREFERRED_TYPE(bool)
10491045
unsigned IsImmediateEscalating : 1;
1050-
1051-
10521046
};
10531047

10541048
class ExprWithCleanupsBitfields {
@@ -1978,8 +1972,8 @@ class CaseStmt final
19781972
// with a range. Present if and only if caseStmtIsGNURange() is true.
19791973
enum { LhsOffset = 0, SubStmtOffsetFromRhs = 1 };
19801974
enum { NumMandatoryStmtPtr = 2 };
1981-
/// The location of the "case" or "default" keyword.
1982-
SourceLocation KeywordLoc;
1975+
/// The location of the "case" or "default" keyword.
1976+
SourceLocation KeywordLoc;
19831977
unsigned numTrailingObjects(OverloadToken<Stmt *>) const {
19841978
return NumMandatoryStmtPtr + caseStmtIsGNURange();
19851979
}
@@ -2241,8 +2235,8 @@ class AttributedStmt final
22412235
private llvm::TrailingObjects<AttributedStmt, const Attr *> {
22422236
friend class ASTStmtReader;
22432237
friend TrailingObjects;
2244-
/// The location of the attribute.
2245-
SourceLocation AttrLoc;
2238+
/// The location of the attribute.
2239+
SourceLocation AttrLoc;
22462240
Stmt *SubStmt;
22472241

22482242
AttributedStmt(SourceLocation Loc, ArrayRef<const Attr *> Attrs,
@@ -3116,7 +3110,6 @@ class IndirectGotoStmt : public Stmt {
31163110
/// ContinueStmt - This represents a continue.
31173111
class ContinueStmt : public Stmt {
31183112
public:
3119-
31203113
ContinueStmt(SourceLocation CL) : Stmt(ContinueStmtClass) {
31213114
setContinueLoc(CL);
31223115
}

clang/include/clang/Basic/SourceManager.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,9 +1981,8 @@ class SourceManager : public RefCountedBase<SourceManager> {
19811981

19821982
FileIDAndOffset
19831983
getDecomposedExpansionLocSlowCase(const SrcMgr::SLocEntry *E) const;
1984-
FileIDAndOffset
1985-
getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
1986-
unsigned Offset) const;
1984+
FileIDAndOffset getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
1985+
unsigned Offset) const;
19871986
void computeMacroArgsCache(MacroArgsMap &MacroArgsCache, FileID FID) const;
19881987
void associateFileChunkWithMacroArgExp(MacroArgsMap &MacroArgsCache,
19891988
FileID FID,

clang/tools/libclang/CIndex.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,9 @@ CXSourceRange cxloc::translateSourceRange(const SourceManager &SM,
175175
}
176176

177177
CharSourceRange cxloc::translateCXRangeToCharRange(CXSourceRange R) {
178-
if (!R.ptr_data[0])
179-
return CharSourceRange();
180-
const SourceManager &SM =
181-
*static_cast<const SourceManager *>(R.ptr_data[0]);
178+
if (!R.ptr_data[0])
179+
return CharSourceRange();
180+
const SourceManager &SM = *static_cast<const SourceManager *>(R.ptr_data[0]);
182181
return CharSourceRange::getCharRange(
183182
SourceLocation::getFromRawEncoding32(SM, R.begin_int_data),
184183
SourceLocation::getFromRawEncoding32(SM, R.end_int_data));
@@ -7643,7 +7642,8 @@ CXString clang_getTokenSpelling(CXTranslationUnit TU, CXToken CXTok) {
76437642
if (!CXXUnit)
76447643
return cxstring::createEmpty();
76457644

7646-
SourceLocation Loc = SourceLocation::getFromRawEncoding32(CXXUnit->getSourceManager(), CXTok.int_data[1]);
7645+
SourceLocation Loc = SourceLocation::getFromRawEncoding32(
7646+
CXXUnit->getSourceManager(), CXTok.int_data[1]);
76477647
auto LocInfo = CXXUnit->getSourceManager().getDecomposedSpellingLoc(Loc);
76487648
bool Invalid = false;
76497649
StringRef Buffer =
@@ -7666,7 +7666,8 @@ CXSourceLocation clang_getTokenLocation(CXTranslationUnit TU, CXToken CXTok) {
76667666

76677667
return cxloc::translateSourceLocation(
76687668
CXXUnit->getASTContext(),
7669-
SourceLocation::getFromRawEncoding32(CXXUnit->getSourceManager(), CXTok.int_data[1]));
7669+
SourceLocation::getFromRawEncoding32(CXXUnit->getSourceManager(),
7670+
CXTok.int_data[1]));
76707671
}
76717672

76727673
CXSourceRange clang_getTokenExtent(CXTranslationUnit TU, CXToken CXTok) {
@@ -7681,7 +7682,8 @@ CXSourceRange clang_getTokenExtent(CXTranslationUnit TU, CXToken CXTok) {
76817682

76827683
return cxloc::translateSourceRange(
76837684
CXXUnit->getASTContext(),
7684-
SourceLocation::getFromRawEncoding32(CXXUnit->getSourceManager(), CXTok.int_data[1]));
7685+
SourceLocation::getFromRawEncoding32(CXXUnit->getSourceManager(),
7686+
CXTok.int_data[1]));
76857687
}
76867688

76877689
static bool getTokens(ASTUnit *CXXUnit, SourceRange Range,
@@ -7726,7 +7728,7 @@ static bool getTokens(ASTUnit *CXXUnit, SourceRange Range,
77267728
if (!Tok.getLocation().getRawEncoding32(TokLocRaw))
77277729
return false; // location is too big for libclang ABI
77287730
CXTok.int_data[1] = TokLocRaw;
7729-
7731+
77307732
CXTok.int_data[2] = Tok.getLength();
77317733
CXTok.int_data[3] = 0;
77327734

clang/tools/libclang/CXSourceLocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int clang_Location_isInSystemHeader(CXSourceLocation location) {
216216
const SourceManager &SM =
217217
*static_cast<const SourceManager *>(location.ptr_data[0]);
218218
const SourceLocation Loc =
219-
SourceLocation::getFromRawEncoding32(SM, location.int_data);
219+
SourceLocation::getFromRawEncoding32(SM, location.int_data);
220220
if (Loc.isInvalid())
221221
return 0;
222222

clang/tools/libclang/CXSourceLocation.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ static inline CXSourceRange translateSourceRange(ASTContext &Context,
6969
}
7070

7171
static inline SourceLocation translateSourceLocation(CXSourceLocation L) {
72-
if (!L.ptr_data[0]) {
72+
if (!L.ptr_data[0]) {
7373
return SourceLocation();
7474
}
75-
const SourceManager &SM =
76-
*static_cast<const SourceManager *>(L.ptr_data[0]);
75+
const SourceManager &SM = *static_cast<const SourceManager *>(L.ptr_data[0]);
7776
return SourceLocation::getFromRawEncoding32(SM, L.int_data);
7877
}
7978

clang/tools/libclang/Indexing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ void clang_indexLoc_getFileLocation(CXIdxLoc location,
995995

996996
CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc location) {
997997
if (!location.ptr_data[0])
998-
return clang_getNullLocation();
998+
return clang_getNullLocation();
999999

10001000
CXIndexDataConsumer &DataConsumer =
10011001
*static_cast<CXIndexDataConsumer *>(location.ptr_data[0]);

clang/unittests/Serialization/SourceLocationEncodingTest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ void roundTrip(SourceLocation::UIntTy Loc,
3232
SourceLocation::UIntTy DecodedEncoded =
3333
SourceLocationEncoding::decode(ActualEncoded).first.getRawEncoding();
3434
ASSERT_EQ(DecodedEncoded, Loc) << "Decoding " << ActualEncoded;
35-
}
35+
}
3636

37-
constexpr SourceLocation::UIntTy MacroBit =
38-
1ull << (SourceLocation::Bits - 1);
37+
constexpr SourceLocation::UIntTy MacroBit = 1ull << (SourceLocation::Bits - 1);
3938
constexpr SourceLocation::UIntTy Big = 1ull << (SourceLocation::Bits - 2);
4039
constexpr SourceLocation::UIntTy Biggest =
4140
llvm::maskTrailingOnes<uint64_t>(SourceLocation::Bits - 1);

0 commit comments

Comments
 (0)