llvm.org GIT mirror llvm / 5e44e47
use TLOF to compute the section for a function instead of replicating the logic manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78011 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
252252 // NOTE: we don't print out constant pools here, they are handled as
253253 // instructions.
254254
255 O << "\n";
255 O << '\n';
256
256257 // Print out labels for the function.
257258 const Function *F = MF.getFunction();
259 SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM));
260
258261 switch (F->getLinkage()) {
259262 default: llvm_unreachable("Unknown linkage type!");
260263 case Function::PrivateLinkage:
261264 case Function::LinkerPrivateLinkage:
262265 case Function::InternalLinkage:
263 SwitchToTextSection("\t.text", F);
264266 break;
265267 case Function::ExternalLinkage:
266 SwitchToTextSection("\t.text", F);
267268 O << "\t.globl\t" << CurrentFnName << "\n";
268269 break;
269270 case Function::WeakAnyLinkage:
271272 case Function::LinkOnceAnyLinkage:
272273 case Function::LinkOnceODRLinkage:
273274 if (Subtarget->isTargetDarwin()) {
274 SwitchToTextSection(
275 ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", F);
276275 O << "\t.globl\t" << CurrentFnName << "\n";
277276 O << "\t.weak_definition\t" << CurrentFnName << "\n";
278277 } else {