summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend/RewriteModernObjC.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/lib/Rewrite/Frontend/RewriteModernObjC.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/lib/Rewrite/Frontend/RewriteModernObjC.cpp')
-rw-r--r--clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
index 3cacbdddf3b..43de31c516e 100644
--- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
@@ -267,6 +267,7 @@ namespace {
}
void ReplaceStmtWithRange(Stmt *Old, Stmt *New, SourceRange SrcRange) {
+ assert(Old != nullptr && New != nullptr && "Expected non-null Stmt's");
if (DisableReplaceStmt)
return;
@@ -2587,6 +2588,7 @@ void RewriteModernObjC::SynthGetMetaClassFunctionDecl() {
}
Stmt *RewriteModernObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
+ assert (Exp != nullptr && "Expected non-null ObjCStringLiteral");
QualType strType = getConstantStringStructType();
std::string S = "__NSConstantStringImpl_";
OpenPOWER on IntegriCloud