Skip to content

Commit 51951a7

Browse files
committed
Squash; address the non-dumb clang-format complaints.
1 parent a634261 commit 51951a7

File tree

5 files changed

+32
-36
lines changed

5 files changed

+32
-36
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4730,9 +4730,8 @@ class OutlinedFunctionDecl final
47304730

47314731
static OutlinedFunctionDecl *Create(ASTContext &C, DeclContext *DC,
47324732
unsigned NumParams);
4733-
static OutlinedFunctionDecl *CreateDeserialized(ASTContext &C,
4734-
GlobalDeclID ID,
4735-
unsigned NumParams);
4733+
static OutlinedFunctionDecl *
4734+
CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumParams);
47364735

47374736
Stmt *getBody() const override;
47384737
void setBody(Stmt *B);

clang/include/clang/AST/StmtSYCL.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class SYCLKernelCallStmt : public Stmt {
4848
: Stmt(SYCLKernelCallStmtClass), OriginalStmt(OS), OFDecl(OFD) {}
4949

5050
/// Construct an empty SYCL kernel call statement.
51-
SYCLKernelCallStmt(EmptyShell Empty)
52-
: Stmt(SYCLKernelCallStmtClass, Empty) {}
51+
SYCLKernelCallStmt(EmptyShell Empty) : Stmt(SYCLKernelCallStmtClass, Empty) {}
5352

5453
/// Retrieve the model statement.
5554
Stmt *getOriginalStmt() { return OriginalStmt; }
@@ -61,9 +60,7 @@ class SYCLKernelCallStmt : public Stmt {
6160
const OutlinedFunctionDecl *getOutlinedFunctionDecl() const { return OFDecl; }
6261

6362
/// Set the outlined function declaration.
64-
void setOutlinedFunctionDecl(OutlinedFunctionDecl *OFD) {
65-
OFDecl = OFD;
66-
}
63+
void setOutlinedFunctionDecl(OutlinedFunctionDecl *OFD) { OFDecl = OFD; }
6764

6865
SourceLocation getBeginLoc() const LLVM_READONLY {
6966
return getOriginalStmt()->getBeginLoc();

clang/lib/AST/Decl.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5448,30 +5448,34 @@ BlockDecl *BlockDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
54485448
return new (C, ID) BlockDecl(nullptr, SourceLocation());
54495449
}
54505450

5451-
54525451
OutlinedFunctionDecl::OutlinedFunctionDecl(DeclContext *DC, unsigned NumParams)
5453-
: Decl(OutlinedFunction, DC, SourceLocation()), DeclContext(OutlinedFunction),
5454-
NumParams(NumParams), BodyAndNothrow(nullptr, false) {}
5452+
: Decl(OutlinedFunction, DC, SourceLocation()),
5453+
DeclContext(OutlinedFunction), NumParams(NumParams),
5454+
BodyAndNothrow(nullptr, false) {}
54555455

5456-
OutlinedFunctionDecl *OutlinedFunctionDecl::Create(ASTContext &C, DeclContext *DC,
5457-
unsigned NumParams) {
5456+
OutlinedFunctionDecl *OutlinedFunctionDecl::Create(ASTContext &C,
5457+
DeclContext *DC,
5458+
unsigned NumParams) {
54585459
return new (C, DC, additionalSizeToAlloc<ImplicitParamDecl *>(NumParams))
54595460
OutlinedFunctionDecl(DC, NumParams);
54605461
}
54615462

5462-
OutlinedFunctionDecl *OutlinedFunctionDecl::CreateDeserialized(ASTContext &C,
5463-
GlobalDeclID ID,
5464-
unsigned NumParams) {
5463+
OutlinedFunctionDecl *
5464+
OutlinedFunctionDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID,
5465+
unsigned NumParams) {
54655466
return new (C, ID, additionalSizeToAlloc<ImplicitParamDecl *>(NumParams))
54665467
OutlinedFunctionDecl(nullptr, NumParams);
54675468
}
54685469

5469-
Stmt *OutlinedFunctionDecl::getBody() const { return BodyAndNothrow.getPointer(); }
5470+
Stmt *OutlinedFunctionDecl::getBody() const {
5471+
return BodyAndNothrow.getPointer();
5472+
}
54705473
void OutlinedFunctionDecl::setBody(Stmt *B) { BodyAndNothrow.setPointer(B); }
54715474

54725475
bool OutlinedFunctionDecl::isNothrow() const { return BodyAndNothrow.getInt(); }
5473-
void OutlinedFunctionDecl::setNothrow(bool Nothrow) { BodyAndNothrow.setInt(Nothrow); }
5474-
5476+
void OutlinedFunctionDecl::setNothrow(bool Nothrow) {
5477+
BodyAndNothrow.setInt(Nothrow);
5478+
}
54755479

54765480
CapturedDecl::CapturedDecl(DeclContext *DC, unsigned NumParams)
54775481
: Decl(Captured, DC, SourceLocation()), DeclContext(Captured),

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// This implements Semantic Analysis for SYCL constructs.
99
//===----------------------------------------------------------------------===//
1010

11-
#include "TreeTransform.h"
1211
#include "clang/Sema/SemaSYCL.h"
12+
#include "TreeTransform.h"
1313
#include "clang/AST/Mangle.h"
14-
#include "clang/AST/StmtSYCL.h"
1514
#include "clang/AST/SYCLKernelInfo.h"
15+
#include "clang/AST/StmtSYCL.h"
1616
#include "clang/AST/TypeOrdering.h"
1717
#include "clang/Basic/Diagnostic.h"
1818
#include "clang/Sema/Attr.h"
@@ -375,16 +375,14 @@ namespace {
375375
class OutlinedFunctionDeclBodyInstantiator
376376
: public TreeTransform<OutlinedFunctionDeclBodyInstantiator> {
377377
public:
378-
using ParmDeclMap = llvm::DenseMap<ParmVarDecl*, VarDecl*>;
378+
using ParmDeclMap = llvm::DenseMap<ParmVarDecl *, VarDecl *>;
379379

380380
OutlinedFunctionDeclBodyInstantiator(Sema &S, ParmDeclMap &M)
381-
: TreeTransform<OutlinedFunctionDeclBodyInstantiator>(S),
382-
SemaRef(S), MapRef(M) {}
381+
: TreeTransform<OutlinedFunctionDeclBodyInstantiator>(S), SemaRef(S),
382+
MapRef(M) {}
383383

384384
// A new set of AST nodes is always required.
385-
bool AlwaysRebuild() {
386-
return true;
387-
}
385+
bool AlwaysRebuild() { return true; }
388386

389387
// Transform ParmVarDecl references to the supplied replacement variables.
390388
ExprResult TransformDeclRefExpr(DeclRefExpr *DRE) {
@@ -427,7 +425,7 @@ StmtResult SemaSYCL::BuildSYCLKernelCallStmt(FunctionDecl *FD, Stmt *Body) {
427425
// Ensure that the kernel name was previously registered and that the
428426
// stored declaration matches.
429427
const SYCLKernelInfo &SKI =
430-
getASTContext().getSYCLKernelInfo(SKEPAttr->getKernelName());
428+
getASTContext().getSYCLKernelInfo(SKEPAttr->getKernelName());
431429
assert(declaresSameEntity(SKI.getKernelEntryPointDecl(), FD) &&
432430
"SYCL kernel name conflict");
433431

@@ -439,10 +437,9 @@ StmtResult SemaSYCL::BuildSYCLKernelCallStmt(FunctionDecl *FD, Stmt *Body) {
439437
OutlinedFunctionDecl::Create(getASTContext(), FD, FD->getNumParams());
440438
unsigned i = 0;
441439
for (ParmVarDecl *PVD : FD->parameters()) {
442-
ImplicitParamDecl *IPD =
443-
ImplicitParamDecl::Create(getASTContext(), OFD, SourceLocation(),
444-
PVD->getIdentifier(), PVD->getType(),
445-
ImplicitParamKind::Other);
440+
ImplicitParamDecl *IPD = ImplicitParamDecl::Create(
441+
getASTContext(), OFD, SourceLocation(), PVD->getIdentifier(),
442+
PVD->getType(), ImplicitParamKind::Other);
446443
OFD->setParam(i, IPD);
447444
ParmMap[PVD] = IPD;
448445
++i;

clang/lib/Sema/TreeTransform.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17058,10 +17058,9 @@ QualType TreeTransform<Derived>::RebuildDependentSizedMatrixType(
1705817058
AttributeLoc);
1705917059
}
1706017060

17061-
template<typename Derived>
17061+
template <typename Derived>
1706217062
QualType TreeTransform<Derived>::RebuildFunctionProtoType(
17063-
QualType T,
17064-
MutableArrayRef<QualType> ParamTypes,
17063+
QualType T, MutableArrayRef<QualType> ParamTypes,
1706517064
const FunctionProtoType::ExtProtoInfo &EPI) {
1706617065
return SemaRef.BuildFunctionType(T, ParamTypes,
1706717066
getDerived().getBaseLocation(),
@@ -17417,7 +17416,7 @@ TreeTransform<Derived>::TransformCapturedStmt(CapturedStmt *S) {
1741717416
return getSema().ActOnCapturedRegionEnd(Body.get());
1741817417
}
1741917418

17420-
template<typename Derived>
17419+
template <typename Derived>
1742117420
StmtResult
1742217421
TreeTransform<Derived>::TransformSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
1742317422
// SYCLKernelCallStmt nodes are inserted upon completion of a (non-template)

0 commit comments

Comments
 (0)