| Index: src/IceGlobalContext.h
|
| diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
|
| index 43f65ad8fe8a747cfddb85b2a0dd7faac3f59e18..90ca9ab7ec260913202d493f9ea985826954135d 100644
|
| --- a/src/IceGlobalContext.h
|
| +++ b/src/IceGlobalContext.h
|
| @@ -22,6 +22,7 @@
|
|
|
| #include "IceDefs.h"
|
| #include "IceClFlags.h"
|
| +#include "IceELFObjectWriter.h"
|
| #include "IceIntrinsics.h"
|
| #include "IceRNG.h"
|
| #include "IceTimerTree.h"
|
| @@ -75,8 +76,8 @@ class GlobalContext {
|
|
|
| public:
|
| GlobalContext(llvm::raw_ostream *OsDump, llvm::raw_ostream *OsEmit,
|
| - VerboseMask Mask, TargetArch Arch, OptLevel Opt,
|
| - IceString TestPrefix, const ClFlags &Flags);
|
| + ELFStreamer *ELFStreamer, VerboseMask Mask, TargetArch Arch,
|
| + OptLevel Opt, IceString TestPrefix, const ClFlags &Flags);
|
| ~GlobalContext();
|
|
|
| // Returns true if any of the specified options in the verbose mask
|
| @@ -146,15 +147,26 @@ public:
|
| return ALLOW_DISABLE_IR_GEN ? getFlags().DisableIRGeneration : false;
|
| }
|
|
|
| - // Allocate data of type T using the global allocator.
|
| + // Allocate one instance of data of type T using the global allocator.
|
| template <typename T> T *allocate() { return Allocator.Allocate<T>(); }
|
|
|
| + // Allocate an N element array of data of bytes using the global allocator.
|
| + template uint8_t *allocateBytes(size_t N, size_t Align) {
|
| + return reinterpret_cast<uint8_t *>(Allocator.Allocate(N, Align));
|
| + }
|
| +
|
| const Intrinsics &getIntrinsicsInfo() const { return IntrinsicsInfo; }
|
|
|
| // TODO(wala,stichnot): Make the RNG play nicely with multithreaded
|
| // translation.
|
| RandomNumberGenerator &getRNG() { return RNG; }
|
|
|
| + ELFObjectWriter *getObjectWriter() const { return ObjectWriter.get(); }
|
| +
|
| + const GlobalDeclarationList &getGlobalDeclarations() const {
|
| + return GlobalDeclarations;
|
| + }
|
| +
|
| // Reset stats at the beginning of a function.
|
| void resetStats() { StatsFunction.reset(); }
|
| void dumpStats(const IceString &Name, bool Final = false);
|
| @@ -209,10 +221,11 @@ private:
|
| const ClFlags &Flags;
|
| bool HasEmittedFirstMethod;
|
| RandomNumberGenerator RNG;
|
| + std::unique_ptr<ELFObjectWriter> ObjectWriter;
|
| CodeStats StatsFunction;
|
| CodeStats StatsCumulative;
|
| std::vector<TimerStack> Timers;
|
| - std::vector<GlobalDeclaration *> GlobalDeclarations;
|
| + GlobalDeclarationList GlobalDeclarations;
|
|
|
| // Private helpers for mangleName()
|
| typedef llvm::SmallVector<char, 32> ManglerVector;
|
|
|