eliminate a pointless switch stmt.
authorChris Lattner <sabre@nondot.org>
Sun, 26 Jul 2009 01:44:55 +0000 (01:44 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Jul 2009 01:44:55 +0000 (01:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77110 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ELFTargetAsmInfo.cpp

index 510816fdfcc3c28f1f90ececa0eee358610b8172..da8ed73852be2cab960fc8b1f6fb4e346b854668 100644 (file)
@@ -49,17 +49,8 @@ ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
 const Section*
 ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
                                          SectionKind Kind) const {
-  if (const Function *F = dyn_cast<Function>(GV)) {
-    switch (F->getLinkage()) {
-    default: llvm_unreachable("Unknown linkage type!");
-    case Function::PrivateLinkage:
-    case Function::LinkerPrivateLinkage:
-    case Function::InternalLinkage:
-    case Function::DLLExportLinkage:
-    case Function::ExternalLinkage:
-      return TextSection;
-    }
-  }
+  if (isa<Function>(GV))
+    return TextSection;
   
   const GlobalVariable *GVar = cast<GlobalVariable>(GV);
   switch (Kind.getKind()) {