| OLD | NEW |
| 1 //===-- NaCl.h - NaCl Analysis ---------------------------*- C++ -*-===// | 1 //===-- NaCl.h - NaCl Analysis ---------------------------*- C++ -*-===// |
| 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 #ifndef LLVM_ANALYSIS_NACL_H | 10 #ifndef LLVM_ANALYSIS_NACL_H |
| 11 #define LLVM_ANALYSIS_NACL_H | 11 #define LLVM_ANALYSIS_NACL_H |
| 12 | 12 |
| 13 #include "llvm/Support/CommandLine.h" |
| 13 #include "llvm/Support/ErrorHandling.h" | 14 #include "llvm/Support/ErrorHandling.h" |
| 14 #include "llvm/Support/raw_ostream.h" | 15 #include "llvm/Support/raw_ostream.h" |
| 15 #include <string> | 16 #include <string> |
| 16 | 17 |
| 17 namespace llvm { | 18 namespace llvm { |
| 18 | 19 |
| 19 class FunctionPass; | 20 class FunctionPass; |
| 20 class ModulePass; | 21 class ModulePass; |
| 22 extern cl::opt<bool> PNaClABIAllowDebugMetadata; |
| 21 | 23 |
| 22 class PNaClABIErrorReporter { | 24 class PNaClABIErrorReporter { |
| 23 public: | 25 public: |
| 24 PNaClABIErrorReporter() : ErrorCount(0), Errors(ErrorString), | 26 PNaClABIErrorReporter() : ErrorCount(0), Errors(ErrorString), |
| 25 UseFatalErrors(true) {} | 27 UseFatalErrors(true) {} |
| 26 // Return the number of verification errors from the last run. | 28 // Return the number of verification errors from the last run. |
| 27 int getErrorCount() { return ErrorCount; } | 29 int getErrorCount() { return ErrorCount; } |
| 28 // Print the error messages to O | 30 // Print the error messages to O |
| 29 void printErrors(llvm::raw_ostream &O) { | 31 void printErrors(llvm::raw_ostream &O) { |
| 30 Errors.flush(); | 32 Errors.flush(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 report_fatal_error("PNaCl ABI verification failed"); | 53 report_fatal_error("PNaCl ABI verification failed"); |
| 52 } | 54 } |
| 53 } | 55 } |
| 54 private: | 56 private: |
| 55 int ErrorCount; | 57 int ErrorCount; |
| 56 std::string ErrorString; | 58 std::string ErrorString; |
| 57 raw_string_ostream Errors; | 59 raw_string_ostream Errors; |
| 58 bool UseFatalErrors; | 60 bool UseFatalErrors; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 FunctionPass *createPNaClABIVerifyFunctionsPass(PNaClABIErrorReporter * Reporter
); | 63 FunctionPass *createPNaClABIVerifyFunctionsPass( |
| 62 ModulePass *createPNaClABIVerifyModulePass(PNaClABIErrorReporter * Reporter); | 64 PNaClABIErrorReporter *Reporter); |
| 65 ModulePass *createPNaClABIVerifyModulePass(PNaClABIErrorReporter *Reporter); |
| 63 | 66 |
| 64 } | 67 } |
| 65 | 68 |
| 66 | 69 |
| 67 #endif | 70 #endif |
| OLD | NEW |