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

Side by Side Diff: src/IceGlobalInits.h

Issue 1197863003: Subzero: Reduce the amount of #ifdef'd code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 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
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceGlobalInits.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/IceGlobalInits.h - Global declarations -------*- C++ -*-===// 1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- 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 representation of function declarations, 10 // This file declares the representation of function declarations,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 Linkage = NewLinkage; 59 Linkage = NewLinkage;
60 } 60 }
61 virtual ~GlobalDeclaration() = default; 61 virtual ~GlobalDeclaration() = default;
62 62
63 /// Prints out type of the global declaration. 63 /// Prints out type of the global declaration.
64 virtual void dumpType(Ostream &Stream) const = 0; 64 virtual void dumpType(Ostream &Stream) const = 0;
65 65
66 /// Prints out the global declaration. 66 /// Prints out the global declaration.
67 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; 67 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0;
68 void dump(Ostream &Stream) const { 68 void dump(Ostream &Stream) const {
69 if (!ALLOW_DUMP) 69 if (!BuildDefs::dump())
70 return; 70 return;
71 GlobalContext *const Ctx = nullptr; 71 GlobalContext *const Ctx = nullptr;
72 dump(Ctx, Stream); 72 dump(Ctx, Stream);
73 } 73 }
74 74
75 /// Returns true if when emitting names, we should suppress mangling. 75 /// Returns true if when emitting names, we should suppress mangling.
76 virtual bool getSuppressMangling() const = 0; 76 virtual bool getSuppressMangling() const = 0;
77 77
78 // Mangles name for cross tests, unless external and not defined locally 78 // Mangles name for cross tests, unless external and not defined locally
79 // (so that relocations accross pnacl-sz and pnacl-llc will work). 79 // (so that relocations accross pnacl-sz and pnacl-llc will work).
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 enum InitializerKind { 146 enum InitializerKind {
147 DataInitializerKind, 147 DataInitializerKind,
148 ZeroInitializerKind, 148 ZeroInitializerKind,
149 RelocInitializerKind 149 RelocInitializerKind
150 }; 150 };
151 InitializerKind getKind() const { return Kind; } 151 InitializerKind getKind() const { return Kind; }
152 virtual ~Initializer() = default; 152 virtual ~Initializer() = default;
153 virtual SizeT getNumBytes() const = 0; 153 virtual SizeT getNumBytes() const = 0;
154 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; 154 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0;
155 void dump(Ostream &Stream) const { 155 void dump(Ostream &Stream) const {
156 if (ALLOW_DUMP) 156 if (BuildDefs::dump())
157 dump(nullptr, Stream); 157 dump(nullptr, Stream);
158 } 158 }
159 virtual void dumpType(Ostream &Stream) const; 159 virtual void dumpType(Ostream &Stream) const;
160 160
161 protected: 161 protected:
162 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} 162 explicit Initializer(InitializerKind Kind) : Kind(Kind) {}
163 163
164 private: 164 private:
165 const InitializerKind Kind; 165 const InitializerKind Kind;
166 }; 166 };
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 template <class StreamType> 347 template <class StreamType>
348 inline StreamType &operator<<(StreamType &Stream, 348 inline StreamType &operator<<(StreamType &Stream,
349 const GlobalDeclaration &Addr) { 349 const GlobalDeclaration &Addr) {
350 Addr.dump(Stream); 350 Addr.dump(Stream);
351 return Stream; 351 return Stream;
352 } 352 }
353 353
354 } // end of namespace Ice 354 } // end of namespace Ice
355 355
356 #endif // SUBZERO_SRC_ICEGLOBALINITS_H 356 #endif // SUBZERO_SRC_ICEGLOBALINITS_H
OLDNEW
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceGlobalInits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698