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

Side by Side Diff: lib/Target/X86/MCTargetDesc/X86MCNaClExpander.h

Issue 1274223003: Auto-sandboxing: Switch to automatic scratch register invalidation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: add flag to tests Created 5 years, 4 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 //===- X86MCNaClExpander.h --------------------------------------*- C++ -*-===// 1 //===- X86MCNaClExpander.h --------------------------------------*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
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 X86MCNaClExpander class, the X86 specific 10 // This file declares the X86MCNaClExpander class, the X86 specific
(...skipping 16 matching lines...) Expand all
27 27
28 namespace X86 { 28 namespace X86 {
29 class X86MCNaClExpander : public MCNaClExpander { 29 class X86MCNaClExpander : public MCNaClExpander {
30 public: 30 public:
31 X86MCNaClExpander(const MCContext &Ctx, std::unique_ptr<MCRegisterInfo> &&RI, 31 X86MCNaClExpander(const MCContext &Ctx, std::unique_ptr<MCRegisterInfo> &&RI,
32 std::unique_ptr<MCInstrInfo> &&II, bool Is64Bit) 32 std::unique_ptr<MCInstrInfo> &&II, bool Is64Bit)
33 : MCNaClExpander(Ctx, std::move(RI), std::move(II)), Is64Bit(Is64Bit) {} 33 : MCNaClExpander(Ctx, std::move(RI), std::move(II)), Is64Bit(Is64Bit) {}
34 34
35 bool expandInst(const MCInst &Inst, MCStreamer &Out, 35 bool expandInst(const MCInst &Inst, MCStreamer &Out,
36 const MCSubtargetInfo &STI) override; 36 const MCSubtargetInfo &STI) override;
37 protected:
38 bool isValidScratchRegister(unsigned Reg) const override;
39
37 private: 40 private:
38 bool Guard = false; // recursion guard 41 bool Guard = false; // recursion guard
39 bool Is64Bit = false; 42 bool Is64Bit = false;
40 SmallVector<MCInst, 4> Prefixes; 43 SmallVector<MCInst, 4> Prefixes;
41 44
42 void emitPrefixes(MCStreamer &Out, const MCSubtargetInfo &STI); 45 void emitPrefixes(MCStreamer &Out, const MCSubtargetInfo &STI);
43 46
44 void expandIndirectBranch(const MCInst &Inst, MCStreamer &Out, 47 void expandIndirectBranch(const MCInst &Inst, MCStreamer &Out,
45 const MCSubtargetInfo &STI); 48 const MCSubtargetInfo &STI);
46 49
(...skipping 26 matching lines...) Expand all
73 void emitSandboxBranchReg(unsigned Reg, MCStreamer &Out, 76 void emitSandboxBranchReg(unsigned Reg, MCStreamer &Out,
74 const MCSubtargetInfo &STI); 77 const MCSubtargetInfo &STI);
75 void emitIndirectJumpReg(unsigned Reg, MCStreamer &Out, 78 void emitIndirectJumpReg(unsigned Reg, MCStreamer &Out,
76 const MCSubtargetInfo &STI); 79 const MCSubtargetInfo &STI);
77 void emitIndirectCallReg(unsigned Reg, MCStreamer &Out, 80 void emitIndirectCallReg(unsigned Reg, MCStreamer &Out,
78 const MCSubtargetInfo &STI); 81 const MCSubtargetInfo &STI);
79 }; 82 };
80 } 83 }
81 } 84 }
82 #endif 85 #endif
OLDNEW
« no previous file with comments | « lib/Target/ARM/MCTargetDesc/ARMMCNaClExpander.cpp ('k') | lib/Target/X86/MCTargetDesc/X86MCNaClExpander.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698