aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-10-06 22:20:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-10-06 22:20:08 +0000
commitdf9fb9150e9ffb4660fb02ccea1480713fb8e0fb (patch)
tree43372be04be189f5b468fb946db02675b9352c80
parentc4b35cfdb977f6427fe0d5725bf104e1b425d72e (diff)
Simplified code for deprecated attribute wih message a little.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115856 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclAttr.cpp4
-rw-r--r--lib/Sema/SemaExpr.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 1376472eec..3e1ced29a8 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -2552,7 +2552,7 @@ void Sema::HandleDelayedDeprecationCheck(DelayedDiagnostic &DD,
return;
DD.Triggered = true;
- if (strlen(DD.DeprecationData.Message))
+ if (DD.DeprecationData.Message)
Diag(DD.Loc, diag::warn_deprecated_message)
<< DD.DeprecationData.Decl->getDeclName()
<< DD.DeprecationData.Message;
@@ -2573,7 +2573,7 @@ void Sema::EmitDeprecationWarning(NamedDecl *D, const char * Message,
// Otherwise, don't warn if our current context is deprecated.
if (isDeclDeprecated(cast<Decl>(CurContext)))
return;
- if (strlen(Message))
+ if (Message)
Diag(Loc, diag::warn_deprecated_message) << D->getDeclName()
<< Message;
else
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index d54a858221..fa1ce7a21c 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -59,7 +59,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) {
// See if the decl is deprecated.
if (const DeprecatedAttr *DA = D->getAttr<DeprecatedAttr>()) {
const char *Message =
- DA->getMessage().empty() ? "" : DA->getMessage().data();
+ DA->getMessage().empty() ? 0 : DA->getMessage().data();
EmitDeprecationWarning(D, Message, Loc);
}