From c663b27364393ceeaf2dae979e689e9de0593e86 Mon Sep 17 00:00:00 2001 From: Snehasish Kumar Date: Thu, 22 Apr 2021 17:38:13 -0700 Subject: [PATCH] [NFC] Use hasSection instead of getSection().empty() Use the optimized check hasSection() instead of calling getSection().empty(). Originally suggested in D101004, but was dropped in the commit. --- lib/CodeGen/MachineFunctionSplitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/MachineFunctionSplitter.cpp b/lib/CodeGen/MachineFunctionSplitter.cpp index 2bb69e0ed70..0e0eb8b8e00 100644 --- a/lib/CodeGen/MachineFunctionSplitter.cpp +++ b/lib/CodeGen/MachineFunctionSplitter.cpp @@ -101,7 +101,7 @@ bool MachineFunctionSplitter::runOnMachineFunction(MachineFunction &MF) { // since the split part may not be placed in a contiguous region. It may also // be more beneficial to augment the linker to ensure contiguous layout of // split functions within the same section as specified by the attribute. - if (!MF.getFunction().getSection().empty() || + if (MF.getFunction().hasSection() || MF.getFunction().hasFnAttribute("implicit-section-name")) return false;