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

Side by Side Diff: src/IceTargetLoweringMIPS32.h

Issue 1171563002: Subzero: Emit ARM build-attributes in the file scope (as header). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: use class final, fix for mips32 Created 5 years, 6 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/IceTargetLoweringARM32.cpp ('k') | src/IceTargetLoweringMIPS32.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/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- 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 TargetLoweringMIPS32 class, which implements the 10 // This file declares the TargetLoweringMIPS32 class, which implements the
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 size_t typeWidthInBytesOnStack(Type Ty) const override { 50 size_t typeWidthInBytesOnStack(Type Ty) const override {
51 // Round up to the next multiple of 4 bytes. In particular, i1, 51 // Round up to the next multiple of 4 bytes. In particular, i1,
52 // i8, and i16 are rounded up to 4 bytes. 52 // i8, and i16 are rounded up to 4 bytes.
53 return (typeWidthInBytes(Ty) + 3) & ~3; 53 return (typeWidthInBytes(Ty) + 3) & ~3;
54 } 54 }
55 void emitVariable(const Variable *Var) const override; 55 void emitVariable(const Variable *Var) const override;
56 56
57 const char *getConstantPrefix() const final { return ""; } 57 const char *getConstantPrefix() const final { return ""; }
58 void emit(const ConstantUndef *C) const final { 58 void emit(const ConstantUndef *C) const final {
59 (void)C;
59 llvm::report_fatal_error("Not yet implemented"); 60 llvm::report_fatal_error("Not yet implemented");
60 } 61 }
61 void emit(const ConstantInteger32 *C) const final { 62 void emit(const ConstantInteger32 *C) const final {
63 (void)C;
62 llvm::report_fatal_error("Not yet implemented"); 64 llvm::report_fatal_error("Not yet implemented");
63 } 65 }
64 void emit(const ConstantInteger64 *C) const final { 66 void emit(const ConstantInteger64 *C) const final {
67 (void)C;
65 llvm::report_fatal_error("Not yet implemented"); 68 llvm::report_fatal_error("Not yet implemented");
66 } 69 }
67 void emit(const ConstantFloat *C) const final { 70 void emit(const ConstantFloat *C) const final {
71 (void)C;
68 llvm::report_fatal_error("Not yet implemented"); 72 llvm::report_fatal_error("Not yet implemented");
69 } 73 }
70 void emit(const ConstantDouble *C) const final { 74 void emit(const ConstantDouble *C) const final {
75 (void)C;
71 llvm::report_fatal_error("Not yet implemented"); 76 llvm::report_fatal_error("Not yet implemented");
72 } 77 }
73 78
74 void lowerArguments() override; 79 void lowerArguments() override;
75 void addProlog(CfgNode *Node) override; 80 void addProlog(CfgNode *Node) override;
76 void addEpilog(CfgNode *Node) override; 81 void addEpilog(CfgNode *Node) override;
77 82
78 protected: 83 protected:
79 explicit TargetMIPS32(Cfg *Func); 84 explicit TargetMIPS32(Cfg *Func);
80 85
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 private: 126 private:
122 ~TargetMIPS32() override {} 127 ~TargetMIPS32() override {}
123 }; 128 };
124 129
125 class TargetDataMIPS32 : public TargetDataLowering { 130 class TargetDataMIPS32 : public TargetDataLowering {
126 TargetDataMIPS32() = delete; 131 TargetDataMIPS32() = delete;
127 TargetDataMIPS32(const TargetDataMIPS32 &) = delete; 132 TargetDataMIPS32(const TargetDataMIPS32 &) = delete;
128 TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete; 133 TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete;
129 134
130 public: 135 public:
131 static TargetDataLowering *create(GlobalContext *Ctx) { 136 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) {
132 return new TargetDataMIPS32(Ctx); 137 return std::unique_ptr<TargetDataLowering>(new TargetDataMIPS32(Ctx));
133 } 138 }
134 139
135 void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const final; 140 void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const final;
136 void lowerConstants() const final; 141 void lowerConstants() const final;
137 142
138 protected: 143 protected:
139 explicit TargetDataMIPS32(GlobalContext *Ctx); 144 explicit TargetDataMIPS32(GlobalContext *Ctx);
140 145
141 private: 146 private:
142 void lowerGlobal(const VariableDeclaration &Var) const; 147 void lowerGlobal(const VariableDeclaration &Var) const;
143 ~TargetDataMIPS32() override {} 148 ~TargetDataMIPS32() override {}
144 template <typename T> static void emitConstantPool(GlobalContext *Ctx); 149 template <typename T> static void emitConstantPool(GlobalContext *Ctx);
145 }; 150 };
146 151
152 class TargetHeaderMIPS32 final : public TargetHeaderLowering {
jvoung (off chromium) 2015/06/11 22:12:32 added the mips variant without overrides to keep t
153 TargetHeaderMIPS32() = delete;
154 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete;
155 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete;
156
157 public:
158 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) {
159 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx));
160 }
161
162 protected:
163 explicit TargetHeaderMIPS32(GlobalContext *Ctx);
164
165 private:
166 ~TargetHeaderMIPS32() = default;
167 };
168
147 } // end of namespace Ice 169 } // end of namespace Ice
148 170
149 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 171 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringARM32.cpp ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698