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

Side by Side Diff: src/IceTranslator.h

Issue 567703003: Allow ability to name unnamed global addresses in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits in patch set 4. Created 6 years, 3 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/IceConverter.cpp ('k') | src/IceTranslator.cpp » ('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/IceTranslator.h - ICE to machine code --------*- C++ -*-===// 1 //===- subzero/src/IceTranslator.h - ICE to machine code --------*- 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 general driver class for translating ICE to 10 // This file declares the general driver class for translating ICE to
11 // machine code. 11 // machine code.
12 // 12 //
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #ifndef SUBZERO_SRC_ICETRANSLATOR_H 15 #ifndef SUBZERO_SRC_ICETRANSLATOR_H
16 #define SUBZERO_SRC_ICETRANSLATOR_H 16 #define SUBZERO_SRC_ICETRANSLATOR_H
17 17
18 #include "llvm/ADT/OwningPtr.h" 18 #include "llvm/ADT/OwningPtr.h"
19 19
20 namespace llvm {
21 class Module;
22 }
23
20 namespace Ice { 24 namespace Ice {
21 25
22 class ClFlags; 26 class ClFlags;
23 class Cfg; 27 class Cfg;
24 class GlobalContext; 28 class GlobalContext;
25 29
26 // Base class for translating ICE to machine code. 30 // Base class for translating ICE to machine code.
27 // Derived classes convert other intermediate representations down to ICE, 31 // Derived classes convert other intermediate representations down to ICE,
28 // and then call the appropriate (inherited) methods to convert ICE into 32 // and then call the appropriate (inherited) methods to convert ICE into
29 // machine instructions. 33 // machine instructions.
(...skipping 10 matching lines...) Expand all
40 const ClFlags &getFlags() const { return Flags; } 44 const ClFlags &getFlags() const { return Flags; }
41 45
42 /// Translates the constructed ICE function Fcn to machine code. 46 /// Translates the constructed ICE function Fcn to machine code.
43 /// Takes ownership of Fcn. Note: As a side effect, Field Func is 47 /// Takes ownership of Fcn. Note: As a side effect, Field Func is
44 /// set to Fcn. 48 /// set to Fcn.
45 void translateFcn(Cfg *Fcn); 49 void translateFcn(Cfg *Fcn);
46 50
47 /// Emits the constant pool. 51 /// Emits the constant pool.
48 void emitConstants(); 52 void emitConstants();
49 53
54 // Walks module and generates names for unnamed globals and
55 // functions using prefix getFlags().DefaultGlobalPrefix, if the
56 // prefix is non-empty.
57 void nameUnnamedGlobalAddresses(llvm::Module *Mod);
58
50 protected: 59 protected:
51 GlobalContext *Ctx; 60 GlobalContext *Ctx;
52 const ClFlags &Flags; 61 const ClFlags &Flags;
53 // The exit status of the translation. False is successful. True 62 // The exit status of the translation. False is successful. True
54 // otherwise. 63 // otherwise.
55 bool ErrorStatus; 64 bool ErrorStatus;
56 // Ideally, Func would be inside the methods that converts IR to 65 // Ideally, Func would be inside the methods that converts IR to
57 // functions. However, emitting the constant pool requires a valid 66 // functions. However, emitting the constant pool requires a valid
58 // Cfg object, so we need to defer deleting the last non-empty Cfg 67 // Cfg object, so we need to defer deleting the last non-empty Cfg
59 // object to emit the constant pool (via emitConstants). TODO: 68 // object to emit the constant pool (via emitConstants). TODO:
60 // Since all constants are globally pooled in the GlobalContext 69 // Since all constants are globally pooled in the GlobalContext
61 // object, change all Constant related functions to use 70 // object, change all Constant related functions to use
62 // GlobalContext instead of Cfg, and then make emitConstantPool use 71 // GlobalContext instead of Cfg, and then make emitConstantPool use
63 // that. 72 // that.
64 llvm::OwningPtr<Cfg> Func; 73 llvm::OwningPtr<Cfg> Func;
65 74
66 private: 75 private:
67 Translator(const Translator &) LLVM_DELETED_FUNCTION; 76 Translator(const Translator &) LLVM_DELETED_FUNCTION;
68 Translator &operator=(const Translator &) LLVM_DELETED_FUNCTION; 77 Translator &operator=(const Translator &) LLVM_DELETED_FUNCTION;
69 }; 78 };
70 } 79 }
71 80
72 #endif // SUBZERO_SRC_ICETRANSLATOR_H 81 #endif // SUBZERO_SRC_ICETRANSLATOR_H
OLDNEW
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698