implement DarwinTargetAsmInfo::getSectionForFunction, use it when outputting
function bodies
llvm-svn: 30733
diff --git a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index 03e9a01..f767a44 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -13,7 +13,7 @@
#include "PPCTargetAsmInfo.h"
#include "PPCTargetMachine.h"
-
+#include "llvm/Function.h"
using namespace llvm;
DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) {
@@ -50,3 +50,15 @@
DwarfRangesSection = ".section __DWARF,__debug_ranges";
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo";
}
+
+
+const char *DarwinTargetAsmInfo::getSectionForFunction(const Function &F) const{
+ switch (F.getLinkage()) {
+ default: assert(0 && "Unknown linkage type!");
+ case Function::ExternalLinkage:
+ case Function::InternalLinkage: return TextSection;
+ case Function::WeakLinkage:
+ case Function::LinkOnceLinkage:
+ return ".section __TEXT,__textcoal_nt,coalesced,pure_instructions";
+ }
+}