[llvm] r273507 - Prune some includes from headers and sink some inline functions
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 22 16:23:08 PDT 2016
Author: rnk
Date: Wed Jun 22 18:23:08 2016
New Revision: 273507
URL: http://llvm.org/viewvc/llvm-project?rev=273507&view=rev
Log:
Prune some includes from headers and sink some inline functions
MCSymbol.h shouldn't pull in MCAssembler.h, just MCFragment.h.
MCLinkerOptimizationHint.h shouldn't need MCMachObjectWriter.h. The
rest is fixing the fallout.
Modified:
llvm/trunk/include/llvm/MC/MCELFObjectWriter.h
llvm/trunk/include/llvm/MC/MCLinkerOptimizationHint.h
llvm/trunk/include/llvm/MC/MCSymbol.h
llvm/trunk/lib/MC/MCCodeView.cpp
llvm/trunk/lib/MC/MCDwarf.cpp
llvm/trunk/lib/MC/MCLinkerOptimizationHint.cpp
llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
llvm/trunk/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
Modified: llvm/trunk/include/llvm/MC/MCELFObjectWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCELFObjectWriter.h?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCELFObjectWriter.h (original)
+++ llvm/trunk/include/llvm/MC/MCELFObjectWriter.h Wed Jun 22 18:23:08 2016
@@ -14,6 +14,7 @@
#include "llvm/MC/MCValue.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ELF.h"
+#include "llvm/Support/raw_ostream.h"
#include <vector>
namespace llvm {
Modified: llvm/trunk/include/llvm/MC/MCLinkerOptimizationHint.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCLinkerOptimizationHint.h?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCLinkerOptimizationHint.h (original)
+++ llvm/trunk/include/llvm/MC/MCLinkerOptimizationHint.h Wed Jun 22 18:23:08 2016
@@ -20,7 +20,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
-#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
@@ -28,6 +27,7 @@ namespace llvm {
// Forward declarations.
class MCAsmLayout;
class MCSymbol;
+class MachObjectWriter;
/// Linker Optimization Hint Type.
enum MCLOHType {
@@ -123,31 +123,12 @@ public:
/// Emit this directive as:
/// <kind, numArgs, addr1, ..., addrN>
- void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const {
- raw_ostream &OutStream = ObjWriter.getStream();
- emit_impl(OutStream, ObjWriter, Layout);
- }
+ void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const;
/// Get the size in bytes of this directive if emitted in \p ObjWriter with
/// the given \p Layout.
uint64_t getEmitSize(const MachObjectWriter &ObjWriter,
- const MCAsmLayout &Layout) const {
- class raw_counting_ostream : public raw_ostream {
- uint64_t Count;
-
- void write_impl(const char *, size_t size) override { Count += size; }
-
- uint64_t current_pos() const override { return Count; }
-
- public:
- raw_counting_ostream() : Count(0) {}
- ~raw_counting_ostream() override { flush(); }
- };
-
- raw_counting_ostream OutStream;
- emit_impl(OutStream, ObjWriter, Layout);
- return OutStream.tell();
- }
+ const MCAsmLayout &Layout) const;
};
class MCLOHContainer {
Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSymbol.h (original)
+++ llvm/trunk/include/llvm/MC/MCSymbol.h Wed Jun 22 18:23:08 2016
@@ -17,7 +17,7 @@
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/StringMap.h"
-#include "llvm/MC/MCAssembler.h"
+#include "llvm/MC/MCFragment.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
Modified: llvm/trunk/lib/MC/MCCodeView.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCCodeView.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCCodeView.cpp (original)
+++ llvm/trunk/lib/MC/MCCodeView.cpp Wed Jun 22 18:23:08 2016
@@ -21,6 +21,7 @@
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/COFF.h"
+#include "llvm/Support/EndianStream.h"
using namespace llvm;
using namespace llvm::codeview;
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Wed Jun 22 18:23:08 2016
@@ -22,6 +22,7 @@
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/EndianStream.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/Path.h"
Modified: llvm/trunk/lib/MC/MCLinkerOptimizationHint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCLinkerOptimizationHint.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCLinkerOptimizationHint.cpp (original)
+++ llvm/trunk/lib/MC/MCLinkerOptimizationHint.cpp Wed Jun 22 18:23:08 2016
@@ -10,6 +10,7 @@
#include "llvm/MC/MCLinkerOptimizationHint.h"
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h"
+#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/Support/LEB128.h"
using namespace llvm;
@@ -31,3 +32,28 @@ void MCLOHDirective::emit_impl(raw_ostre
It != EndIt; ++It)
encodeULEB128(ObjWriter.getSymbolAddress(**It, Layout), OutStream);
}
+
+void MCLOHDirective::emit(MachObjectWriter &ObjWriter,
+ const MCAsmLayout &Layout) const {
+ raw_ostream &OutStream = ObjWriter.getStream();
+ emit_impl(OutStream, ObjWriter, Layout);
+}
+
+uint64_t MCLOHDirective::getEmitSize(const MachObjectWriter &ObjWriter,
+ const MCAsmLayout &Layout) const {
+ class raw_counting_ostream : public raw_ostream {
+ uint64_t Count;
+
+ void write_impl(const char *, size_t size) override { Count += size; }
+
+ uint64_t current_pos() const override { return Count; }
+
+ public:
+ raw_counting_ostream() : Count(0) {}
+ ~raw_counting_ostream() override { flush(); }
+ };
+
+ raw_counting_ostream OutStream;
+ emit_impl(OutStream, ObjWriter, Layout);
+ return OutStream.tell();
+}
Modified: llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp Wed Jun 22 18:23:08 2016
@@ -20,6 +20,7 @@
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/Support/EndianStream.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp Wed Jun 22 18:23:08 2016
@@ -22,6 +22,7 @@
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCObjectWriter.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/TargetRegistry.h"
Modified: llvm/trunk/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp Wed Jun 22 18:23:08 2016
@@ -16,6 +16,7 @@
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
Modified: llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp?rev=273507&r1=273506&r2=273507&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp Wed Jun 22 18:23:08 2016
@@ -22,6 +22,7 @@
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/EndianStream.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
More information about the llvm-commits
mailing list