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

Side by Side Diff: src/IceTranslator.h

Issue 361733002: Update Subzero to start parsing PNaCl bitcode files. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix issues raised by Jan in patch set 1. Created 6 years, 5 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
(Empty)
1 //===- subzero/src/IceTranslator.h - Translate IR to ICE --------*- C++ -*-===//
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the general driver class for translating IR to ICE.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SUBZERO_SRC_ICETRANSLATOR_H
15 #define SUBZERO_SRC_ICETRANSLATOR_H
16
17 #include "llvm/ADT/OwningPtr.h"
18
19 namespace Ice {
20
21 class ClFlags;
22 class Cfg;
23 class GlobalContext;
24
25 // Base class for translating ICE to machine code.
26 // Derived classes convert other intermediate representations downto ICE,
jvoung (off chromium) 2014/07/02 17:00:15 down to ICE
Karl 2014/07/02 18:09:54 Done.
27 // and then call the appropriate (inherited) methods to convert ICE into
28 // machine instructions.
29 class Translator {
30 public:
31 Translator(GlobalContext *Ctx, ClFlags &Flags)
32 : Ctx(Ctx), Flags(Flags), ExitStatus(0) {}
33
34 ~Translator();
35
36 protected:
37 GlobalContext *Ctx;
38 ClFlags &Flags;
39 // The exit status of the translation. 0 is successful. Nonzero
40 // otherwise.
41 int ExitStatus;
42 // Ideally, Func would be inside the methods that converts IR to
43 // functions. However, emitting the constant pool requires a valid
44 // Cfg object, so we need to defer deleting the last non-empty Cfg
45 // object to emit the constant pool (via emitConstants). TODO:
46 // Since all constants are globally pooled in the Ice::GlobalContext
47 // object, change all Ice::Constant related functions to use
48 // GlobalContext instead of Cfg, and then make emitConstantPool use
49 // that.
50 llvm::OwningPtr<Ice::Cfg> Func;
51
52 /// Translates the constructed ICE function Fcn to machine code.
53 /// Note: As a side effect, Field Func is set to Fcn.
54 void translateFcn(Ice::Cfg *Fcn);
55
56 /// Emits the constant pool.
57 void emitConstants();
58 };
59 }
60
61 #endif // SUBZERO_SRC_ICETRANSLATOR_H
OLDNEW
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceTranslator.cpp » ('j') | src/IceTranslator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698