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

Side by Side Diff: src/IceTargetLoweringX8632.h

Issue 1217443024: Changes the TargetX8632 to inherit from TargetX86Base<TargetX8632>. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: s/Func-> /Func->/g (no functional changes) 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
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 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 /// \file 10 /// \file
11 /// This file declares the TargetLoweringX8632 class, which 11 /// This file declares the TargetLoweringX8632 class, which
12 /// implements the TargetLowering interface for the x86-32 12 /// implements the TargetLowering interface for the x86-32
13 /// architecture. 13 /// architecture.
14 /// 14 ///
15 //===----------------------------------------------------------------------===// 15 //===----------------------------------------------------------------------===//
16 16
17 #ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632_H 17 #ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632_H
18 #define SUBZERO_SRC_ICETARGETLOWERINGX8632_H 18 #define SUBZERO_SRC_ICETARGETLOWERINGX8632_H
19 19
20 #include "IceAssemblerX8632.h" 20 #include "IceAssemblerX8632.h"
21 #include "IceDefs.h" 21 #include "IceDefs.h"
22 #include "IceInstX8632.h" 22 #include "IceInstX8632.h"
23 #include "IceRegistersX8632.h" 23 #include "IceRegistersX8632.h"
24 #include "IceTargetLowering.h" 24 #include "IceTargetLowering.h"
25 #include "IceTargetLoweringX8632Traits.h" 25 #include "IceTargetLoweringX8632Traits.h"
26 #include "IceTargetLoweringX86Base.h"
26 27
27 namespace Ice { 28 namespace Ice {
28 29
29 class TargetX8632 : public TargetLowering { 30 class TargetX8632 final
31 : public ::Ice::X86Internal::TargetX86Base<TargetX8632> {
30 TargetX8632() = delete; 32 TargetX8632() = delete;
31 TargetX8632(const TargetX8632 &) = delete; 33 TargetX8632(const TargetX8632 &) = delete;
32 TargetX8632 &operator=(const TargetX8632 &) = delete; 34 TargetX8632 &operator=(const TargetX8632 &) = delete;
33 35
34 public: 36 public:
35 using X86InstructionSet = X8632::Traits::InstructionSet; 37 using X86InstructionSet = X8632::Traits::InstructionSet;
36 38
37 static TargetX8632 *create(Cfg *Func); 39 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); }
38 virtual X8632::Traits::Address
39 stackVarToAsmOperand(const Variable *Var) const = 0;
40 virtual X86InstructionSet getInstructionSet() const = 0;
41 40
42 protected: 41 protected:
43 explicit TargetX8632(Cfg *Func) : TargetLowering(Func) {} 42 Operand *createNaClReadTPSrcOperand() {
43 Constant *Zero = Ctx->getConstantZero(IceType_i32);
44 return Traits::X86OperandMem::create(Func, IceType_i32, nullptr, Zero,
jvoung (off chromium) 2015/07/08 18:50:11 So the X8664 version would be something like: Cre
John 2015/07/08 21:44:41 I don't know, yet -- mostly because I don't know h
45 nullptr, 0,
46 Traits::X86OperandMem::SegReg_GS);
47 }
48
49 private:
50 friend class ::Ice::X86Internal::TargetX86Base<TargetX8632>;
jvoung (off chromium) 2015/07/08 18:50:11 So this is to allow the parent dispatch to methods
John 2015/07/08 21:44:41 Yes, exactly. Or we could make those methods publi
51
52 explicit TargetX8632(Cfg *Func) : TargetX86Base(Func) {}
44 }; 53 };
45 54
46 class TargetDataX8632 final : public TargetDataLowering { 55 class TargetDataX8632 final : public TargetDataLowering {
47 TargetDataX8632() = delete; 56 TargetDataX8632() = delete;
48 TargetDataX8632(const TargetDataX8632 &) = delete; 57 TargetDataX8632(const TargetDataX8632 &) = delete;
49 TargetDataX8632 &operator=(const TargetDataX8632 &) = delete; 58 TargetDataX8632 &operator=(const TargetDataX8632 &) = delete;
50 59
51 public: 60 public:
52 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) { 61 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) {
53 return std::unique_ptr<TargetDataLowering>(new TargetDataX8632(Ctx)); 62 return std::unique_ptr<TargetDataLowering>(new TargetDataX8632(Ctx));
(...skipping 24 matching lines...) Expand all
78 protected: 87 protected:
79 explicit TargetHeaderX8632(GlobalContext *Ctx); 88 explicit TargetHeaderX8632(GlobalContext *Ctx);
80 89
81 private: 90 private:
82 ~TargetHeaderX8632() = default; 91 ~TargetHeaderX8632() = default;
83 }; 92 };
84 93
85 } // end of namespace Ice 94 } // end of namespace Ice
86 95
87 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H 96 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698