[llvm-commits] [llvm] r147087 - in /llvm/trunk/lib/MC: ELFObjectWriter.cpp ELFObjectWriter.h

Rafael Espindola rafael.espindola at gmail.com
Wed Dec 21 12:09:46 PST 2011


Author: rafael
Date: Wed Dec 21 14:09:46 2011
New Revision: 147087

URL: http://llvm.org/viewvc/llvm-project?rev=147087&view=rev
Log:
Switch from WriteEFlags to getEFlags in preparation for moving it
to Target/.

Modified:
    llvm/trunk/lib/MC/ELFObjectWriter.cpp
    llvm/trunk/lib/MC/ELFObjectWriter.h

Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=147087&r1=147086&r2=147087&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Wed Dec 21 14:09:46 2011
@@ -108,7 +108,7 @@
             sizeof(ELF::Elf32_Ehdr)));  // e_shoff = sec hdr table off in bytes
 
   // e_flags = whatever the target wants
-  WriteEFlags();
+  Write32(getEFlags());
 
   // e_ehsize = ELF header size
   Write16(is64Bit() ? sizeof(ELF::Elf64_Ehdr) : sizeof(ELF::Elf32_Ehdr));
@@ -1296,8 +1296,8 @@
 {}
 
 // FIXME: get the real EABI Version from the Triple.
-void ARMELFObjectWriter::WriteEFlags() {
-  Write32(ELF::EF_ARM_EABIMASK & DefaultEABIVersion);
+unsigned ARMELFObjectWriter::getEFlags() {
+  return ELF::EF_ARM_EABIMASK & DefaultEABIVersion;
 }
 
 // In ARM, _MergedGlobals and other most symbols get emitted directly.
@@ -1646,9 +1646,8 @@
 MipsELFObjectWriter::~MipsELFObjectWriter() {}
 
 // FIXME: get the real EABI Version from the Triple.
-void MipsELFObjectWriter::WriteEFlags() {
-  Write32(ELF::EF_MIPS_NOREORDER |
-          ELF::EF_MIPS_ARCH_32R2);
+unsigned MipsELFObjectWriter::getEFlags() {
+  return ELF::EF_MIPS_NOREORDER | ELF::EF_MIPS_ARCH_32R2;
 }
 
 const MCSymbol *MipsELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,

Modified: llvm/trunk/lib/MC/ELFObjectWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.h?rev=147087&r1=147086&r2=147087&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.h (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.h Wed Dec 21 14:09:46 2011
@@ -244,7 +244,7 @@
                              unsigned NumberOfSections);
 
     /// Default e_flags = 0
-    virtual void WriteEFlags() { Write32(0); }
+    virtual unsigned getEFlags() { return 0; }
 
     virtual void WriteSymbolEntry(MCDataFragment *SymtabF,
                                   MCDataFragment *ShndxF,
@@ -369,7 +369,7 @@
 
     virtual ~ARMELFObjectWriter();
 
-    virtual void WriteEFlags();
+    virtual unsigned getEFlags();
   protected:
     virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,
                                            const MCValue &Target,
@@ -425,7 +425,7 @@
                         bool IsLittleEndian);
 
     virtual ~MipsELFObjectWriter();
-    virtual void WriteEFlags();
+    virtual unsigned getEFlags();
 
   protected:
     virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,





More information about the llvm-commits mailing list