aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/MC/MCAssembler.h7
-rw-r--r--lib/MC/MCAssembler.cpp5
-rw-r--r--lib/MC/MCMachOStreamer.cpp2
3 files changed, 9 insertions, 5 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 182d2fe..adafcd6 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -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();
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 0d9b540..fe3d2d1 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -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)
{
}
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp
index 41c82b3..87ea99f 100644
--- a/lib/MC/MCMachOStreamer.cpp
+++ b/lib/MC/MCMachOStreamer.cpp
@@ -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() {}