[FunctionAttrs] Extract a helper function for the core logic used to
[oota-llvm.git] / lib / MC / MCLinkerOptimizationHint.cpp
index 3f8d6203f012ae4dd916cda5a2694b79bf2b88bd..5f6a57980ad45ac3b4212b949c4002b9549ededa 100644 (file)
@@ -9,8 +9,8 @@
 
 #include "llvm/MC/MCLinkerOptimizationHint.h"
 #include "llvm/MC/MCAsmLayout.h"
+#include "llvm/MC/MCAssembler.h"
 #include "llvm/Support/LEB128.h"
-#include "llvm/MC/MCStreamer.h"
 
 using namespace llvm;
 
@@ -22,14 +22,12 @@ using namespace llvm;
 // - Its argN.
 // <arg1> to <argN> are absolute addresses in the object file, i.e.,
 // relative addresses from the beginning of the object file.
-void MCLOHDirective::Emit_impl(raw_ostream &OutStream,
+void MCLOHDirective::emit_impl(raw_ostream &OutStream,
                                const MachObjectWriter &ObjWriter,
                                const MCAsmLayout &Layout) const {
-  const MCAssembler &Asm = Layout.getAssembler();
   encodeULEB128(Kind, OutStream);
   encodeULEB128(Args.size(), OutStream);
   for (LOHArgs::const_iterator It = Args.begin(), EndIt = Args.end();
        It != EndIt; ++It)
-    encodeULEB128(ObjWriter.getSymbolAddress(&Asm.getSymbolData(**It), Layout),
-                  OutStream);
+    encodeULEB128(ObjWriter.getSymbolAddress(**It, Layout), OutStream);
 }