Skip to content

[SYCL][NFC] Rename file and variables/methods #4000

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
merged 1 commit into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 5 additions & 7 deletions clang/include/clang/Basic/Diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/OptReportHandler.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/SyclOptReportHandler.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
Expand Down Expand Up @@ -295,7 +295,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
DiagnosticConsumer *Client = nullptr;
std::unique_ptr<DiagnosticConsumer> Owner;
SourceManager *SourceMgr = nullptr;
SyclOptReportHandler OptReportHandler;
SyclOptReportHandler SyclOptReport;

/// Mapping information for diagnostics.
///
Expand Down Expand Up @@ -549,11 +549,9 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
LLVM_DUMP_METHOD void dump() const;
LLVM_DUMP_METHOD void dump(StringRef DiagName) const;

/// Retrieve the report SyclOptReport info.
SyclOptReportHandler &getSYCLOptReportHandler() { return OptReportHandler; }
const SyclOptReportHandler &getSYCLOptReportHandler() const {
return OptReportHandler;
}
/// Retrieve the SyclOptReport info.
SyclOptReportHandler &getSYCLOptReport() { return SyclOptReport; }
const SyclOptReportHandler &getSYCLOptReport() const { return SyclOptReport; }

const IntrusiveRefCntPtr<DiagnosticIDs> &getDiagnosticIDs() const {
return Diags;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===---------------------- SyclOptReportHandler.h --------------*- C++ -*-===//
//===------------------------ OptReportHandler.h ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -11,8 +11,8 @@
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_BASIC_SYCLOPTREPORTHANDLER_H
#define LLVM_CLANG_BASIC_SYCLOPTREPORTHANDLER_H
#ifndef LLVM_CLANG_BASIC_OPTREPORTHANDLER_H
#define LLVM_CLANG_BASIC_OPTREPORTHANDLER_H

#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/DenseMap.h"
Expand Down Expand Up @@ -56,12 +56,11 @@ class SyclOptReportHandler {
assert(It != Map.end());
return It->second;
}

bool HasOptReportInfo(const FunctionDecl *FD) const {
return Map.find(FD) != Map.end();
}
};

} // namespace clang

#endif // LLVM_CLANG_BASIC_SYCLOPTREPORTHANDLER_H
#endif // LLVM_CLANG_BASIC_OPTREPORTHANDLER_H
7 changes: 3 additions & 4 deletions clang/lib/CodeGen/CodeGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,11 +1523,10 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
// Emit the standard function prologue.
StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin());

SyclOptReportHandler &OptReportHandler =
CGM.getDiags().getSYCLOptReportHandler();
if (OptReportHandler.HasOptReportInfo(FD)) {
SyclOptReportHandler &SyclOptReport = CGM.getDiags().getSYCLOptReport();
if (SyclOptReport.HasOptReportInfo(FD)) {
llvm::OptimizationRemarkEmitter ORE(Fn);
for (auto ORI : llvm::enumerate(OptReportHandler.GetInfo(FD))) {
for (auto ORI : llvm::enumerate(SyclOptReport.GetInfo(FD))) {
llvm::DiagnosticLocation DL =
SourceLocToDebugLoc(ORI.value().KernelArgLoc);
StringRef NameInDesc = ORI.value().KernelArgDescName;
Expand Down
8 changes: 4 additions & 4 deletions clang/lib/Sema/SemaSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ class SyclOptReportCreator : public SyclKernelFieldHandler {
unsigned KernelArgSize =
SemaRef.getASTContext().getTypeSizeInChars(KernelArgType).getQuantity();

SemaRef.getDiagnostics().getSYCLOptReportHandler().AddKernelArgs(
SemaRef.getDiagnostics().getSYCLOptReport().AddKernelArgs(
DC.getKernelDecl(), NameToEmitInDescription,
isWrappedField ? "Compiler generated" : KernelArgType.getAsString(),
KernelInvocationLoc, KernelArgSize, getKernelArgDesc(KernelArgDesc),
Expand All @@ -2448,7 +2448,7 @@ class SyclOptReportCreator : public SyclKernelFieldHandler {
KernelArgDescription KernelArgDesc) {
unsigned KernelArgSize =
SemaRef.getASTContext().getTypeSizeInChars(KernelArgType).getQuantity();
SemaRef.getDiagnostics().getSYCLOptReportHandler().AddKernelArgs(
SemaRef.getDiagnostics().getSYCLOptReport().AddKernelArgs(
DC.getKernelDecl(), KernelArgType.getAsString(),
KernelArgType.getAsString(), KernelInvocationLoc, KernelArgSize,
getKernelArgDesc(KernelArgDesc), "");
Expand All @@ -2458,7 +2458,7 @@ class SyclOptReportCreator : public SyclKernelFieldHandler {
void addParam(QualType KernelArgType, KernelArgDescription KernelArgDesc) {
unsigned KernelArgSize =
SemaRef.getASTContext().getTypeSizeInChars(KernelArgType).getQuantity();
SemaRef.getDiagnostics().getSYCLOptReportHandler().AddKernelArgs(
SemaRef.getDiagnostics().getSYCLOptReport().AddKernelArgs(
DC.getKernelDecl(), "", KernelArgType.getAsString(),
KernelInvocationLoc, KernelArgSize, getKernelArgDesc(KernelArgDesc),
"");
Expand Down Expand Up @@ -2490,7 +2490,7 @@ class SyclOptReportCreator : public SyclKernelFieldHandler {
unsigned KernelArgSize = SemaRef.getASTContext()
.getTypeSizeInChars(KernelArgType)
.getQuantity();
SemaRef.getDiagnostics().getSYCLOptReportHandler().AddKernelArgs(
SemaRef.getDiagnostics().getSYCLOptReport().AddKernelArgs(
DC.getKernelDecl(), FieldTy.getAsString(),
KernelArgType.getAsString(), KernelInvocationLoc, KernelArgSize,
getKernelArgDesc(
Expand Down