summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-21 21:26:32 +0000
committerChris Lattner <sabre@nondot.org>2009-07-21 21:26:32 +0000
commitfd047e11a1815c0ddbd78d98e476e091ce77ab23 (patch)
treea485ce1fe3e1aba9d7d0f7df32ee25b6bd982591 /llvm/lib
parentf0951f6d41f16e4e8e53f440613882d716073549 (diff)
downloadbcm5719-llvm-fd047e11a1815c0ddbd78d98e476e091ce77ab23.tar.gz
bcm5719-llvm-fd047e11a1815c0ddbd78d98e476e091ce77ab23.zip
Remove some overridden functions in XCoreTargetAsmInfo that are
implemented exactly the same way as its ELFTargetAsmInfo subclass has them. llvm-svn: 76653
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ELFTargetAsmInfo.cpp5
-rw-r--r--llvm/lib/Target/XCore/XCoreTargetAsmInfo.cpp63
-rw-r--r--llvm/lib/Target/XCore/XCoreTargetAsmInfo.h7
3 files changed, 5 insertions, 70 deletions
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp
index 0338ba42858..e528aebf9a3 100644
--- a/llvm/lib/Target/ELFTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp
@@ -142,11 +142,10 @@ ELFTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
const Section*
ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
- Constant *C = GV->getInitializer();
- return MergeableConstSection(C->getType());
+ return MergeableConstSection(GV->getInitializer()->getType());
}
-inline const Section*
+const Section*
ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
const TargetData *TD = TM.getTargetData();
diff --git a/llvm/lib/Target/XCore/XCoreTargetAsmInfo.cpp b/llvm/lib/Target/XCore/XCoreTargetAsmInfo.cpp
index 59ad624052a..3d2203d6bb2 100644
--- a/llvm/lib/Target/XCore/XCoreTargetAsmInfo.cpp
+++ b/llvm/lib/Target/XCore/XCoreTargetAsmInfo.cpp
@@ -72,12 +72,9 @@ const Section*
XCoreTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
SectionKind::Kind Kind = SectionKindForGlobal(GV);
- if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
- {
+ if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
if (!GVar->isWeakForLinker()) {
switch (Kind) {
- case SectionKind::RODataMergeStr:
- return MergeableStringSection(GVar);
case SectionKind::RODataMergeConst:
return getReadOnlySection();
case SectionKind::ThreadData:
@@ -93,17 +90,6 @@ XCoreTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
}
const Section*
-XCoreTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
- return MergeableConstSection(Ty);
-}
-
-const Section*
-XCoreTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
- Constant *C = GV->getInitializer();
- return MergeableConstSection(C->getType());
-}
-
-inline const Section*
XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
const TargetData *TD = TM.getTargetData();
@@ -120,15 +106,8 @@ XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
return getReadOnlySection();
}
-const Section* XCoreTargetAsmInfo::
-MergeableStringSection(const GlobalVariable *GV) const {
- // FIXME insert in correct mergable section
- return getReadOnlySection();
-}
-
unsigned XCoreTargetAsmInfo::
-SectionFlagsForGlobal(const GlobalValue *GV,
- const char* Name) const {
+SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const {
unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name);
// Mask out unsupported flags
Flags &= ~(SectionFlags::Small | SectionFlags::TLS);
@@ -162,41 +141,3 @@ SectionFlagsForGlobal(const GlobalValue *GV,
return Flags;
}
-
-std::string XCoreTargetAsmInfo::
-printSectionFlags(unsigned flags) const {
- std::string Flags = ",\"";
-
- if (!(flags & SectionFlags::Debug))
- Flags += 'a';
- if (flags & SectionFlags::Code)
- Flags += 'x';
- if (flags & SectionFlags::Writeable)
- Flags += 'w';
- if (flags & SectionFlags::Mergeable)
- Flags += 'M';
- if (flags & SectionFlags::Strings)
- Flags += 'S';
- if (flags & SectionFlags::TLS)
- Flags += 'T';
- if (flags & SectionFlags::Small) {
- if (flags & SectionFlags::Writeable)
- Flags += 'd'; // DP relative
- else
- Flags += 'c'; // CP relative
- }
-
- Flags += "\",";
-
- Flags += '@';
-
- if (flags & SectionFlags::BSS)
- Flags += "nobits";
- else
- Flags += "progbits";
-
- if (unsigned entitySize = SectionFlags::getEntitySize(flags))
- Flags += "," + utostr(entitySize);
-
- return Flags;
-}
diff --git a/llvm/lib/Target/XCore/XCoreTargetAsmInfo.h b/llvm/lib/Target/XCore/XCoreTargetAsmInfo.h
index 79fd36aa23c..a1e11fe7868 100644
--- a/llvm/lib/Target/XCore/XCoreTargetAsmInfo.h
+++ b/llvm/lib/Target/XCore/XCoreTargetAsmInfo.h
@@ -29,12 +29,7 @@ namespace llvm {
explicit XCoreTargetAsmInfo(const XCoreTargetMachine &TM);
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
- virtual std::string printSectionFlags(unsigned flags) const;
- const Section* MergeableConstSection(const GlobalVariable *GV) const;
- inline const Section* MergeableConstSection(const Type *Ty) const;
- const Section* MergeableStringSection(const GlobalVariable *GV) const;
- virtual const Section*
- SelectSectionForMachineConst(const Type *Ty) const;
+ const Section* MergeableConstSection(const Type *Ty) const;
virtual unsigned
SectionFlagsForGlobal(const GlobalValue *GV = NULL,
const char* name = NULL) const;
OpenPOWER on IntegriCloud