Vendor import of clang release_80 branch r364487:
https://llvm.org/svn/llvm-project/cfe/branches/release_80@364487
This commit is contained in:
parent
70198750b9
commit
6dcbd4ab23
@ -1937,8 +1937,9 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
|
|||||||
// ::= _M # unsigned __int128
|
// ::= _M # unsigned __int128
|
||||||
// ::= _N # bool
|
// ::= _N # bool
|
||||||
// _O # <array in parameter>
|
// _O # <array in parameter>
|
||||||
// ::= _T # __float80 (Intel)
|
// ::= _Q # char8_t
|
||||||
// ::= _S # char16_t
|
// ::= _S # char16_t
|
||||||
|
// ::= _T # __float80 (Intel)
|
||||||
// ::= _U # char32_t
|
// ::= _U # char32_t
|
||||||
// ::= _W # wchar_t
|
// ::= _W # wchar_t
|
||||||
// ::= _Z # __float80 (Digital Mars)
|
// ::= _Z # __float80 (Digital Mars)
|
||||||
@ -1999,6 +2000,9 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
|
|||||||
case BuiltinType::Bool:
|
case BuiltinType::Bool:
|
||||||
Out << "_N";
|
Out << "_N";
|
||||||
break;
|
break;
|
||||||
|
case BuiltinType::Char8:
|
||||||
|
Out << "_Q";
|
||||||
|
break;
|
||||||
case BuiltinType::Char16:
|
case BuiltinType::Char16:
|
||||||
Out << "_S";
|
Out << "_S";
|
||||||
break;
|
break;
|
||||||
@ -2094,7 +2098,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
|
|||||||
case BuiltinType::SatUShortFract:
|
case BuiltinType::SatUShortFract:
|
||||||
case BuiltinType::SatUFract:
|
case BuiltinType::SatUFract:
|
||||||
case BuiltinType::SatULongFract:
|
case BuiltinType::SatULongFract:
|
||||||
case BuiltinType::Char8:
|
|
||||||
case BuiltinType::Float128: {
|
case BuiltinType::Float128: {
|
||||||
DiagnosticsEngine &Diags = Context.getDiags();
|
DiagnosticsEngine &Diags = Context.getDiags();
|
||||||
unsigned DiagID = Diags.getCustomDiagID(
|
unsigned DiagID = Diags.getCustomDiagID(
|
||||||
|
@ -1817,32 +1817,24 @@ CGDebugInfo::CollectFunctionTemplateParams(const FunctionDecl *FD,
|
|||||||
}
|
}
|
||||||
|
|
||||||
llvm::DINodeArray CGDebugInfo::CollectVarTemplateParams(const VarDecl *VL,
|
llvm::DINodeArray CGDebugInfo::CollectVarTemplateParams(const VarDecl *VL,
|
||||||
llvm::DIFile *Unit) {
|
llvm::DIFile *Unit) {
|
||||||
if (auto *TS = dyn_cast<VarTemplateSpecializationDecl>(VL)) {
|
// Always get the full list of parameters, not just the ones from the
|
||||||
auto T = TS->getSpecializedTemplateOrPartial();
|
// specialization. A partial specialization may have fewer parameters than
|
||||||
auto TA = TS->getTemplateArgs().asArray();
|
// there are arguments.
|
||||||
// Collect parameters for a partial specialization
|
auto *TS = dyn_cast<VarTemplateSpecializationDecl>(VL);
|
||||||
if (T.is<VarTemplatePartialSpecializationDecl *>()) {
|
if (!TS)
|
||||||
const TemplateParameterList *TList =
|
return llvm::DINodeArray();
|
||||||
T.get<VarTemplatePartialSpecializationDecl *>()
|
VarTemplateDecl *T = TS->getSpecializedTemplate();
|
||||||
->getTemplateParameters();
|
const TemplateParameterList *TList = T->getTemplateParameters();
|
||||||
return CollectTemplateParams(TList, TA, Unit);
|
auto TA = TS->getTemplateArgs().asArray();
|
||||||
}
|
return CollectTemplateParams(TList, TA, Unit);
|
||||||
|
|
||||||
// Collect parameters for an explicit specialization
|
|
||||||
if (T.is<VarTemplateDecl *>()) {
|
|
||||||
const TemplateParameterList *TList = T.get<VarTemplateDecl *>()
|
|
||||||
->getTemplateParameters();
|
|
||||||
return CollectTemplateParams(TList, TA, Unit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return llvm::DINodeArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::DINodeArray CGDebugInfo::CollectCXXTemplateParams(
|
llvm::DINodeArray CGDebugInfo::CollectCXXTemplateParams(
|
||||||
const ClassTemplateSpecializationDecl *TSpecial, llvm::DIFile *Unit) {
|
const ClassTemplateSpecializationDecl *TSpecial, llvm::DIFile *Unit) {
|
||||||
// Always get the full list of parameters, not just the ones from
|
// Always get the full list of parameters, not just the ones from the
|
||||||
// the specialization.
|
// specialization. A partial specialization may have fewer parameters than
|
||||||
|
// there are arguments.
|
||||||
TemplateParameterList *TPList =
|
TemplateParameterList *TPList =
|
||||||
TSpecial->getSpecializedTemplate()->getTemplateParameters();
|
TSpecial->getSpecializedTemplate()->getTemplateParameters();
|
||||||
const TemplateArgumentList &TAList = TSpecial->getTemplateArgs();
|
const TemplateArgumentList &TAList = TSpecial->getTemplateArgs();
|
||||||
|
@ -116,7 +116,7 @@ ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Driver &D, const llvm::Tripl
|
|||||||
const ArgList &Args) {
|
const ArgList &Args) {
|
||||||
if (Args.getLastArg(options::OPT_msecure_plt))
|
if (Args.getLastArg(options::OPT_msecure_plt))
|
||||||
return ppc::ReadGOTPtrMode::SecurePlt;
|
return ppc::ReadGOTPtrMode::SecurePlt;
|
||||||
if (Triple.isOSOpenBSD())
|
if (Triple.isOSNetBSD() || Triple.isOSOpenBSD())
|
||||||
return ppc::ReadGOTPtrMode::SecurePlt;
|
return ppc::ReadGOTPtrMode::SecurePlt;
|
||||||
else
|
else
|
||||||
return ppc::ReadGOTPtrMode::Bss;
|
return ppc::ReadGOTPtrMode::Bss;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-linux %s -o - | FileCheck %s
|
// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-linux %s -o - | FileCheck %s --check-prefix=ITANIUM
|
||||||
// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-windows %s -o - -verify
|
// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-windows %s -o - | FileCheck %s --check-prefix=MSABI
|
||||||
|
|
||||||
// CHECK: define void @_Z1fDu(
|
// ITANIUM: define void @_Z1fDu(
|
||||||
void f(char8_t c) {} // expected-error {{cannot mangle this built-in char8_t type yet}}
|
// MSABI: define {{.*}}void @"?f@@YAX_Q@Z"(
|
||||||
|
void f(char8_t c) {}
|
||||||
|
|
||||||
// CHECK: define weak_odr void @_Z1gIiEvDTplplcvT__ELA4_KDuELDu114EE
|
// ITANIUM: define weak_odr void @_Z1gIiEvDTplplcvT__ELA4_KDuELDu114EE(
|
||||||
|
// MSABI: define weak_odr {{.*}}void @"??$g@H@@YAXPEB_Q@Z"(
|
||||||
template<typename T> void g(decltype(T() + u8"foo" + u8'r')) {}
|
template<typename T> void g(decltype(T() + u8"foo" + u8'r')) {}
|
||||||
template void g<int>(const char8_t*);
|
template void g<int>(const char8_t*);
|
||||||
|
@ -30,7 +30,7 @@ inline int add3(int x) {
|
|||||||
// CHECK: {{![0-9]+}} = distinct !DIGlobalVariable(
|
// CHECK: {{![0-9]+}} = distinct !DIGlobalVariable(
|
||||||
// CHECK-SAME: name: "var"
|
// CHECK-SAME: name: "var"
|
||||||
// CHECK-SAME: templateParams: {{![0-9]+}}
|
// CHECK-SAME: templateParams: {{![0-9]+}}
|
||||||
// CHECK: !DITemplateTypeParameter(name: "P", type: {{![0-9]+}})
|
// CHECK: !DITemplateTypeParameter(name: "T", type: {{![0-9]+}})
|
||||||
// CHECK: {{![0-9]+}} = distinct !DIGlobalVariable(
|
// CHECK: {{![0-9]+}} = distinct !DIGlobalVariable(
|
||||||
// CHECK-SAME: name: "varray"
|
// CHECK-SAME: name: "varray"
|
||||||
// CHECK-SAME: templateParams: {{![0-9]+}}
|
// CHECK-SAME: templateParams: {{![0-9]+}}
|
||||||
|
17
test/CodeGenCXX/debug-info-var-template-partial.cpp
Normal file
17
test/CodeGenCXX/debug-info-var-template-partial.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu %s -o - -debug-info-kind=limited | FileCheck %s
|
||||||
|
|
||||||
|
template <typename LHS, typename RHS> constexpr bool is_same_v = false;
|
||||||
|
template <typename T> constexpr bool is_same_v<T, T> = true;
|
||||||
|
|
||||||
|
template constexpr bool is_same_v<int, int>;
|
||||||
|
static_assert(is_same_v<int, int>, "should get partial spec");
|
||||||
|
|
||||||
|
// Note that the template arguments for the instantiated variable use the
|
||||||
|
// parameter names from the primary template. The partial specialization might
|
||||||
|
// not have enough parameters.
|
||||||
|
|
||||||
|
// CHECK: distinct !DIGlobalVariable(name: "is_same_v", linkageName: "_ZL9is_same_vIiiE", {{.*}} templateParams: ![[PARAMS:[0-9]+]])
|
||||||
|
// CHECK: ![[PARAMS]] = !{![[LHS:[0-9]+]], ![[RHS:[0-9]+]]}
|
||||||
|
// CHECK: ![[LHS]] = !DITemplateTypeParameter(name: "LHS", type: ![[INT:[0-9]+]])
|
||||||
|
// CHECK: ![[INT]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||||
|
// CHECK: ![[RHS]] = !DITemplateTypeParameter(name: "RHS", type: ![[INT]])
|
@ -446,3 +446,8 @@
|
|||||||
// PTHREAD-NOT: _POSIX_THREADS
|
// PTHREAD-NOT: _POSIX_THREADS
|
||||||
// PTHREAD: _REENTRANT
|
// PTHREAD: _REENTRANT
|
||||||
// PTHREAD-NOT: _POSIX_THREADS
|
// PTHREAD-NOT: _POSIX_THREADS
|
||||||
|
|
||||||
|
// Check PowerPC for Secure PLT
|
||||||
|
// RUN: %clang -target powerpc-unknown-netbsd -### -c %s 2>&1 \
|
||||||
|
// RUN: | FileCheck -check-prefix=POWERPC-SECUREPLT %s
|
||||||
|
// POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user