Chromium Code Reviews| Index: src/IceCfg.h |
| diff --git a/src/IceCfg.h b/src/IceCfg.h |
| index 605dcf71304f39a1d62c1e5e1512c77321933088..769ac636daf622c9a164a86d5940c6bd50598539 100644 |
| --- a/src/IceCfg.h |
| +++ b/src/IceCfg.h |
| @@ -30,8 +30,8 @@ class Cfg { |
| public: |
| ~Cfg(); |
|
Karl
2015/02/08 21:11:57
Why not SequenceNumber?
Jim Stichnoth
2015/02/10 07:51:47
Done.
|
| - static std::unique_ptr<Cfg> create(GlobalContext *Ctx) { |
| - return std::unique_ptr<Cfg>(new Cfg(Ctx)); |
| + static std::unique_ptr<Cfg> create(GlobalContext *Ctx, uint32_t Sequence) { |
| + return std::unique_ptr<Cfg>(new Cfg(Ctx, Sequence)); |
| } |
| // Gets a pointer to the current thread's Cfg. |
| static const Cfg *getCurrentCfg() { return ICE_TLS_GET_FIELD(CurrentCfg); } |
| @@ -45,6 +45,7 @@ public: |
| } |
| GlobalContext *getContext() const { return Ctx; } |
| + uint32_t getSequenceNumber() const { return SequenceNumber; } |
| // Returns true if any of the specified options in the verbose mask |
| // are set. If the argument is omitted, it checks if any verbose |
| @@ -121,9 +122,10 @@ public: |
| TargetLowering *getTarget() const { return Target.get(); } |
| VariablesMetadata *getVMetadata() const { return VMetadata.get(); } |
| Liveness *getLiveness() const { return Live.get(); } |
| - template <typename T> T *getAssembler() const { |
| + template <typename T = Assembler> T *getAssembler() const { |
| return static_cast<T *>(TargetAssembler.get()); |
| } |
| + Assembler *releaseAssembler() { return TargetAssembler.release(); } |
| bool hasComputedFrame() const; |
| bool getFocusedTiming() const { return FocusedTiming; } |
| void setFocusedTiming() { FocusedTiming = true; } |
| @@ -159,7 +161,8 @@ public: |
| void emit(); |
| void emitIAS(); |
| - void emitTextHeader(const IceString &MangledName); |
| + static void emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, |
| + Assembler *Asm); |
| void dump(const IceString &Message = ""); |
| // Allocate data of type T using the per-Cfg allocator. |
| @@ -181,9 +184,10 @@ public: |
| } |
| private: |
| - Cfg(GlobalContext *Ctx); |
| + Cfg(GlobalContext *Ctx, uint32_t Sequence); |
| GlobalContext *Ctx; |
| + uint32_t SequenceNumber; // output order for emission |
| VerboseMask VMask; |
| IceString FunctionName; |
| Type ReturnType; |