Skip to content

Commit f4496f8

Browse files
authored
merge main into amd-staging (llvm#2169)
2 parents 3dfd087 + 06ff789 commit f4496f8

File tree

189 files changed

+5725
-3523
lines changed

Some content is hidden

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

189 files changed

+5725
-3523
lines changed

bolt/test/X86/callcont-fallthru.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# RUN: %clangxx %cxxflags %s %t.so -o %t -Wl,-q -nostdlib
77
# RUN: link_fdata %s %t %t.pat PREAGGT1
88
# RUN: link_fdata %s %t %t.pat2 PREAGGT2
9-
# RUN: link_fdata %s %t %t.patplt PREAGGPLT
9+
# DONTRUN: link_fdata %s %t %t.patplt PREAGGPLT
1010

1111
# RUN: llvm-strip --strip-unneeded %t -o %t.strip
1212
# RUN: llvm-objcopy --remove-section=.eh_frame %t.strip %t.noeh
@@ -26,8 +26,8 @@
2626

2727
## Check pre-aggregated traces don't report zero-sized PLT fall-through as
2828
## invalid trace
29-
# RUN: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
30-
# RUN: --check-prefix=CHECK-PLT
29+
# DONTRUN: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
30+
# DONTRUN: --check-prefix=CHECK-PLT
3131
# CHECK-PLT: traces mismatching disassembled function contents: 0
3232

3333
.globl foo

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ Improvements to Clang's diagnostics
536536
- Several compatibility diagnostics that were incorrectly being grouped under
537537
``-Wpre-c++20-compat`` are now part of ``-Wc++20-compat``. (#GH138775)
538538

539-
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
539+
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
540540
The warning message for non-overlapping cases has also been improved (#GH13473).
541541

542542
- Fixed a duplicate diagnostic when performing typo correction on function template
543543
calls with explicit template arguments. (#GH139226)
544-
544+
545545
- Explanatory note is printed when ``assert`` fails during evaluation of a
546546
constant expression. Prior to this, the error inaccurately implied that assert
547547
could not be used at all in a constant expression (#GH130458)
@@ -725,6 +725,7 @@ Bug Fixes to C++ Support
725725
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
726726
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
727727
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
728+
- Clang no longer segfaults when there is a configuration mismatch between modules and their users (http://crbug.com/400353616).
728729

729730
Bug Fixes to AST Handling
730731
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,6 +4819,12 @@ def HLSLResourceHandleFromBinding : LangBuiltin<"HLSL_LANG"> {
48194819
let Prototype = "void(...)";
48204820
}
48214821

4822+
def HLSLResourceHandleFromImplicitBinding : LangBuiltin<"HLSL_LANG"> {
4823+
let Spellings = ["__builtin_hlsl_resource_handlefromimplicitbinding"];
4824+
let Attributes = [NoThrow];
4825+
let Prototype = "void(...)";
4826+
}
4827+
48224828
def HLSLAll : LangBuiltin<"HLSL_LANG"> {
48234829
let Spellings = ["__builtin_hlsl_all"];
48244830
let Attributes = [NoThrow, Const];

clang/include/clang/Basic/Module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ class VisibleModuleSet {
888888

889889
/// Get the location at which the import of a module was triggered.
890890
SourceLocation getImportLoc(const Module *M) const {
891-
return M->getVisibilityID() < ImportLocs.size()
891+
return M && M->getVisibilityID() < ImportLocs.size()
892892
? ImportLocs[M->getVisibilityID()]
893893
: SourceLocation();
894894
}

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,20 @@ class SemaHLSL : public SemaBase {
175175
// buffer which will be created at the end of the translation unit.
176176
llvm::SmallVector<Decl *> DefaultCBufferDecls;
177177

178+
uint32_t ImplicitBindingNextOrderID = 0;
179+
178180
private:
179181
void collectResourceBindingsOnVarDecl(VarDecl *D);
180182
void collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
181183
const RecordType *RT);
182184
void processExplicitBindingsOnDecl(VarDecl *D);
183185

184186
void diagnoseAvailabilityViolations(TranslationUnitDecl *TU);
187+
188+
bool initGlobalResourceDecl(VarDecl *VD);
189+
uint32_t getNextImplicitBindingOrderID() {
190+
return ImplicitBindingNextOrderID++;
191+
}
185192
};
186193

187194
} // namespace clang

clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ class SMTConstraintManager : public clang::ento::SimpleConstraintManager {
301301
llvm_unreachable("Unsupported expression to reason about!");
302302
}
303303

304+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
304305
/// Dumps SMT formula
305306
LLVM_DUMP_METHOD void dump() const { Solver->dump(); }
307+
#endif
306308

307309
protected:
308310
// Check whether a new model is satisfiable, and update the program state.

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,8 +6113,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
61136113
case Builtin::BI__builtin_thread_pointer: {
61146114
if (!getContext().getTargetInfo().isTLSSupported())
61156115
CGM.ErrorUnsupported(E, "__builtin_thread_pointer");
6116-
// Fall through - it's already mapped to the intrinsic by ClangBuiltin.
6117-
break;
6116+
6117+
return RValue::get(Builder.CreateIntrinsic(llvm::Intrinsic::thread_pointer,
6118+
{GlobalsInt8PtrTy}, {}));
61186119
}
61196120
case Builtin::BI__builtin_os_log_format:
61206121
return emitBuiltinOSLogFormat(*E);

clang/lib/CodeGen/CGHLSLBuiltins.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,21 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
303303
HandleTy, CGM.getHLSLRuntime().getCreateHandleFromBindingIntrinsic(),
304304
ArrayRef<Value *>{SpaceOp, RegisterOp, RangeOp, IndexOp, NonUniform});
305305
}
306+
case Builtin::BI__builtin_hlsl_resource_handlefromimplicitbinding: {
307+
llvm::Type *HandleTy = CGM.getTypes().ConvertType(E->getType());
308+
Value *SpaceOp = EmitScalarExpr(E->getArg(1));
309+
Value *RangeOp = EmitScalarExpr(E->getArg(2));
310+
Value *IndexOp = EmitScalarExpr(E->getArg(3));
311+
Value *OrderID = EmitScalarExpr(E->getArg(4));
312+
// FIXME: NonUniformResourceIndex bit is not yet implemented
313+
// (llvm/llvm-project#135452)
314+
Value *NonUniform =
315+
llvm::ConstantInt::get(llvm::Type::getInt1Ty(getLLVMContext()), false);
316+
return Builder.CreateIntrinsic(
317+
HandleTy,
318+
CGM.getHLSLRuntime().getCreateHandleFromImplicitBindingIntrinsic(),
319+
ArrayRef<Value *>{OrderID, SpaceOp, RangeOp, IndexOp, NonUniform});
320+
}
306321
case Builtin::BI__builtin_hlsl_all: {
307322
Value *Op0 = EmitScalarExpr(E->getArg(0));
308323
return Builder.CreateIntrinsic(

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class CGHLSLRuntime {
119119
resource_getpointer)
120120
GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromBinding,
121121
resource_handlefrombinding)
122+
GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromImplicitBinding,
123+
resource_handlefromimplicitbinding)
122124
GENERATE_HLSL_INTRINSIC_FUNCTION(BufferUpdateCounter, resource_updatecounter)
123125
GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync,
124126
group_memory_barrier_with_group_sync)

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
16931693

16941694
const llvm::Triple &TT = CGM.getTriple();
16951695
const auto &CGOpts = CGM.getCodeGenOpts();
1696-
if (TT.isWindowsGNUEnvironment()) {
1696+
if (TT.isOSCygMing()) {
16971697
// In MinGW, variables without DLLImport can still be automatically
16981698
// imported from a DLL by the linker; don't mark variables that
16991699
// potentially could come from another DLL as DSO local.

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3754,7 +3754,7 @@ static bool ShouldUseExternalRTTIDescriptor(CodeGenModule &CGM,
37543754
bool IsDLLImport = RD->hasAttr<DLLImportAttr>();
37553755

37563756
// Don't import the RTTI but emit it locally.
3757-
if (CGM.getTriple().isWindowsGNUEnvironment())
3757+
if (CGM.getTriple().isOSCygMing())
37583758
return false;
37593759

37603760
if (CGM.getVTables().isVTableExternal(RD)) {
@@ -4041,10 +4041,7 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(CodeGenModule &CGM,
40414041
return llvm::GlobalValue::ExternalLinkage;
40424042
// MinGW always uses LinkOnceODRLinkage for type info.
40434043
if (RD->isDynamicClass() &&
4044-
!CGM.getContext()
4045-
.getTargetInfo()
4046-
.getTriple()
4047-
.isWindowsGNUEnvironment())
4044+
!CGM.getContext().getTargetInfo().getTriple().isOSCygMing())
40484045
return CGM.getVTableLinkage(RD);
40494046
}
40504047

clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,26 @@ BuiltinTypeDeclBuilder::addHandleConstructorFromBinding() {
668668
.finalize();
669669
}
670670

671+
BuiltinTypeDeclBuilder &
672+
BuiltinTypeDeclBuilder::addHandleConstructorFromImplicitBinding() {
673+
if (Record->isCompleteDefinition())
674+
return *this;
675+
676+
using PH = BuiltinTypeMethodBuilder::PlaceHolder;
677+
ASTContext &AST = SemaRef.getASTContext();
678+
QualType HandleType = getResourceHandleField()->getType();
679+
680+
return BuiltinTypeMethodBuilder(*this, "", AST.VoidTy, false, true)
681+
.addParam("spaceNo", AST.UnsignedIntTy)
682+
.addParam("range", AST.IntTy)
683+
.addParam("index", AST.UnsignedIntTy)
684+
.addParam("orderId", AST.UnsignedIntTy)
685+
.callBuiltin("__builtin_hlsl_resource_handlefromimplicitbinding",
686+
HandleType, PH::Handle, PH::_0, PH::_1, PH::_2, PH::_3)
687+
.assign(PH::Handle, PH::LastStmt)
688+
.finalize();
689+
}
690+
671691
BuiltinTypeDeclBuilder &BuiltinTypeDeclBuilder::addArraySubscriptOperators() {
672692
ASTContext &AST = Record->getASTContext();
673693
DeclarationName Subscript =

clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ class BuiltinTypeDeclBuilder {
7676
AccessSpecifier Access = AccessSpecifier::AS_private);
7777
BuiltinTypeDeclBuilder &addArraySubscriptOperators();
7878

79-
// Builtin types methods
79+
// Builtin types constructors
8080
BuiltinTypeDeclBuilder &addDefaultHandleConstructor();
8181
BuiltinTypeDeclBuilder &addHandleConstructorFromBinding();
82+
BuiltinTypeDeclBuilder &addHandleConstructorFromImplicitBinding();
8283

8384
// Builtin types methods
8485
BuiltinTypeDeclBuilder &addLoadMethods();

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S,
132132
return BuiltinTypeDeclBuilder(S, Decl)
133133
.addHandleMember(RC, IsROV, RawBuffer)
134134
.addDefaultHandleConstructor()
135-
.addHandleConstructorFromBinding();
135+
.addHandleConstructorFromBinding()
136+
.addHandleConstructorFromImplicitBinding();
136137
}
137138

138139
// This function is responsible for constructing the constraint expression for

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6274,7 +6274,7 @@ static void ReferenceDllExportedMembers(Sema &S, CXXRecordDecl *Class) {
62746274
}
62756275
} MarkingDllexportedContext(S, Class, ClassAttr->getLocation());
62766276

6277-
if (S.Context.getTargetInfo().getTriple().isWindowsGNUEnvironment())
6277+
if (S.Context.getTargetInfo().getTriple().isOSCygMing())
62786278
S.MarkVTableUsed(Class->getLocation(), Class, true);
62796279

62806280
for (Decl *Member : Class->decls()) {
@@ -6576,7 +6576,7 @@ void Sema::checkClassLevelDLLAttribute(CXXRecordDecl *Class) {
65766576
// declarations, except in MinGW mode.
65776577
if (ClassExported && !ClassAttr->isInherited() &&
65786578
TSK == TSK_ExplicitInstantiationDeclaration &&
6579-
!Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
6579+
!Context.getTargetInfo().getTriple().isOSCygMing()) {
65806580
Class->dropAttr<DLLExportAttr>();
65816581
return;
65826582
}

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,20 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
24542454
TheCall->setType(ResourceTy);
24552455
break;
24562456
}
2457+
case Builtin::BI__builtin_hlsl_resource_handlefromimplicitbinding: {
2458+
ASTContext &AST = SemaRef.getASTContext();
2459+
if (SemaRef.checkArgCount(TheCall, 5) ||
2460+
CheckResourceHandle(&SemaRef, TheCall, 0) ||
2461+
CheckArgTypeMatches(&SemaRef, TheCall->getArg(1), AST.UnsignedIntTy) ||
2462+
CheckArgTypeMatches(&SemaRef, TheCall->getArg(2), AST.IntTy) ||
2463+
CheckArgTypeMatches(&SemaRef, TheCall->getArg(3), AST.UnsignedIntTy) ||
2464+
CheckArgTypeMatches(&SemaRef, TheCall->getArg(4), AST.UnsignedIntTy))
2465+
return true;
2466+
// use the type of the handle (arg0) as a return type
2467+
QualType ResourceTy = TheCall->getArg(0)->getType();
2468+
TheCall->setType(ResourceTy);
2469+
break;
2470+
}
24572471
case Builtin::BI__builtin_hlsl_and:
24582472
case Builtin::BI__builtin_hlsl_or: {
24592473
if (SemaRef.checkArgCount(TheCall, 2))
@@ -3285,8 +3299,10 @@ static bool initVarDeclWithCtor(Sema &S, VarDecl *VD,
32853299
VD->getLocation(), SourceLocation(), SourceLocation());
32863300

32873301
InitializationSequence InitSeq(S, Entity, Kind, Args);
3288-
ExprResult Init = InitSeq.Perform(S, Entity, Kind, Args);
3302+
if (InitSeq.Failed())
3303+
return false;
32893304

3305+
ExprResult Init = InitSeq.Perform(S, Entity, Kind, Args);
32903306
if (!Init.get())
32913307
return false;
32923308

@@ -3296,27 +3312,42 @@ static bool initVarDeclWithCtor(Sema &S, VarDecl *VD,
32963312
return true;
32973313
}
32983314

3299-
static bool initGlobalResourceDecl(Sema &S, VarDecl *VD) {
3315+
bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) {
3316+
std::optional<uint32_t> RegisterSlot;
3317+
uint32_t SpaceNo = 0;
33003318
HLSLResourceBindingAttr *RBA = VD->getAttr<HLSLResourceBindingAttr>();
3301-
if (!RBA || !RBA->hasRegisterSlot())
3302-
// FIXME: add support for implicit binding (llvm/llvm-project#110722)
3303-
return false;
3319+
if (RBA) {
3320+
if (RBA->hasRegisterSlot())
3321+
RegisterSlot = RBA->getSlotNumber();
3322+
SpaceNo = RBA->getSpaceNumber();
3323+
}
33043324

3305-
ASTContext &AST = S.getASTContext();
3325+
ASTContext &AST = SemaRef.getASTContext();
33063326
uint64_t UIntTySize = AST.getTypeSize(AST.UnsignedIntTy);
33073327
uint64_t IntTySize = AST.getTypeSize(AST.IntTy);
3308-
Expr *Args[] = {
3309-
IntegerLiteral::Create(AST, llvm::APInt(UIntTySize, RBA->getSlotNumber()),
3310-
AST.UnsignedIntTy, SourceLocation()),
3311-
IntegerLiteral::Create(AST,
3312-
llvm::APInt(UIntTySize, RBA->getSpaceNumber()),
3313-
AST.UnsignedIntTy, SourceLocation()),
3314-
IntegerLiteral::Create(AST, llvm::APInt(IntTySize, 1), AST.IntTy,
3315-
SourceLocation()),
3316-
IntegerLiteral::Create(AST, llvm::APInt(UIntTySize, 0), AST.UnsignedIntTy,
3317-
SourceLocation())};
3318-
3319-
return initVarDeclWithCtor(S, VD, Args);
3328+
IntegerLiteral *RangeSize = IntegerLiteral::Create(
3329+
AST, llvm::APInt(IntTySize, 1), AST.IntTy, SourceLocation());
3330+
IntegerLiteral *Index = IntegerLiteral::Create(
3331+
AST, llvm::APInt(UIntTySize, 0), AST.UnsignedIntTy, SourceLocation());
3332+
IntegerLiteral *Space =
3333+
IntegerLiteral::Create(AST, llvm::APInt(UIntTySize, SpaceNo),
3334+
AST.UnsignedIntTy, SourceLocation());
3335+
3336+
// resource with explicit binding
3337+
if (RegisterSlot.has_value()) {
3338+
IntegerLiteral *RegSlot = IntegerLiteral::Create(
3339+
AST, llvm::APInt(UIntTySize, RegisterSlot.value()), AST.UnsignedIntTy,
3340+
SourceLocation());
3341+
Expr *Args[] = {RegSlot, Space, RangeSize, Index};
3342+
return initVarDeclWithCtor(SemaRef, VD, Args);
3343+
}
3344+
3345+
// resource with implicit binding
3346+
IntegerLiteral *OrderId = IntegerLiteral::Create(
3347+
AST, llvm::APInt(UIntTySize, getNextImplicitBindingOrderID()),
3348+
AST.UnsignedIntTy, SourceLocation());
3349+
Expr *Args[] = {Space, RangeSize, Index, OrderId};
3350+
return initVarDeclWithCtor(SemaRef, VD, Args);
33203351
}
33213352

33223353
// Returns true if the initialization has been handled.
@@ -3334,8 +3365,9 @@ bool SemaHLSL::ActOnUninitializedVarDecl(VarDecl *VD) {
33343365
// FIXME: We currectly support only simple resources - no arrays of resources
33353366
// or resources in user defined structs.
33363367
// (llvm/llvm-project#133835, llvm/llvm-project#133837)
3337-
if (VD->getType()->isHLSLResourceRecord())
3338-
return initGlobalResourceDecl(SemaRef, VD);
3368+
// Initialize resources at the global scope
3369+
if (VD->hasGlobalStorage() && VD->getType()->isHLSLResourceRecord())
3370+
return initGlobalResourceDecl(VD);
33393371

33403372
return false;
33413373
}

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9021,8 +9021,7 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc,
90219021
// The declaration itself has not actually been instantiated, so it is
90229022
// still okay to specialize it.
90239023
StripImplicitInstantiation(
9024-
PrevDecl,
9025-
Context.getTargetInfo().getTriple().isWindowsGNUEnvironment());
9024+
PrevDecl, Context.getTargetInfo().getTriple().isOSCygMing());
90269025
return false;
90279026
}
90289027
// Fall through
@@ -9892,7 +9891,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
98929891
: TSK_ExplicitInstantiationDeclaration;
98939892

98949893
if (TSK == TSK_ExplicitInstantiationDeclaration &&
9895-
!Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
9894+
!Context.getTargetInfo().getTriple().isOSCygMing()) {
98969895
// Check for dllexport class template instantiation declarations,
98979896
// except for MinGW mode.
98989897
for (const ParsedAttr &AL : Attr) {
@@ -9957,7 +9956,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
99579956
= PrevDecl ? PrevDecl->getTemplateSpecializationKind() : TSK_Undeclared;
99589957

99599958
if (TSK == TSK_ExplicitInstantiationDefinition && PrevDecl != nullptr &&
9960-
Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
9959+
Context.getTargetInfo().getTriple().isOSCygMing()) {
99619960
// Check for dllexport class template instantiation definitions in MinGW
99629961
// mode, if a previous declaration of the instantiation was seen.
99639962
for (const ParsedAttr &AL : Attr) {
@@ -10125,7 +10124,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
1012510124
// In MinGW mode, export the template instantiation if the declaration
1012610125
// was marked dllexport.
1012710126
if (PrevDecl_TSK == TSK_ExplicitInstantiationDeclaration &&
10128-
Context.getTargetInfo().getTriple().isWindowsGNUEnvironment() &&
10127+
Context.getTargetInfo().getTriple().isOSCygMing() &&
1012910128
PrevDecl->hasAttr<DLLExportAttr>()) {
1013010129
dllExportImportClassTemplateSpecialization(*this, Def);
1013110130
}

0 commit comments

Comments
 (0)