aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-08 20:43:12 +0000
committerChris Lattner <sabre@nondot.org>2009-08-08 20:43:12 +0000
commitc9ea8fddb258a847ddd76df0a8b6676b219d99d2 (patch)
treea462303342eaf927fe9018af8b52e27464301f14 /llvm/lib/Target/TargetLoweringObjectFile.cpp
parentdc6bccbaa6bcd79d661d66f4e76fdc74be3939df (diff)
downloadllvm-c9ea8fddb258a847ddd76df0a8b6676b219d99d2.zip
llvm-c9ea8fddb258a847ddd76df0a8b6676b219d99d2.tar.gz
llvm-c9ea8fddb258a847ddd76df0a8b6676b219d99d2.tar.bz2
eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an asm syntax issue, not a semantic difference. TLOF should model the semantics of the section. llvm-svn: 78498
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 8a60086..eabd626 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -18,8 +18,9 @@
#include "llvm/GlobalVariable.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSection.h"
-#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/StringExtras.h"
@@ -407,7 +408,25 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
void TargetLoweringObjectFileELF::
-getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str) const {
+getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str,
+ const TargetAsmInfo &TAI) const {
+ // Handle the weird solaris syntax if desired.
+ if (TAI.usesSunStyleELFSectionSwitchSyntax() &&
+ !Kind.isMergeableConst() && !Kind.isMergeableCString()) {
+ // FIXME: Inefficient.
+ std::string Res;
+ if (!Kind.isMetadata())
+ Res += ",#alloc";
+ if (Kind.isText())
+ Res += ",#execinstr";
+ if (Kind.isWriteable())
+ Res += ",#write";
+ if (Kind.isThreadLocal())
+ Res += ",#tls";
+ Str.append(Res.begin(), Res.end());
+ return;
+ }
+
Str.push_back(',');
Str.push_back('"');
@@ -848,7 +867,8 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
void TargetLoweringObjectFileCOFF::
-getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str) const {
+getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str,
+ const TargetAsmInfo &TAI) const {
// FIXME: Inefficient.
std::string Res = ",\"";
if (Kind.isText())