Skip to content

Commit 4eb9066

Browse files
committed
check for MSVC environment
1 parent 29b1a4f commit 4eb9066

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/include/llvm/IR/Attributes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def : CompatRule<"isEqual<UseSampleProfileAttr>">;
442442
def : CompatRule<"isEqual<NoProfileAttr>">;
443443
def : CompatRule<"checkDenormMode">;
444444
def : CompatRule<"checkStrictFP">;
445-
def : CompatRule<"checkSections">;
445+
def : CompatRule<"checkSectionsMSVC">;
446446
def : CompatRuleStrAttr<"isEqual", "sign-return-address">;
447447
def : CompatRuleStrAttr<"isEqual", "sign-return-address-key">;
448448
def : CompatRuleStrAttr<"isEqual", "branch-protection-pauth-lr">;

llvm/lib/IR/Attributes.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2507,7 +2507,10 @@ static bool checkStrictFP(const Function &Caller, const Function &Callee) {
25072507
Caller.getAttributes().hasFnAttr(Attribute::StrictFP);
25082508
}
25092509

2510-
static bool checkSections(const Function &Caller, const Function &Callee) {
2510+
static bool checkSectionsMSVC(const Function &Caller, const Function &Callee) {
2511+
if (!Caller.getParent()->getTargetTriple().isWindowsMSVCEnvironment())
2512+
return true;
2513+
25112514
// Implement MSVC compatible cross-section inlining rules
25122515
StringRef CallerSection = Caller.getSection();
25132516
StringRef CalleeSection = Callee.getSection();

0 commit comments

Comments
 (0)