summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-diff/DifferenceEngine.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-08-27 02:49:45 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-08-27 02:49:45 +0000
commit788a6079e100b8247e609aec5e58edb6c837bd43 (patch)
treec91ed51414d6c64cd12f44820868cce63e2ab306 /llvm/tools/llvm-diff/DifferenceEngine.h
parent1844a71e66fca2b31b29fb0f5e512a2980258e46 (diff)
downloadbcm5719-llvm-788a6079e100b8247e609aec5e58edb6c837bd43.tar.gz
bcm5719-llvm-788a6079e100b8247e609aec5e58edb6c837bd43.zip
Fix the msvs 2010 build.
The Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 implements parts of C++0x based on the draft standard. An old version of the draft had a bug that makes std::pair<T1*, T2*>(something, 0) fail to compile. This is because the template<class U, class V> pair(U&& x, V&& y) constructor is selected, even though it later fails to implicitly convert U and V to frist_type and second_type. This has been fixed in n3090, but it seems that Microsoft is not going to update msvc. llvm-svn: 112257
Diffstat (limited to 'llvm/tools/llvm-diff/DifferenceEngine.h')
-rw-r--r--llvm/tools/llvm-diff/DifferenceEngine.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/tools/llvm-diff/DifferenceEngine.h b/llvm/tools/llvm-diff/DifferenceEngine.h
index bc331317344..1609bd5c108 100644
--- a/llvm/tools/llvm-diff/DifferenceEngine.h
+++ b/llvm/tools/llvm-diff/DifferenceEngine.h
@@ -79,8 +79,14 @@ namespace llvm {
void addMatch(Instruction *L, Instruction *R) {
Diff.push_back(DiffRecord(L, R));
}
- void addLeft(Instruction *L) { Diff.push_back(DiffRecord(L, 0)); }
- void addRight(Instruction *R) { Diff.push_back(DiffRecord(0, R)); }
+ void addLeft(Instruction *L) {
+ // HACK: VS 2010 has a bug in the stdlib that requires this.
+ Diff.push_back(DiffRecord(L, DiffRecord::second_type(0)));
+ }
+ void addRight(Instruction *R) {
+ // HACK: VS 2010 has a bug in the stdlib that requires this.
+ Diff.push_back(DiffRecord(DiffRecord::first_type(0), R));
+ }
unsigned getNumLines() const { return Diff.size(); }
DiffChange getLineKind(unsigned I) const {
OpenPOWER on IntegriCloud