Skip to content

Commit ce9c7a6

Browse files
committed
Dump expression before assert
1 parent 9222e5b commit ce9c7a6

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "converter/converter_lib.h"
1515
#include "converter/lex.h"
1616
#include "converter/mapper.h"
17-
#include "logging.h"
1817

1918
namespace cpp2rust {
2019
std::unordered_map<std::string, std::string> Converter::inner_structs_;
@@ -54,7 +53,7 @@ use std::rc::Rc;
5453

5554
bool Converter::VisitRecoveryExpr(clang::RecoveryExpr *expr) {
5655
llvm::errs() << "RecoveryExpr: ";
57-
expr->dump(llvm::errs(), ctx_);
56+
expr->dump();
5857
exit(1);
5958
return false;
6059
}
@@ -3438,7 +3437,7 @@ void Converter::ConvertUnsignedArithBinaryOperator(clang::BinaryOperator *op,
34383437
default:
34393438
// FIXME: improve error handling
34403439
llvm::errs() << "unsupported unsigned binary operator: " << opcode << '\n';
3441-
op->dump(llvm::errs(), ctx_);
3440+
op->dump();
34423441
assert(0);
34433442
}
34443443
PushParen paren(*this);

cpp2rust/converter/models/converter_refcount.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "converter/converter_lib.h"
1212
#include "converter/lex.h"
1313
#include "converter/mapper.h"
14-
#include "logging.h"
1514

1615
namespace cpp2rust {
1716
ConverterRefCount::ConverterRefCount(std::string &rs_code,
@@ -839,7 +838,7 @@ void ConverterRefCount::ConvertPrintf(clang::CallExpr *expr) {
839838
format = GetEscapedStringLiteral(str);
840839
} else {
841840
llvm::errs() << "Uknown fprintf format: ";
842-
expr->getArg(1)->dump(llvm::errs(), ctx_);
841+
expr->getArg(1)->dump();
843842
llvm::errs() << "\n";
844843
exit(1);
845844
}

cpp2rust/converter/plugins/emplace_back.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "converter/converter_lib.h"
77
#include "converter/mapper.h"
88
#include "converter/models/converter_refcount.h"
9-
#include "logging.h"
109

1110
namespace cpp2rust {
1211

@@ -183,7 +182,7 @@ bool Converter::emplace_back_plugin_convert(clang::CallExpr *call) {
183182
StrCat(GetUnsafeTypeAsString(elem_ty));
184183
}
185184
} else {
186-
call->dump(llvm::errs(), ctx_);
185+
call->dump();
187186
assert(0 && "no ctor and no pod type");
188187
return false;
189188
}

0 commit comments

Comments
 (0)