summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-01-23 04:28:49 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-01-23 04:28:49 +0000
commitaea4958ea6acd5d5820149cc76dae57a1f2c5c12 (patch)
tree574d5e614651a478f6a3fede73b50d1b51037526 /llvm/lib/Target
parenta914bed8006a754ce36ccb00860bd944ca8807ae (diff)
downloadbcm5719-llvm-aea4958ea6acd5d5820149cc76dae57a1f2c5c12.tar.gz
bcm5719-llvm-aea4958ea6acd5d5820149cc76dae57a1f2c5c12.zip
Remove duplicated code.
llvm-svn: 124054
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/ARMTargetObjectFile.cpp7
-rw-r--r--llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp5
-rw-r--r--llvm/lib/Target/Mips/MipsTargetObjectFile.cpp5
-rw-r--r--llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp3
-rw-r--r--llvm/lib/Target/X86/X86MCAsmInfo.cpp3
-rw-r--r--llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp13
6 files changed, 21 insertions, 15 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp b/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp
index f967b4d21ea..163971f96fe 100644
--- a/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp
@@ -12,6 +12,7 @@
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/Support/Dwarf.h"
+#include "llvm/Support/ELF.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
using namespace dwarf;
@@ -26,12 +27,12 @@ void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
StaticCtorSection =
- getContext().getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
+ getContext().getELFSection(".init_array", ELF::SHT_INIT_ARRAY,
MCSectionELF::SHF_WRITE |
MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel());
StaticDtorSection =
- getContext().getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
+ getContext().getELFSection(".fini_array", ELF::SHT_FINI_ARRAY,
MCSectionELF::SHF_WRITE |
MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel());
@@ -39,7 +40,7 @@ void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
AttributesSection =
getContext().getELFSection(".ARM.attributes",
- MCSectionELF::SHT_ARM_ATTRIBUTES,
+ ELF::SHT_ARM_ATTRIBUTES,
0,
SectionKind::getMetadata());
}
diff --git a/llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp b/llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp
index 05c01ef7a5d..a9c152dc95c 100644
--- a/llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp
+++ b/llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp
@@ -16,6 +16,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ELF.h"
using namespace llvm;
void MBlazeTargetObjectFile::
@@ -23,12 +24,12 @@ Initialize(MCContext &Ctx, const TargetMachine &TM) {
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
SmallDataSection =
- getContext().getELFSection(".sdata", MCSectionELF::SHT_PROGBITS,
+ getContext().getELFSection(".sdata", ELF::SHT_PROGBITS,
MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel());
SmallBSSSection =
- getContext().getELFSection(".sbss", MCSectionELF::SHT_NOBITS,
+ getContext().getELFSection(".sbss", ELF::SHT_NOBITS,
MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getBSS());
diff --git a/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp b/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp
index c394d738def..07a130ba055 100644
--- a/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp
@@ -16,6 +16,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ELF.h"
using namespace llvm;
static cl::opt<unsigned>
@@ -27,12 +28,12 @@ void MipsTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
SmallDataSection =
- getContext().getELFSection(".sdata", MCSectionELF::SHT_PROGBITS,
+ getContext().getELFSection(".sdata", ELF::SHT_PROGBITS,
MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel());
SmallBSSSection =
- getContext().getELFSection(".sbss", MCSectionELF::SHT_NOBITS,
+ getContext().getELFSection(".sbss", ELF::SHT_NOBITS,
MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getBSS());
diff --git a/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp b/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
index e2ae79d59ea..2dc7e7bd29b 100644
--- a/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
@@ -14,6 +14,7 @@
#include "SystemZMCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
+#include "llvm/Support/ELF.h"
using namespace llvm;
SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, StringRef TT) {
@@ -24,6 +25,6 @@ SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, StringRef TT) {
const MCSection *SystemZMCAsmInfo::
getNonexecutableStackSection(MCContext &Ctx) const{
- return Ctx.getELFSection(".note.GNU-stack", MCSectionELF::SHT_PROGBITS,
+ return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS,
0, SectionKind::getMetadata());
}
diff --git a/llvm/lib/Target/X86/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/X86MCAsmInfo.cpp
index e55edfebf78..6686214e06f 100644
--- a/llvm/lib/Target/X86/X86MCAsmInfo.cpp
+++ b/llvm/lib/Target/X86/X86MCAsmInfo.cpp
@@ -17,6 +17,7 @@
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ELF.h"
using namespace llvm;
enum AsmWriterFlavorTy {
@@ -98,7 +99,7 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
const MCSection *X86ELFMCAsmInfo::
getNonexecutableStackSection(MCContext &Ctx) const {
- return Ctx.getELFSection(".note.GNU-stack", MCSectionELF::SHT_PROGBITS,
+ return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS,
0, SectionKind::getMetadata());
}
diff --git a/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp b/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
index f5f90ce5a9f..faf61c95256 100644
--- a/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
+++ b/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
@@ -12,6 +12,7 @@
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Support/ELF.h"
using namespace llvm;
@@ -19,28 +20,28 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
DataSection =
- Ctx.getELFSection(".dp.data", MCSectionELF::SHT_PROGBITS,
+ Ctx.getELFSection(".dp.data", ELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE |
MCSectionELF::XCORE_SHF_DP_SECTION,
SectionKind::getDataRel());
BSSSection =
- Ctx.getELFSection(".dp.bss", MCSectionELF::SHT_NOBITS,
+ Ctx.getELFSection(".dp.bss", ELF::SHT_NOBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE |
MCSectionELF::XCORE_SHF_DP_SECTION,
SectionKind::getBSS());
MergeableConst4Section =
- Ctx.getELFSection(".cp.rodata.cst4", MCSectionELF::SHT_PROGBITS,
+ Ctx.getELFSection(".cp.rodata.cst4", ELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
MCSectionELF::XCORE_SHF_CP_SECTION,
SectionKind::getMergeableConst4());
MergeableConst8Section =
- Ctx.getELFSection(".cp.rodata.cst8", MCSectionELF::SHT_PROGBITS,
+ Ctx.getELFSection(".cp.rodata.cst8", ELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
MCSectionELF::XCORE_SHF_CP_SECTION,
SectionKind::getMergeableConst8());
MergeableConst16Section =
- Ctx.getELFSection(".cp.rodata.cst16", MCSectionELF::SHT_PROGBITS,
+ Ctx.getELFSection(".cp.rodata.cst16", ELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
MCSectionELF::XCORE_SHF_CP_SECTION,
SectionKind::getMergeableConst16());
@@ -52,7 +53,7 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
TLSBSSSection = BSSSection;
ReadOnlySection =
- Ctx.getELFSection(".cp.rodata", MCSectionELF::SHT_PROGBITS,
+ Ctx.getELFSection(".cp.rodata", ELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC |
MCSectionELF::XCORE_SHF_CP_SECTION,
SectionKind::getReadOnlyWithRel());
OpenPOWER on IntegriCloud