[cfe-commits] r115856 - in /cfe/trunk/lib/Sema: SemaDeclAttr.cpp SemaExpr.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Oct 6 15:20:09 PDT 2010


Author: fjahanian
Date: Wed Oct  6 17:20:08 2010
New Revision: 115856

URL: http://llvm.org/viewvc/llvm-project?rev=115856&view=rev
Log:
Simplified code for deprecated attribute wih message a little.

Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=115856&r1=115855&r2=115856&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Oct  6 17:20:08 2010
@@ -2552,7 +2552,7 @@
     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 @@
   // 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

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=115856&r1=115855&r2=115856&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Oct  6 17:20:08 2010
@@ -59,7 +59,7 @@
   // 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);
   }
 





More information about the cfe-commits mailing list