Skip to content

Commit f148720

Browse files
committed
Merge from 'master' to 'sycl-web' (#24)
CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticSemaKinds.td
2 parents 50a1d2e + 0d4e243 commit f148720

File tree

111 files changed

+2993
-3470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+2993
-3470
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def err_drv_no_cuda_libdevice : Error<
5858

5959
def err_drv_no_rocm_installation : Error<
6060
"cannot find ROCm installation. Provide its path via --rocm-path, or pass "
61-
"-nogpulib and -nogpuinc to build without ROCm device library and HIP includes.">;
61+
"-nogpulib.">;
6262
def err_drv_no_rocm_device_lib : Error<
6363
"cannot find device library for %0. Provide path to different ROCm installation "
6464
"via --rocm-path, or pass -nogpulib to build without linking default libraries.">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10811,6 +10811,14 @@ def err_matrix_separate_incomplete_index: Error<
1081110811
def err_matrix_subscript_comma: Error<
1081210812
"comma expressions are not allowed as indices in matrix subscript expressions">;
1081310813

10814+
def warn_mismatched_import : Warning<
10815+
"import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
10816+
"previous declaration">,
10817+
InGroup<IgnoredAttributes>;
10818+
def warn_import_on_definition : Warning<
10819+
"import %select{module|name}0 cannot be applied to a function with a definition">,
10820+
InGroup<IgnoredAttributes>;
10821+
1081410822
// SYCL-specific diagnostics
1081510823
def err_sycl_kernel_incorrectly_named : Error<
1081610824
"kernel %select{name is missing"

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,8 +2697,7 @@ def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
26972697
def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
26982698
def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>,
26992699
HelpText<"Disable builtin #include directories">;
2700-
def nogpuinc : Flag<["-"], "nogpuinc">;
2701-
def : Flag<["-"], "nocudainc">, Alias<nogpuinc>;
2700+
def nocudainc : Flag<["-"], "nocudainc">;
27022701
def nogpulib : Flag<["-"], "nogpulib">,
27032702
HelpText<"Do not link device library for CUDA/HIP device compilation">;
27042703
def : Flag<["-"], "nocudalib">, Alias<nogpulib>;

clang/include/clang/Driver/ToolChain.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,6 @@ class ToolChain {
632632
virtual void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
633633
llvm::opt::ArgStringList &CC1Args) const;
634634

635-
/// Add arguments to use system-specific HIP includes.
636-
virtual void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs,
637-
llvm::opt::ArgStringList &CC1Args) const;
638-
639635
/// Add arguments to use MCU GCC toolchain includes.
640636
virtual void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
641637
llvm::opt::ArgStringList &CC1Args) const;

clang/include/clang/Sema/Sema.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,6 +3153,10 @@ class Sema final {
31533153
const InternalLinkageAttr &AL);
31543154
CommonAttr *mergeCommonAttr(Decl *D, const ParsedAttr &AL);
31553155
CommonAttr *mergeCommonAttr(Decl *D, const CommonAttr &AL);
3156+
WebAssemblyImportNameAttr *mergeImportNameAttr(
3157+
Decl *D, const WebAssemblyImportNameAttr &AL);
3158+
WebAssemblyImportModuleAttr *mergeImportModuleAttr(
3159+
Decl *D, const WebAssemblyImportModuleAttr &AL);
31563160

31573161
void mergeDeclAttributes(NamedDecl *New, Decl *Old,
31583162
AvailabilityMergeKind AMK = AMK_Redeclaration);

clang/lib/CodeGen/CGCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4985,7 +4985,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
49854985
// Add metadata for calls to MSAllocator functions
49864986
if (getDebugInfo() && TargetDecl &&
49874987
TargetDecl->hasAttr<MSAllocatorAttr>())
4988-
getDebugInfo()->addHeapAllocSiteMetadata(CI, RetTy, Loc);
4988+
getDebugInfo()->addHeapAllocSiteMetadata(CI, RetTy->getPointeeType(), Loc);
49894989

49904990
// 4. Finish the call.
49914991

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,16 +2146,14 @@ llvm::DIType *CGDebugInfo::getOrCreateStandaloneType(QualType D,
21462146
return T;
21472147
}
21482148

2149-
void CGDebugInfo::addHeapAllocSiteMetadata(llvm::Instruction *CI,
2150-
QualType D,
2149+
void CGDebugInfo::addHeapAllocSiteMetadata(llvm::CallBase *CI,
2150+
QualType AllocatedTy,
21512151
SourceLocation Loc) {
21522152
llvm::MDNode *node;
2153-
if (D.getTypePtr()->isVoidPointerType()) {
2153+
if (AllocatedTy->isVoidType())
21542154
node = llvm::MDNode::get(CGM.getLLVMContext(), None);
2155-
} else {
2156-
QualType PointeeTy = D.getTypePtr()->getPointeeType();
2157-
node = getOrCreateType(PointeeTy, getOrCreateFile(Loc));
2158-
}
2155+
else
2156+
node = getOrCreateType(AllocatedTy, getOrCreateFile(Loc));
21592157

21602158
CI->setMetadata("heapallocsite", node);
21612159
}

clang/lib/CodeGen/CGDebugInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ class CGDebugInfo {
509509
llvm::DIType *getOrCreateStandaloneType(QualType Ty, SourceLocation Loc);
510510

511511
/// Add heapallocsite metadata for MSAllocator calls.
512-
void addHeapAllocSiteMetadata(llvm::Instruction *CallSite, QualType Ty,
512+
void addHeapAllocSiteMetadata(llvm::CallBase *CallSite, QualType AllocatedTy,
513513
SourceLocation Loc);
514514

515515
void completeType(const EnumDecl *ED);

clang/lib/CodeGen/CGExprCXX.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,13 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
16381638
RValue RV =
16391639
EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
16401640

1641+
// Set !heapallocsite metadata on the call to operator new.
1642+
if (getDebugInfo()) {
1643+
if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal()))
1644+
getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
1645+
E->getExprLoc());
1646+
}
1647+
16411648
// If this was a call to a global replaceable allocation function that does
16421649
// not take an alignment argument, the allocator is known to produce
16431650
// storage that's suitably aligned for any object that fits, up to a known

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,11 +2081,15 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
20812081
}
20822082
}
20832083

2084-
// Update heapallocsite metadata when there is an explicit cast.
2085-
if (llvm::CallInst *CI = dyn_cast<llvm::CallInst>(Src))
2086-
if (CI->getMetadata("heapallocsite") && isa<ExplicitCastExpr>(CE))
2087-
CGF.getDebugInfo()->
2088-
addHeapAllocSiteMetadata(CI, CE->getType(), CE->getExprLoc());
2084+
// Update heapallocsite metadata when there is an explicit pointer cast.
2085+
if (auto *CI = dyn_cast<llvm::CallBase>(Src)) {
2086+
if (CI->getMetadata("heapallocsite") && isa<ExplicitCastExpr>(CE)) {
2087+
QualType PointeeType = DestTy->getPointeeType();
2088+
if (!PointeeType.isNull())
2089+
CGF.getDebugInfo()->addHeapAllocSiteMetadata(CI, PointeeType,
2090+
CE->getExprLoc());
2091+
}
2092+
}
20892093

20902094
if (NeedAddrspaceCast) {
20912095
llvm::Type *SrcPointeeTy = Src->getType()->getPointerElementType();

0 commit comments

Comments
 (0)