about summary refs log tree commit diff homepage
path: root/lib/Module/Passes.h
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2018-05-12 19:49:07 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-05-22 16:24:46 +0100
commit45dbf0624f6fe37d25ba401c2bf99b8315f8847b (patch)
tree94ebd15744b8ee84e1735f657774e5e1d1d862c0 /lib/Module/Passes.h
parent1b8bad9dda673f1340b50c39334eb92ee8a8c306 (diff)
downloadklee-45dbf0624f6fe37d25ba401c2bf99b8315f8847b.tar.gz
some housekeeping in Passes.h and IntrinsicCleaner.cpp
This commit addresses the following:

  * remove unused variables block_split (::runOnBasicBlock)
    and LI (::IntrinsicCleanerPass) in IntrinsicCleanerPass

  * add `dirty = true` to `Intrinsic::vacopy` case

  * use `eraseFromParent()` methods instead of `removeFromParent()` and `delete`

  * add `override` keyword to `runOn{Module,Function}` methods
Diffstat (limited to 'lib/Module/Passes.h')
-rw-r--r--lib/Module/Passes.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/Module/Passes.h b/lib/Module/Passes.h
index 88c0ce8c..e6fa18ce 100644
--- a/lib/Module/Passes.h
+++ b/lib/Module/Passes.h
@@ -49,8 +49,8 @@ class RaiseAsmPass : public llvm::ModulePass {
 
 public:
   RaiseAsmPass() : llvm::ModulePass(ID), TLI(0) {}
-  
-  virtual bool runOnModule(llvm::Module &M);
+
+  bool runOnModule(llvm::Module &M) override;
 };
 
   // This is a module pass because it can add and delete module
@@ -62,12 +62,12 @@ class IntrinsicCleanerPass : public llvm::ModulePass {
 
   bool runOnBasicBlock(llvm::BasicBlock &b, llvm::Module &M);
 public:
-  IntrinsicCleanerPass(const llvm::DataLayout &TD, bool LI = true)
+  IntrinsicCleanerPass(const llvm::DataLayout &TD)
       : llvm::ModulePass(ID), DataLayout(TD),
         IL(new llvm::IntrinsicLowering(TD)) {}
   ~IntrinsicCleanerPass() { delete IL; } 
   
-  virtual bool runOnModule(llvm::Module &M);
+  bool runOnModule(llvm::Module &M) override;
 };
   
   // performs two transformations which make interpretation
@@ -87,15 +87,15 @@ class PhiCleanerPass : public llvm::FunctionPass {
 
 public:
   PhiCleanerPass() : llvm::FunctionPass(ID) {}
-  
-  virtual bool runOnFunction(llvm::Function &f);
+
+  bool runOnFunction(llvm::Function &f) override;
 };
   
 class DivCheckPass : public llvm::ModulePass {
   static char ID;
 public:
   DivCheckPass(): ModulePass(ID) {}
-  virtual bool runOnModule(llvm::Module &M);
+  bool runOnModule(llvm::Module &M) override;
 };
 
 /// This pass injects checks to check for overshifting.
@@ -116,7 +116,7 @@ class OvershiftCheckPass : public llvm::ModulePass {
   static char ID;
 public:
   OvershiftCheckPass(): ModulePass(ID) {}
-  virtual bool runOnModule(llvm::Module &M);
+  bool runOnModule(llvm::Module &M) override;
 };
 
 /// LowerSwitchPass - Replace all SwitchInst instructions with chained branch
@@ -125,10 +125,10 @@ public:
 class LowerSwitchPass : public llvm::FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
-  LowerSwitchPass() : FunctionPass(ID) {} 
-  
-  virtual bool runOnFunction(llvm::Function &F);
-  
+  LowerSwitchPass() : FunctionPass(ID) {}
+
+  bool runOnFunction(llvm::Function &F) override;
+
   struct SwitchCase {
     llvm ::Constant *value;
     llvm::BasicBlock *block;
@@ -170,8 +170,7 @@ public:
   static char ID;
   InstructionOperandTypeCheckPass()
       : llvm::ModulePass(ID), instructionOperandsConform(true) {}
-  // TODO: Add `override` when we switch to C++11
-  bool runOnModule(llvm::Module &M);
+  bool runOnModule(llvm::Module &M) override;
   bool checkPassed() const { return instructionOperandsConform; }
 };
 }