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

Side by Side Diff: unittests/Bitcode/NaClMungeTest.h

Issue 1310883003: Install notion of diagnostic handler into PNaCl bitcode readers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix issues in patch set 2. Created 5 years, 3 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 | « unittests/Bitcode/NaClBitReaderTest.cpp ('k') | unittests/Bitcode/NaClMungeTest.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 //===- llvm/unittest/Bitcode/NaClMungeTest.h - Test munging utils ---------===// 1 //===- llvm/unittest/Bitcode/NaClMungeTest.h - Test munging utils ---------===//
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 // Contains common utilities used in bitcode munge tests. 10 // Contains common utilities used in bitcode munge tests.
11 11
12 #ifndef LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H 12 #ifndef LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H
13 #define LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H 13 #define LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H
14 14
15 #include "llvm/ADT/STLExtras.h" 15 #include "llvm/ADT/STLExtras.h"
16 #include "llvm/Bitcode/NaCl/NaClBitcodeMunge.h" 16 #include "llvm/Bitcode/NaCl/NaClBitcodeMunge.h"
17 17
18 #include "gtest/gtest.h" 18 #include "gtest/gtest.h"
19 19
20 namespace naclmungetest { 20 namespace naclmungetest {
21 21
22 const uint64_t Terminator = 0x5768798008978675LL; 22 const uint64_t Terminator = 0x5768798008978675LL;
23 23
24 #define ARRAY(name) name, array_lengthof(name) 24 #define ARRAY(name) name, array_lengthof(name)
25 25
26 #define ARRAY_TERM(name) ARRAY(name), Terminator 26 #define ARRAY_TERM(name) ARRAY(name), Terminator
27 27
28 // Removes error severity prefices, if present, for each line in the message.
29 // Returns the stripped result.
30 std::string stripErrorPrefix(const std::string &Message);
31
28 inline std::string stringify(llvm::NaClMungedBitcode &MungedBitcode) { 32 inline std::string stringify(llvm::NaClMungedBitcode &MungedBitcode) {
29 std::string Buffer; 33 std::string Buffer;
30 llvm::raw_string_ostream StrBuf(Buffer); 34 llvm::raw_string_ostream StrBuf(Buffer);
31 MungedBitcode.print(StrBuf); 35 MungedBitcode.print(StrBuf);
32 return StrBuf.str(); 36 return StrBuf.str();
33 } 37 }
34 38
35 inline std::string stringify(llvm::NaClBitcodeMunger &Munger) { 39 inline std::string stringify(llvm::NaClBitcodeMunger &Munger) {
36 return stringify(Munger.getMungedBitcode()); 40 return stringify(Munger.getMungedBitcode());
37 } 41 }
38 42
39 } // end of namespace naclmungetest 43 } // end of namespace naclmungetest
40 44
41 #endif // end LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H 45 #endif // end LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H
OLDNEW
« no previous file with comments | « unittests/Bitcode/NaClBitReaderTest.cpp ('k') | unittests/Bitcode/NaClMungeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698