Skip to content

Commit 789d13c

Browse files
author
Erich Keane
committed
Change name to integration footer
1 parent 14c6d65 commit 789d13c

File tree

7 files changed

+31
-32
lines changed

7 files changed

+31
-32
lines changed

clang/include/clang/Basic/LangOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ class LangOptions : public LangOptionsBase {
350350
/// SYCL integration header to be generated by the device compiler
351351
std::string SYCLIntHeader;
352352

353-
/// SYCL post integration header to be generated by the device compiler
354-
std::string SYCLPostIntHeader;
353+
/// SYCL integration footer to be generated by the device compiler
354+
std::string SYCLIntFooter;
355355

356356
LangOptions();
357357

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5685,11 +5685,11 @@ def fsycl_int_header : Separate<["-"], "fsycl-int-header">,
56855685
MarshallingInfoString<LangOpts<"SYCLIntHeader">>;
56865686
def fsycl_int_header_EQ : Joined<["-"], "fsycl-int-header=">,
56875687
Alias<fsycl_int_header>;
5688-
def fsycl_post_int_header : Separate<["-"], "fsycl-post-int-header">,
5689-
HelpText<"Generate SYCL post integration header into this file.">,
5690-
MarshallingInfoString<LangOpts<"SYCLPostIntHeader">>;
5691-
def fsycl_post_int_header_EQ : Joined<["-"], "fsycl-post-int-header=">,
5692-
Alias<fsycl_post_int_header>;
5688+
def fsycl_int_footer : Separate<["-"], "fsycl-int-footer">,
5689+
HelpText<"Generate SYCL integration footer into this file.">,
5690+
MarshallingInfoString<LangOpts<"SYCLIntFooter">>;
5691+
def fsycl_int_footer_EQ : Joined<["-"], "fsycl-int-footer=">,
5692+
Alias<fsycl_int_footer>;
56935693
def fsycl_std_layout_kernel_params: Flag<["-"], "fsycl-std-layout-kernel-params">,
56945694
HelpText<"Enable standard layout requirement for SYCL kernel parameters.">,
56955695
MarshallingInfoFlag<LangOpts<"SYCLStdLayoutKernelParams">>;

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,9 @@ class SYCLIntegrationHeader {
430430
Sema &S;
431431
};
432432

433-
class SYCLPostIntegrationHeader {
433+
class SYCLIntegrationFooter {
434434
public:
435-
SYCLPostIntegrationHeader(Sema &S) : S(S) {}
435+
SYCLIntegrationFooter(Sema &S) : S(S) {}
436436
bool emit(StringRef MainSrc);
437437

438438
private:
@@ -13119,7 +13119,7 @@ class Sema final {
1311913119
// SYCL integration header instance for current compilation unit this Sema
1312013120
// is associated with.
1312113121
std::unique_ptr<SYCLIntegrationHeader> SyclIntHeader;
13122-
std::unique_ptr<SYCLPostIntegrationHeader> SyclPostIntHeader;
13122+
std::unique_ptr<SYCLIntegrationFooter> SyclIntFooter;
1312313123

1312413124
// Used to suppress diagnostics during kernel construction, since these were
1312513125
// already emitted earlier. Diagnosing during Kernel emissions also skips the
@@ -13138,10 +13138,10 @@ class Sema final {
1313813138
return *SyclIntHeader.get();
1313913139
}
1314013140

13141-
SYCLPostIntegrationHeader &getSyclPostIntegrationHeader() {
13142-
if (SyclPostIntHeader == nullptr)
13143-
SyclPostIntHeader = std::make_unique<SYCLPostIntegrationHeader>(*this);
13144-
return *SyclPostIntHeader.get();
13141+
SYCLIntegrationFooter &getSyclIntegrationFooter() {
13142+
if (SyclIntFooter == nullptr)
13143+
SyclIntFooter = std::make_unique<SYCLIntegrationFooter>(*this);
13144+
return *SyclIntFooter.get();
1314513145
}
1314613146

1314713147
enum SYCLRestrictKind {

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4390,7 +4390,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
43904390
Res.getTargetOpts().HostTriple = Res.getFrontendOpts().AuxTriple;
43914391
// If specified, create empty integration header files for now.
43924392
CreateEmptyFile(LangOpts.SYCLIntHeader);
4393-
CreateEmptyFile(LangOpts.SYCLPostIntHeader);
4393+
CreateEmptyFile(LangOpts.SYCLIntFooter);
43944394
}
43954395

43964396
Success &= ParseCodeGenArgs(Res.getCodeGenOpts(), Args, DashX, Diags, T,

clang/lib/Sema/Sema.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
183183
DisableTypoCorrection(false), TyposCorrected(0), AnalysisWarnings(*this),
184184
ThreadSafetyDeclCache(nullptr), VarDataSharingAttributesStack(nullptr),
185185
CurScope(nullptr), Ident_super(nullptr), Ident___float128(nullptr),
186-
SyclIntHeader(nullptr), SyclPostIntHeader(nullptr) {
186+
SyclIntHeader(nullptr), SyclIntFooter(nullptr) {
187187
TUScope = nullptr;
188188
isConstantEvaluatedOverride = false;
189189

@@ -1037,8 +1037,8 @@ void Sema::ActOnEndOfTranslationUnitFragment(TUFragmentKind Kind) {
10371037
// Emit SYCL integration header for current translation unit if needed
10381038
if (SyclIntHeader != nullptr)
10391039
SyclIntHeader->emit(getLangOpts().SYCLIntHeader);
1040-
if (SyclPostIntHeader != nullptr)
1041-
SyclPostIntHeader->emit(getLangOpts().SYCLPostIntHeader);
1040+
if (SyclIntFooter != nullptr)
1041+
SyclIntFooter->emit(getLangOpts().SYCLIntFooter);
10421042
MarkDevice();
10431043
}
10441044

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,12 +3086,12 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
30863086
using SyclKernelFieldHandler::leaveStruct;
30873087
};
30883088

3089-
class SyclKernelPostIntHeaderCreator : public SyclKernelFieldHandler {
3090-
SYCLPostIntegrationHeader &Header;
3089+
class SyclKernelIntFooterCreator : public SyclKernelFieldHandler {
3090+
SYCLIntegrationFooter &Footer;
30913091

30923092
public:
3093-
SyclKernelPostIntHeaderCreator(Sema &S, SYCLPostIntegrationHeader &H)
3094-
: SyclKernelFieldHandler(S), Header(H) {}
3093+
SyclKernelIntFooterCreator(Sema &S, SYCLIntegrationFooter &F)
3094+
: SyclKernelFieldHandler(S), Footer(F) {}
30953095
};
30963096

30973097
} // namespace
@@ -3419,14 +3419,13 @@ void Sema::ConstructOpenCLKernel(FunctionDecl *KernelCallerFunc,
34193419
calculateKernelNameType(Context, KernelCallerFunc), KernelName,
34203420
StableName, KernelCallerFunc);
34213421

3422-
SyclKernelPostIntHeaderCreator post_int_header(
3423-
*this, getSyclPostIntegrationHeader());
3422+
SyclKernelIntFooterCreator int_footer(*this, getSyclIntegrationFooter());
34243423

34253424
KernelObjVisitor Visitor{*this};
34263425
Visitor.VisitRecordBases(KernelObj, kernel_decl, kernel_body, int_header,
3427-
post_int_header);
3426+
int_footer);
34283427
Visitor.VisitRecordFields(KernelObj, kernel_decl, kernel_body, int_header,
3429-
post_int_header);
3428+
int_footer);
34303429

34313430
if (ParmVarDecl *KernelHandlerArg =
34323431
getSyclKernelHandlerArg(KernelCallerFunc)) {
@@ -4239,7 +4238,7 @@ SYCLIntegrationHeader::SYCLIntegrationHeader(bool _UnnamedLambdaSupport,
42394238
: UnnamedLambdaSupport(_UnnamedLambdaSupport), S(_S) {}
42404239

42414240
// Post-compile integration header support.
4242-
bool SYCLPostIntegrationHeader::emit(StringRef IntHeaderName) {
4241+
bool SYCLIntegrationFooter::emit(StringRef IntHeaderName) {
42434242
if (IntHeaderName.empty())
42444243
return false;
42454244
int IntHeaderFD = 0;
@@ -4254,8 +4253,8 @@ bool SYCLPostIntegrationHeader::emit(StringRef IntHeaderName) {
42544253
return emit(Out);
42554254
}
42564255

4257-
bool SYCLPostIntegrationHeader::emit(raw_ostream &O) {
4258-
O << "// Post Integration Header contents to go here.\n";
4256+
bool SYCLIntegrationFooter::emit(raw_ostream &O) {
4257+
O << "// Integration Footer contents to go here.\n";
42594258
return true;
42604259
}
42614260

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -fsycl-post-int-header=%t.h %s -emit-llvm -o %t.ll
1+
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -fsycl-int_footer=%t.h %s -emit-llvm -o %t.ll
22
// RUN: FileCheck -input-file=%t.h %s
33

4-
// CHECK: // Post Integration Header contents to go here.
4+
// CHECK: // Integration Footer contents to go here.
55

66
#include "Inputs/sycl.hpp"
77

8-
int main() {
8+
nt main() {
99
cl::sycl::kernel_single_task<class first_kernel>([]() {});
1010
}

0 commit comments

Comments
 (0)