The COFFSymbolRef::isFunctionDefinition() function tests for several conditions
that are not related to whether a symbol is a function, but rather whether
the symbol meets the requirements for a function definition auxiliary record,
which excludes certain symbols such as internal functions and undefined
references. The test we need to determine the symbol type is much simpler:
we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244195
91177308-0d34-0410-b5e6-
96231b3b80d8
COFFSymbolRef Symb = getCOFFSymbol(Ref);
int32_t SectionNumber = Symb.getSectionNumber();
+ if (Symb.getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION)
+ return SymbolRef::ST_Function;
if (Symb.isAnyUndefined())
return SymbolRef::ST_Unknown;
- if (Symb.isFunctionDefinition())
- return SymbolRef::ST_Function;
if (Symb.isCommon())
return SymbolRef::ST_Data;
if (Symb.isFileRecord())
--- /dev/null
+RUN: llvm-objdump -d %p/Inputs/internal.exe.coff-x86_64 | FileCheck %s
+
+CHECK: callq {{.*}} <foo>