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

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

Issue 12449014: ABI verifier: Add standalone tool pnacl-abicheck (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: cleanup, use << for error streams uniformly Created 7 years, 9 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
« no previous file with comments | « no previous file | lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/raw_ostream.h"
14 #include <string>
15
13 namespace llvm { 16 namespace llvm {
14 17
15 class FunctionPass; 18 class FunctionPass;
16 class ModulePass; 19 class ModulePass;
17 20
18 FunctionPass *createPNaClABIVerifyFunctionsPass(); 21 class PNaClABIErrorReporter {
19 ModulePass *createPNaClABIVerifyModulePass(); 22 public:
23 PNaClABIErrorReporter() : ErrorCount(0), Errors(ErrorString) {}
24 // Return the number of verification errors from the last run.
25 int getErrorCount() { return ErrorCount; }
26 // Print the error messages to O
27 void printErrors(llvm::raw_ostream &O) {
28 Errors.flush();
29 O << ErrorString;
30 }
31 // Increments the error count and returns an ostream to which the error
32 // message can be streamed.
33 raw_ostream &addError() {
34 ErrorCount++;
35 return Errors;
36 }
37 // Reset the error count and error messages.
38 void reset() {
39 ErrorCount = 0;
40 Errors.flush();
41 ErrorString.clear();
42 }
43 private:
44 int ErrorCount;
45 std::string ErrorString;
46 raw_string_ostream Errors;
47 };
48
49 FunctionPass *createPNaClABIVerifyFunctionsPass(PNaClABIErrorReporter * Reporter );
50 ModulePass *createPNaClABIVerifyModulePass(PNaClABIErrorReporter * Reporter);
20 51
21 } 52 }
22 53
23 54
24 #endif 55 #endif
OLDNEW
« no previous file with comments | « no previous file | lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698