[llvm] f77c8a4 - [CodeGen] Fix regression from D83655

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 19:59:49 PST 2020


Author: Jessica Clarke
Date: 2020-11-03T03:57:46Z
New Revision: f77c8a48aea9fbce038fc38ef9849f7aa1453993

URL: https://github.com/llvm/llvm-project/commit/f77c8a48aea9fbce038fc38ef9849f7aa1453993
DIFF: https://github.com/llvm/llvm-project/commit/f77c8a48aea9fbce038fc38ef9849f7aa1453993.diff

LOG: [CodeGen] Fix regression from D83655

Arm EHABI has a null LSDASection as it does its own thing, so we should
continue to return null in that case rather than try and cast it.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 1772e7f4e55d..57af82a3f58e 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -837,7 +837,8 @@ MCSection *
 TargetLoweringObjectFileELF::getSectionForLSDA(const Function &F,
                                                const TargetMachine &TM) const {
   // If neither COMDAT nor function sections, use the monolithic LSDA section.
-  if (!F.hasComdat() && !TM.getFunctionSections())
+  // Re-use this path if LSDASection is null as in the Arm EHABI.
+  if (!LSDASection || (!F.hasComdat() && !TM.getFunctionSections()))
     return LSDASection;
 
   const auto *LSDA = cast<MCSectionELF>(LSDASection);


        


More information about the llvm-commits mailing list