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

Unified Diff: include/llvm/MC/MCNaClExpander.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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/MC/MCNaClExpander.cpp » ('j') | lib/Target/ARM/MCTargetDesc/ARMMCNaClExpander.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/MC/MCNaClExpander.h
diff --git a/include/llvm/MC/MCNaClExpander.h b/include/llvm/MC/MCNaClExpander.h
index f797e62005659eb66db83fc2ea42d3f9b8337344..5bab202523974c9855451cdeec5cb20a8f792d4e 100644
--- a/include/llvm/MC/MCNaClExpander.h
+++ b/include/llvm/MC/MCNaClExpander.h
@@ -34,6 +34,10 @@ private:
protected:
std::unique_ptr<MCInstrInfo> InstInfo;
std::unique_ptr<MCRegisterInfo> RegInfo;
+ void invalidateScratchRegs(const MCInst &Inst);
+ unsigned getScratchReg(int index);
+ unsigned numScratchRegs() const;
+ virtual bool isValidScratchRegister(unsigned Reg) const = 0;
public:
MCNaClExpander(const MCContext &Ctx, std::unique_ptr<MCRegisterInfo> &&RI,
@@ -42,10 +46,8 @@ public:
void Error(const MCInst &Inst, const char msg[]);
- void pushScratchReg(unsigned Reg);
- unsigned popScratchReg();
- unsigned getScratchReg(int index);
- unsigned numScratchRegs() const;
+ bool addScratchReg(unsigned Reg);
+ void clearScratchRegs();
bool isPseudo(const MCInst &Inst) const;
« no previous file with comments | « no previous file | lib/MC/MCNaClExpander.cpp » ('j') | lib/Target/ARM/MCTargetDesc/ARMMCNaClExpander.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698