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

Side by Side Diff: include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 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 //===- PNaClABIVerifyFunctions.h - Verify PNaCl ABI rules -----------------===// 1 //===- PNaClABIVerifyFunctions.h - Verify PNaCl ABI rules -----------------===//
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 // Verify function-level PNaCl ABI requirements. 10 // Verify function-level PNaCl ABI requirements.
(...skipping 10 matching lines...) Expand all
21 #include "llvm/IR/DataLayout.h" 21 #include "llvm/IR/DataLayout.h"
22 #include "llvm/IR/Module.h" 22 #include "llvm/IR/Module.h"
23 #include "llvm/IR/NaClAtomicIntrinsics.h" 23 #include "llvm/IR/NaClAtomicIntrinsics.h"
24 #include "llvm/Pass.h" 24 #include "llvm/Pass.h"
25 25
26 namespace llvm { 26 namespace llvm {
27 27
28 // Checks that examine anything in the function body should be in 28 // Checks that examine anything in the function body should be in
29 // FunctionPasses to make them streaming-friendly. 29 // FunctionPasses to make them streaming-friendly.
30 class PNaClABIVerifyFunctions : public FunctionPass { 30 class PNaClABIVerifyFunctions : public FunctionPass {
31 PNaClABIVerifyFunctions(const PNaClABIVerifyFunctions&) LLVM_DELETED_FUNCTION; 31 PNaClABIVerifyFunctions(const PNaClABIVerifyFunctions&) = delete;
32 void operator=(const PNaClABIVerifyFunctions&) LLVM_DELETED_FUNCTION; 32 void operator=(const PNaClABIVerifyFunctions&) = delete;
33 public: 33 public:
34 static char ID; 34 static char ID;
35 PNaClABIVerifyFunctions() : 35 PNaClABIVerifyFunctions() :
36 FunctionPass(ID), 36 FunctionPass(ID),
37 Reporter(new PNaClABIErrorReporter), 37 Reporter(new PNaClABIErrorReporter),
38 ReporterIsOwned(true) { 38 ReporterIsOwned(true) {
39 initializePNaClABIVerifyFunctionsPass(*PassRegistry::getPassRegistry()); 39 initializePNaClABIVerifyFunctionsPass(*PassRegistry::getPassRegistry());
40 } 40 }
41 explicit PNaClABIVerifyFunctions(PNaClABIErrorReporter *Reporter_) : 41 explicit PNaClABIVerifyFunctions(PNaClABIErrorReporter *Reporter_) :
42 FunctionPass(ID), 42 FunctionPass(ID),
43 Reporter(Reporter_), 43 Reporter(Reporter_),
44 ReporterIsOwned(false) { 44 ReporterIsOwned(false) {
45 initializePNaClABIVerifyFunctionsPass(*PassRegistry::getPassRegistry()); 45 initializePNaClABIVerifyFunctionsPass(*PassRegistry::getPassRegistry());
46 } 46 }
47 virtual ~PNaClABIVerifyFunctions(); 47 virtual ~PNaClABIVerifyFunctions();
48 virtual bool doInitialization(Module &M) { 48 virtual bool doInitialization(Module &M) {
49 AtomicIntrinsics.reset(new NaCl::AtomicIntrinsics(M.getContext())); 49 AtomicIntrinsics.reset(new NaCl::AtomicIntrinsics(M.getContext()));
50 return false; 50 return false;
51 } 51 }
52 virtual void getAnalysisUsage(AnalysisUsage &Info) const { 52 virtual void getAnalysisUsage(AnalysisUsage &Info) const {
53 Info.setPreservesAll(); 53 Info.setPreservesAll();
54 Info.addRequired<DataLayoutPass>();
55 } 54 }
56 bool runOnFunction(Function &F); 55 bool runOnFunction(Function &F);
57 virtual void print(raw_ostream &O, const Module *M) const; 56 virtual void print(raw_ostream &O, const Module *M) const;
58 57
59 private: 58 private:
60 const char *checkInstruction(const DataLayout *DL, const Instruction *Inst); 59 const char *checkInstruction(const DataLayout *DL, const Instruction *Inst);
61 PNaClABIErrorReporter *Reporter; 60 PNaClABIErrorReporter *Reporter;
62 bool ReporterIsOwned; 61 bool ReporterIsOwned;
63 std::unique_ptr<NaCl::AtomicIntrinsics> AtomicIntrinsics; 62 std::unique_ptr<NaCl::AtomicIntrinsics> AtomicIntrinsics;
64 }; 63 };
65 64
66 } 65 }
67 66
68 #endif // LLVM_ANALYSIS_NACL_PNACLABIVERIFYFUNCTIONS_H 67 #endif // LLVM_ANALYSIS_NACL_PNACLABIVERIFYFUNCTIONS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698