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

Side by Side Diff: src/IceTargetLowering.h

Issue 641193002: Introduce the notion of function addresses in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clean up code and 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
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 class GlobalVariable;
31 31
32 // LoweringContext makes it easy to iterate through non-deleted 32 // LoweringContext makes it easy to iterate through non-deleted
33 // instructions in a node, and insert new (lowered) instructions at 33 // instructions in a node, and insert new (lowered) instructions at
34 // the current point. Along with the instruction list container and 34 // the current point. Along with the instruction list container and
35 // associated iterators, it holds the current node, which is needed 35 // associated iterators, it holds the current node, which is needed
36 // when inserting new instructions in order to track whether variables 36 // when inserting new instructions in order to track whether variables
37 // are used as single-block or multi-block. 37 // are used as single-block or multi-block.
38 class LoweringContext { 38 class LoweringContext {
39 public: 39 public:
40 LoweringContext() : Node(NULL) {} 40 LoweringContext() : Node(NULL) {}
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 // TargetGlobalInitLowering is used for "lowering" global 243 // TargetGlobalInitLowering is used for "lowering" global
244 // initializers. It is separated out from TargetLowering because it 244 // initializers. It is separated out from TargetLowering because it
245 // does not require a Cfg. 245 // does not require a Cfg.
246 class TargetGlobalInitLowering { 246 class TargetGlobalInitLowering {
247 public: 247 public:
248 static TargetGlobalInitLowering *createLowering(TargetArch Target, 248 static TargetGlobalInitLowering *createLowering(TargetArch Target,
249 GlobalContext *Ctx); 249 GlobalContext *Ctx);
250 virtual ~TargetGlobalInitLowering(); 250 virtual ~TargetGlobalInitLowering();
251 251
252 virtual void lower(const GlobalAddress &Addr, bool DisableTranslation) = 0; 252 virtual void lower(const GlobalVariable &Vbl, bool DisableTranslation) = 0;
jvoung (off chromium) 2014/10/10 01:47:28 nit: How about "Var" instead of "Vbl"?
Karl 2014/10/10 20:17:30 Done.
253 253
254 protected: 254 protected:
255 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} 255 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
256 GlobalContext *Ctx; 256 GlobalContext *Ctx;
257 257
258 private: 258 private:
259 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete; 259 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete;
260 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) = 260 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) =
261 delete; 261 delete;
262 }; 262 };
263 263
264 } // end of namespace Ice 264 } // end of namespace Ice
265 265
266 #endif // SUBZERO_SRC_ICETARGETLOWERING_H 266 #endif // SUBZERO_SRC_ICETARGETLOWERING_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698