llvm-mc: Add MCContext to MCAssembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-08-31 08:07:55 +00:00
parent 6ce004dc76
commit a03a368acc
3 changed files with 9 additions and 5 deletions

View File

@ -21,6 +21,7 @@
namespace llvm {
class raw_ostream;
class MCAssembler;
class MCContext;
class MCSection;
class MCSectionData;
@ -559,6 +560,8 @@ private:
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 @@ public:
// 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();

View File

@ -940,9 +940,8 @@ MCSymbolData::MCSymbolData(MCSymbol &_Symbol, MCFragment *_Fragment,
/* *** */
MCAssembler::MCAssembler(raw_ostream &_OS)
: OS(_OS),
SubsectionsViaSymbols(false)
MCAssembler::MCAssembler(MCContext &_Context, raw_ostream &_OS)
: Context(_Context), OS(_OS), SubsectionsViaSymbols(false)
{
}

View File

@ -83,7 +83,7 @@ private:
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() {}