Add an option for evaluating past symbols.
[oota-llvm.git] / include / llvm / MC / MCMachObjectWriter.h
index ae3beb10c7b616b7e3d6be4f499acaefa8e15b7a..e7d5bbd5be6778f4ea0d36632fea2e1fdd952bb5 100644 (file)
@@ -11,7 +11,6 @@
 #define LLVM_MC_MCMACHOBJECTWRITER_H
 
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/MC/MCExpr.h"
 #include "llvm/MC/MCObjectWriter.h"
@@ -92,7 +91,7 @@ class MachObjectWriter : public MCObjectWriter {
   };
 
   /// The target specific Mach-O writer instance.
-  llvm::OwningPtr<MCMachObjectTargetWriter> TargetObjectWriter;
+  std::unique_ptr<MCMachObjectTargetWriter> TargetObjectWriter;
 
   /// @name Relocation Data
   /// @{
@@ -121,7 +120,7 @@ public:
   /// @name Lifetime management Methods
   /// @{
 
-  virtual void reset();
+  void reset() override;
 
   /// @}
 
@@ -154,9 +153,9 @@ public:
   /// @{
 
   bool is64Bit() const { return TargetObjectWriter->is64Bit(); }
-  bool isARM() const {
-    uint32_t CPUType = TargetObjectWriter->getCPUType() & ~MachO::CPU_ARCH_MASK;
-    return CPUType == MachO::CPU_TYPE_ARM;
+  bool isX86_64() const {
+    uint32_t CPUType = TargetObjectWriter->getCPUType();
+    return CPUType == MachO::CPU_TYPE_X86_64;
   }
 
   /// @}
@@ -211,20 +210,6 @@ public:
   //  - Input errors, where something cannot be correctly encoded. 'as' allows
   //    these through in many cases.
 
-  void addRelocation(const MCSectionData *SD,
-                     MachO::relocation_info &MRE) {
-    MachO::any_relocation_info AMRE;
-    memcpy(&AMRE, &MRE, sizeof(MRE));
-    Relocations[SD].push_back(AMRE);
-  }
-
-  void addRelocation(const MCSectionData *SD,
-                     MachO::scattered_relocation_info &SMRE) {
-    MachO::any_relocation_info MRE;
-    memcpy(&MRE, &SMRE, sizeof(MRE));
-    Relocations[SD].push_back(MRE);
-  }
-
   void addRelocation(const MCSectionData *SD,
                      MachO::any_relocation_info &MRE) {
     Relocations[SD].push_back(MRE);
@@ -245,7 +230,8 @@ public:
 
   void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
                         const MCFragment *Fragment, const MCFixup &Fixup,
-                        MCValue Target, uint64_t &FixedValue);
+                        MCValue Target, bool &IsPCRel,
+                        uint64_t &FixedValue) override;
 
   void BindIndirectSymbols(MCAssembler &Asm);
 
@@ -262,15 +248,16 @@ public:
 
   void markAbsoluteVariableSymbols(MCAssembler &Asm,
                                    const MCAsmLayout &Layout);
-  void ExecutePostLayoutBinding(MCAssembler &Asm, const MCAsmLayout &Layout);
+  void ExecutePostLayoutBinding(MCAssembler &Asm,
+                                const MCAsmLayout &Layout) override;
 
-  virtual bool IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
-                                                      const MCSymbolData &DataA,
-                                                      const MCFragment &FB,
-                                                      bool InSet,
-                                                      bool IsPCRel) const;
+  bool IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
+                                              const MCSymbolData &DataA,
+                                              const MCFragment &FB,
+                                              bool InSet,
+                                              bool IsPCRel) const override;
 
-  void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
+  void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
 };