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

Side by Side Diff: src/IceTypes.h

Issue 625243002: Convert Subzero's bitcode reader to generate ICE types. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix comment. 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 | « no previous file | src/IceTypes.cpp » ('j') | src/PNaClTranslator.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- C++ -*-===// 1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- 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 a few properties of the primitive types allowed 10 // This file declares a few properties of the primitive types allowed
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 assert(result || Ty == IceType_f64); 96 assert(result || Ty == IceType_f64);
97 return result; 97 return result;
98 } 98 }
99 99
100 template <typename StreamType> 100 template <typename StreamType>
101 inline StreamType &operator<<(StreamType &Str, const Type &Ty) { 101 inline StreamType &operator<<(StreamType &Str, const Type &Ty) {
102 Str << typeString(Ty); 102 Str << typeString(Ty);
103 return Str; 103 return Str;
104 } 104 }
105 105
106 /// Models a type signature for a function.
Jim Stichnoth 2014/10/05 15:35:47 IceIntrinsics uses something similar to this for i
Karl 2014/10/06 21:15:54 After looking at this some more, it appears that w
107 class FcnSigType {
Jim Stichnoth 2014/10/05 15:35:47 A little bikeshedding here... Most of the code bas
Karl 2014/10/06 21:15:54 Renamed to FuncSigType.
108 FcnSigType(const FcnSigType&) = delete;
109 FcnSigType &operator=(const FcnSigType&) = delete;
110 public:
111 typedef std::vector<Type> ArgListType;
112
113 // Creates a function signature type with the given return type.
114 // Parameter types should be added using calls to appendArgType.
115 explicit FcnSigType(Ice::Type ReturnType) : ReturnType(ReturnType) {}
Jim Stichnoth 2014/10/05 15:35:47 drop the Ice::
Karl 2014/10/06 21:15:54 Done.
116
117 void appendArgType(Type ArgType) { ArgList.push_back(ArgType); }
118
119 Type getReturnType() const { return ReturnType; }
120 SizeT getNumArgs() const { return ArgList.size(); }
121 Type getArgType(SizeT Index) const {
122 assert(Index < ArgList.size());
123 return ArgList[Index];
124 }
125 const ArgListType &getArgList() const { return ArgList; }
126 void Print(Ostream &Stream) const;
Jim Stichnoth 2014/10/05 15:35:47 For consistency with the other dump routines: v
Karl 2014/10/06 21:15:54 Done.
127
128 private:
129 // The return type.
130 Type ReturnType;
131 // The list of parameters.
132 ArgListType ArgList;
133 };
134
135 inline Ostream &operator<<(Ostream &Stream, const FcnSigType &Sig) {
136 Sig.Print(Stream);
137 return Stream;
138 }
139
106 } // end of namespace Ice 140 } // end of namespace Ice
107 141
108 #endif // SUBZERO_SRC_ICETYPES_H 142 #endif // SUBZERO_SRC_ICETYPES_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTypes.cpp » ('j') | src/PNaClTranslator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698