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

Unified Diff: include/llvm/Analysis/NaCl/PNaClABIVerifyModule.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
Index: include/llvm/Analysis/NaCl/PNaClABIVerifyModule.h
diff --git a/include/llvm/Analysis/NaCl/PNaClABIVerifyModule.h b/include/llvm/Analysis/NaCl/PNaClABIVerifyModule.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ff409323e13463953a161097951edef2afc5c61
--- /dev/null
+++ b/include/llvm/Analysis/NaCl/PNaClABIVerifyModule.h
@@ -0,0 +1,76 @@
+//===- PNaClABIVerifyModule.h - Verify PNaCl ABI rules ----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Verify module-level PNaCl ABI requirements (specifically those that do not
+// require looking at the function bodies).
+//
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_NACL_PNACLABIVERIFYMODULE_H
+#define LLVM_ANALYSIS_NACL_PNACLABIVERIFYMODULE_H
+
+#include "llvm/ADT/StringMap.h"
+#include "llvm/Analysis/NaCl.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Pass.h"
+
+namespace llvm {
+
+class PNaClAllowedIntrinsics;
+
+// This pass should not touch function bodies, to stay streaming-friendly
+class PNaClABIVerifyModule : public ModulePass {
+ PNaClABIVerifyModule(const PNaClABIVerifyModule&) LLVM_DELETED_FUNCTION;
+ void operator=(const PNaClABIVerifyModule&) LLVM_DELETED_FUNCTION;
+ public:
+ static char ID;
+ PNaClABIVerifyModule() :
+ ModulePass(ID),
+ Reporter(new PNaClABIErrorReporter),
+ ReporterIsOwned(true),
+ StreamingMode(false),
+ SeenEntryPoint(false) {
+ initializePNaClABIVerifyModulePass(*PassRegistry::getPassRegistry());
+ }
+ PNaClABIVerifyModule(PNaClABIErrorReporter *Reporter_,
+ bool StreamingMode) :
+ ModulePass(ID),
+ Reporter(Reporter_),
+ ReporterIsOwned(false),
+ StreamingMode(StreamingMode),
+ SeenEntryPoint(false) {
+ initializePNaClABIVerifyModulePass(*PassRegistry::getPassRegistry());
+ }
+ virtual ~PNaClABIVerifyModule();
+ bool runOnModule(Module &M);
+ virtual void print(raw_ostream &O, const Module *M) const;
+
+ // Checks validity of function declaration F with given name Name.
+ // (see PNaClABIVerifyFunctions.h for handling function bodies).
+ void checkFunction(const Function *F, const StringRef &Name,
+ PNaClAllowedIntrinsics &Intrinsics);
+ // Checks validity of global variable declaration GV.
+ void checkGlobalVariable(const GlobalVariable *GV) {
+ return checkGlobalValue(GV);
+ }
+ private:
+ void checkGlobalValue(const GlobalValue *GV);
+ /// Checks whether \p GV is an allowed external symbol in stable bitcode.
+ void checkExternalSymbol(const GlobalValue *GV);
+
+ void checkGlobalIsFlattened(const GlobalVariable *GV);
+ PNaClABIErrorReporter *Reporter;
+ bool ReporterIsOwned;
+ bool StreamingMode;
+ bool SeenEntryPoint;
+};
+
+}
+#endif // LLVM_ANALYSIS_NACL_PNACLABIVERIFYMODULE_H
« no previous file with comments | « include/llvm/Analysis/NaCl/PNaClABIVerifyFunctions.h ('k') | include/llvm/Analysis/NaCl/PNaClAllowedIntrinsics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698