Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: src/IceTargetLowering.h

Issue 624663002: Introduce model of global initializers in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceGlobalInits.cpp ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares the TargetLowering and LoweringContext 10 // This file declares the TargetLowering and LoweringContext
11 // classes. TargetLowering is an abstract class used to drive the 11 // classes. TargetLowering is an abstract class used to drive the
12 // translation/lowering process. LoweringContext maintains a 12 // translation/lowering process. LoweringContext maintains a
13 // context for lowering each instruction, offering conveniences such 13 // context for lowering each instruction, offering conveniences such
14 // as iterating over non-deleted instructions. 14 // as iterating over non-deleted instructions.
15 // 15 //
16 //===----------------------------------------------------------------------===// 16 //===----------------------------------------------------------------------===//
17 17
18 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H 18 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H
19 #define SUBZERO_SRC_ICETARGETLOWERING_H 19 #define SUBZERO_SRC_ICETARGETLOWERING_H
20 20
21 #include "IceDefs.h" 21 #include "IceDefs.h"
22 #include "IceInst.h" // for the names of the Inst subtypes 22 #include "IceInst.h" // for the names of the Inst subtypes
23 #include "IceTypes.h" 23 #include "IceTypes.h"
24 24
25 namespace Ice { 25 namespace Ice {
26 26
27 typedef uint8_t AsmCodeByte; 27 typedef uint8_t AsmCodeByte;
28 28
29 class Assembler; 29 class Assembler;
30 class GlobalAddress;
30 31
31 // LoweringContext makes it easy to iterate through non-deleted 32 // LoweringContext makes it easy to iterate through non-deleted
32 // instructions in a node, and insert new (lowered) instructions at 33 // instructions in a node, and insert new (lowered) instructions at
33 // the current point. Along with the instruction list container and 34 // the current point. Along with the instruction list container and
34 // associated iterators, it holds the current node, which is needed 35 // associated iterators, it holds the current node, which is needed
35 // when inserting new instructions in order to track whether variables 36 // when inserting new instructions in order to track whether variables
36 // are used as single-block or multi-block. 37 // are used as single-block or multi-block.
37 class LoweringContext { 38 class LoweringContext {
38 public: 39 public:
39 LoweringContext() : Node(NULL) {} 40 LoweringContext() : Node(NULL) {}
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 242
242 // TargetGlobalInitLowering is used for "lowering" global 243 // TargetGlobalInitLowering is used for "lowering" global
243 // initializers. It is separated out from TargetLowering because it 244 // initializers. It is separated out from TargetLowering because it
244 // does not require a Cfg. 245 // does not require a Cfg.
245 class TargetGlobalInitLowering { 246 class TargetGlobalInitLowering {
246 public: 247 public:
247 static TargetGlobalInitLowering *createLowering(TargetArch Target, 248 static TargetGlobalInitLowering *createLowering(TargetArch Target,
248 GlobalContext *Ctx); 249 GlobalContext *Ctx);
249 virtual ~TargetGlobalInitLowering(); 250 virtual ~TargetGlobalInitLowering();
250 251
251 // TODO: Allow relocations to be represented as part of the Data. 252 virtual void lower(const GlobalAddress &Addr, bool DisableTranslation) = 0;
252 virtual void lower(const IceString &Name, SizeT Align, bool IsInternal,
253 bool IsConst, bool IsZeroInitializer, SizeT Size,
254 const char *Data, bool DisableTranslation) = 0;
255 253
256 protected: 254 protected:
257 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} 255 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
258 GlobalContext *Ctx; 256 GlobalContext *Ctx;
259 257
260 private: 258 private:
261 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete; 259 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete;
262 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) = 260 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) =
263 delete; 261 delete;
264 }; 262 };
265 263
266 } // end of namespace Ice 264 } // end of namespace Ice
267 265
268 #endif // SUBZERO_SRC_ICETARGETLOWERING_H 266 #endif // SUBZERO_SRC_ICETARGETLOWERING_H
OLDNEW
« no previous file with comments | « src/IceGlobalInits.cpp ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698