summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2012-10-15 15:43:14 +0000
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2012-10-15 15:43:14 +0000
commitef206f19a4be428092b173339df138a3c17e1687 (patch)
tree6c28b192c082a822564215065c28bfd425bf0f35 /llvm/lib/MC/MCELFStreamer.cpp
parent7b03290c437177cce12a3774651f94af9ecb41df (diff)
downloadbcm5719-llvm-ef206f19a4be428092b173339df138a3c17e1687.tar.gz
bcm5719-llvm-ef206f19a4be428092b173339df138a3c17e1687.zip
PowerPC: add EmitTCEntry class for TOC creation
This patch replaces the EmitRawText by a EmitTCEntry class (specialized for each Streamer) in PowerPC64 TOC entry creation. llvm-svn: 165940
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 8107005481d..14fbc1ec839 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -103,6 +103,8 @@ public:
virtual void EmitFileDirective(StringRef Filename);
+ virtual void EmitTCEntry(const MCSymbol &S);
+
virtual void FinishImpl();
private:
@@ -469,6 +471,12 @@ void MCELFStreamer::FinishImpl() {
this->MCObjectStreamer::FinishImpl();
}
+void MCELFStreamer::EmitTCEntry(const MCSymbol &S)
+{
+ // Creates a R_PPC64_TOC relocation
+ MCObjectStreamer::EmitSymbolValue(&S, 8, 0);
+}
+
MCStreamer *llvm::createELFStreamer(MCContext &Context, MCAsmBackend &MAB,
raw_ostream &OS, MCCodeEmitter *CE,
bool RelaxAll, bool NoExecStack) {
OpenPOWER on IntegriCloud