[llvm-commits] [llvm] r80572 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp lib/MC/MCMachOStreamer.cpp
Daniel Dunbar
daniel at zuster.org
Mon Aug 31 01:07:55 PDT 2009
Author: ddunbar
Date: Mon Aug 31 03:07:55 2009
New Revision: 80572
URL: http://llvm.org/viewvc/llvm-project?rev=80572&view=rev
Log:
llvm-mc: Add MCContext to MCAssembler.
Modified:
llvm/trunk/include/llvm/MC/MCAssembler.h
llvm/trunk/lib/MC/MCAssembler.cpp
llvm/trunk/lib/MC/MCMachOStreamer.cpp
Modified: llvm/trunk/include/llvm/MC/MCAssembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=80572&r1=80571&r2=80572&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAssembler.h (original)
+++ llvm/trunk/include/llvm/MC/MCAssembler.h Mon Aug 31 03:07:55 2009
@@ -21,6 +21,7 @@
namespace llvm {
class raw_ostream;
class MCAssembler;
+class MCContext;
class MCSection;
class MCSectionData;
@@ -559,6 +560,8 @@
MCAssembler(const MCAssembler&); // DO NOT IMPLEMENT
void operator=(const MCAssembler&); // DO NOT IMPLEMENT
+ MCContext &Context;
+
raw_ostream &OS;
iplist<MCSectionData> Sections;
@@ -584,9 +587,11 @@
// concrete and require clients to pass in a target like object. The other
// option is to make this abstract, and have targets provide concrete
// implementations as we do with AsmParser.
- MCAssembler(raw_ostream &OS);
+ MCAssembler(MCContext &_Context, raw_ostream &OS);
~MCAssembler();
+ MCContext &getContext() const { return Context; }
+
/// Finish - Do final processing and write the object to the output stream.
void Finish();
Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=80572&r1=80571&r2=80572&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Mon Aug 31 03:07:55 2009
@@ -940,9 +940,8 @@
/* *** */
-MCAssembler::MCAssembler(raw_ostream &_OS)
- : OS(_OS),
- SubsectionsViaSymbols(false)
+MCAssembler::MCAssembler(MCContext &_Context, raw_ostream &_OS)
+ : Context(_Context), OS(_OS), SubsectionsViaSymbols(false)
{
}
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=80572&r1=80571&r2=80572&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Mon Aug 31 03:07:55 2009
@@ -83,7 +83,7 @@
public:
MCMachOStreamer(MCContext &Context, raw_ostream &_OS, MCCodeEmitter *_Emitter)
- : MCStreamer(Context), Assembler(_OS), Emitter(_Emitter),
+ : MCStreamer(Context), Assembler(Context, _OS), Emitter(_Emitter),
CurSectionData(0) {}
~MCMachOStreamer() {}
More information about the llvm-commits
mailing list