Chromium Code Reviews| Index: src/IceGlobalContext.h |
| diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h |
| index d19249d40c2f9aaa6bedf2b27a2b4e328abb4914..ed5c3ddd0ff364e4594c7e63a2a4e9886415ad11 100644 |
| --- a/src/IceGlobalContext.h |
| +++ b/src/IceGlobalContext.h |
| @@ -20,6 +20,7 @@ |
| #include "IceClFlags.h" |
| #include "IceIntrinsics.h" |
| #include "IceRNG.h" |
| +#include "IceSwitchLowering.h" |
| #include "IceThreading.h" |
| #include "IceTimerTree.h" |
| #include "IceTypes.h" |
| @@ -55,6 +56,7 @@ public: |
| } |
| ~LockedPtr() { Lock->unlock(); } |
| T *operator->() const { return Value; } |
| + T &operator*() const { return *Value; } |
| private: |
| T *Value; |
| @@ -209,6 +211,13 @@ public: |
| /// Returns a copy of the list of external symbols. |
| ConstantList getConstantExternSyms(); |
| + /// Return a locked pointer to the registered jump tables. |
| + LockedPtr<std::vector<JumpTableData>> getJumpTables() { |
|
Jim Stichnoth
2015/07/30 19:21:23
Change these to JumpTableDataList
ascull
2015/07/30 20:39:38
Done.
|
| + return LockedPtr<std::vector<JumpTableData>>(&JumpTables, &JumpTablesLock); |
| + } |
| + /// Create a new jump table entry and return a reference to it. |
| + JumpTableData &addJumpTable(IceString FuncName, SizeT Id, SizeT NumTargets); |
| + |
| const ClFlags &getFlags() const { return Flags; } |
| bool isIRGenerationDisabled() const { |
| @@ -335,6 +344,8 @@ public: |
| void lowerConstants(); |
| + void lowerJumpTables(); |
| + |
| void emitQueueBlockingPush(EmitterWorkItem *Item); |
| EmitterWorkItem *emitQueueBlockingPop(); |
| void emitQueueNotifyEnd() { EmitQ.notifyEnd(); } |
| @@ -456,6 +467,11 @@ private: |
| std::unique_ptr<ConstantPool> ConstPool; |
| ICE_CACHELINE_BOUNDARY; |
| + // Managed by getJumpTables() |
| + GlobalLockType JumpTablesLock; |
| + JumpTableDataList JumpTables; |
| + |
| + ICE_CACHELINE_BOUNDARY; |
| // Managed by getErrorStatus() |
| GlobalLockType ErrorStatusLock; |
| ErrorCode ErrorStatus; |