summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/StmtPrinterTest.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-06-09 22:53:25 +0000
committerRichard Trieu <rtrieu@google.com>2014-06-09 22:53:25 +0000
commitddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d (patch)
tree37c95111a4e9ec687e3be04eb7f4e149d693c0e2 /clang/unittests/AST/StmtPrinterTest.cpp
parenta23043cb9c1ef021a9cf05cd62cce76cd03c0ba2 (diff)
downloadbcm5719-llvm-ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d.tar.gz
bcm5719-llvm-ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d.zip
Removing an "if (this == nullptr)" check from two print methods. The condition
will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. llvm-svn: 210498
Diffstat (limited to 'clang/unittests/AST/StmtPrinterTest.cpp')
-rw-r--r--clang/unittests/AST/StmtPrinterTest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/unittests/AST/StmtPrinterTest.cpp b/clang/unittests/AST/StmtPrinterTest.cpp
index 0b334e768ff..c75cbdefbf2 100644
--- a/clang/unittests/AST/StmtPrinterTest.cpp
+++ b/clang/unittests/AST/StmtPrinterTest.cpp
@@ -32,6 +32,7 @@ using namespace tooling;
namespace {
void PrintStmt(raw_ostream &Out, const ASTContext *Context, const Stmt *S) {
+ assert(S != nullptr && "Expected non-null Stmt");
PrintingPolicy Policy = Context->getPrintingPolicy();
S->printPretty(Out, /*Helper*/ nullptr, Policy);
}
OpenPOWER on IntegriCloud