summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit776653a70a9cf68779da8ef866c79932a59fd938 (patch)
tree6e6bcdfd8b4f6a75c9a131e2bc6afab52179e47b /clang/lib
parent524e60b4e4a20bd674e5401c866fc56106369226 (diff)
downloadbcm5719-llvm-776653a70a9cf68779da8ef866c79932a59fd938.tar.gz
bcm5719-llvm-776653a70a9cf68779da8ef866c79932a59fd938.zip
Simplified code for deprecated attribute wih message a little.
llvm-svn: 115856
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 1376472eec0..3e1ced29a8d 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d54a8582210..fa1ce7a21c5 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud