diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1705,13 +1705,16 @@ const Function &F = MF.getFunction(); // Get the function symbol. - if (TM.getTargetTriple().isOSAIX()) { + if (!MAI->needsFunctionDescriptors()) { + CurrentFnSym = getSymbol(&MF.getFunction()); + } else { + assert(TM.getTargetTriple().isOSAIX() && + "Only AIX uses the function descriptor hooks."); // AIX is unique here in that the name of the symbol emitted for the // function body does not have the same name as the source function's // C-linkage name. - assert(MAI->needsFunctionDescriptors() && "AIX ABI is descriptor based."); assert(CurrentFnDescSym && "The function descriptor symbol needs to be" - " initalized first."); + " initalized first."); // Get the function entry point symbol. CurrentFnSym = @@ -1721,8 +1724,6 @@ MCSectionXCOFF *FnEntryPointSec = cast(getObjFileLowering().SectionForGlobal(&F, TM)); cast(CurrentFnSym)->setContainingCsect(FnEntryPointSec); - } else { - CurrentFnSym = getSymbol(&MF.getFunction()); } CurrentFnSymForSize = CurrentFnSym;