[llvm] [XCOFF] make related SD symbols as isFunction (PR #69553)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 06:51:51 PST 2023


================
@@ -1242,21 +1242,53 @@ Expected<bool> XCOFFSymbolRef::isFunction() const {
 
   const XCOFFCsectAuxRef CsectAuxRef = ExpCsectAuxEnt.get();
 
-  // A function definition should be a label definition.
-  // FIXME: This is not necessarily the case when -ffunction-sections is
-  // enabled.
-  if (!CsectAuxRef.isLabel())
+  if (CsectAuxRef.getStorageMappingClass() != XCOFF::XMC_PR &&
+      CsectAuxRef.getStorageMappingClass() != XCOFF::XMC_GL)
     return false;
 
-  if (CsectAuxRef.getStorageMappingClass() != XCOFF::XMC_PR)
+  // A function definition should not be a common type symbol or a external
----------------
jh7370 wrote:

```suggestion
  // A function definition should not be a common type symbol or an external
```

https://github.com/llvm/llvm-project/pull/69553


More information about the llvm-commits mailing list