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

Unified Diff: include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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 | « include/llvm/Analysis/NaCl/PNaClABITypeChecker.h ('k') | include/llvm/Analysis/NaCl/PNaClABIVerifyModule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h
diff --git a/include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h b/include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h
new file mode 100644
index 0000000000000000000000000000000000000000..db9b99bd65b78e3386b3a1e2365278221819655d
--- /dev/null
+++ b/include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h
@@ -0,0 +1,68 @@
+//===- PNaClABIVerifyFunctions.h - Verify PNaCl ABI rules -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Verify function-level PNaCl ABI requirements.
+//
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_NACL_PNACLABIVERIFYFUNCTIONS_H
+#define LLVM_ANALYSIS_NACL_PNACLABIVERIFYFUNCTIONS_H
+
+#include "llvm/Analysis/NaCl/PNaClABIProps.h"
+
+#include "llvm/Analysis/NaCl.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/NaClAtomicIntrinsics.h"
+#include "llvm/Pass.h"
+
+namespace llvm {
+
+// Checks that examine anything in the function body should be in
+// FunctionPasses to make them streaming-friendly.
+class PNaClABIVerifyFunctions : public FunctionPass {
+ PNaClABIVerifyFunctions(const PNaClABIVerifyFunctions&) LLVM_DELETED_FUNCTION;
+ void operator=(const PNaClABIVerifyFunctions&) LLVM_DELETED_FUNCTION;
+ public:
+ static char ID;
+ PNaClABIVerifyFunctions() :
+ FunctionPass(ID),
+ Reporter(new PNaClABIErrorReporter),
+ ReporterIsOwned(true) {
+ initializePNaClABIVerifyFunctionsPass(*PassRegistry::getPassRegistry());
+ }
+ explicit PNaClABIVerifyFunctions(PNaClABIErrorReporter *Reporter_) :
+ FunctionPass(ID),
+ Reporter(Reporter_),
+ ReporterIsOwned(false) {
+ initializePNaClABIVerifyFunctionsPass(*PassRegistry::getPassRegistry());
+ }
+ virtual ~PNaClABIVerifyFunctions();
+ virtual bool doInitialization(Module &M) {
+ AtomicIntrinsics.reset(new NaCl::AtomicIntrinsics(M.getContext()));
+ return false;
+ }
+ virtual void getAnalysisUsage(AnalysisUsage &Info) const {
+ Info.setPreservesAll();
+ Info.addRequired<DataLayoutPass>();
+ }
+ bool runOnFunction(Function &F);
+ virtual void print(raw_ostream &O, const Module *M) const;
+
+private:
+ const char *checkInstruction(const DataLayout *DL, const Instruction *Inst);
+ PNaClABIErrorReporter *Reporter;
+ bool ReporterIsOwned;
+ std::unique_ptr<NaCl::AtomicIntrinsics> AtomicIntrinsics;
+};
+
+}
+
+#endif // LLVM_ANALYSIS_NACL_PNACLABIVERIFYFUNCTIONS_H
« no previous file with comments | « include/llvm/Analysis/NaCl/PNaClABITypeChecker.h ('k') | include/llvm/Analysis/NaCl/PNaClABIVerifyModule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698