[Libreoffice-commits] .: 2 commits - compilerplugins/clang solenv/gbuild

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 19 01:26:54 PDT 2012


 compilerplugins/clang/sallogareas.cxx |    8 ++++++++
 compilerplugins/clang/sallogareas.hxx |    1 +
 solenv/gbuild/LinkTarget.mk           |    2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 1b3dc82a01a97b917c2cba402ffd8c2d5238910c
Author: Lubos Lunak <l.lunak at suse.cz>
Date:   Thu Oct 18 16:03:44 2012 +0200

    use gb_LINKEROPTFLAGS if no explicit LDFLAGS is given
    
    I have no idea why gb_LINKEROPTFLAGS stopped working, it used to be used
    and I can't find the commit that removed it.
    
    Change-Id: I537e4e7b686ecc34022f2097fa3e666295294e04

diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 1d7d66c..870bad1 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -508,7 +508,7 @@ $(call gb_LinkTarget_get_headers_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
 $(call gb_LinkTarget_get_headers_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
-$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(LDFLAGS)
+$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(if $(LDFLAGS),$(LDFLAGS),$(gb_LINKEROPTFLAGS))
 $(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS :=
 $(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS :=
 $(call gb_LinkTarget_get_target,$(1)) : LIBS :=
commit 1a77b93aec7070327a91f21c801d2e951b5a068d
Author: Lubos Lunak <l.lunak at suse.cz>
Date:   Wed Oct 17 19:53:32 2012 +0200

    only one warning per one SAL_INFO/SAL_WARN
    
    Change-Id: I5aafe9ed51c86dc31492d205f44fba6b1db137d2

diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index 1dd99b9..1a4a8b2 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -31,6 +31,7 @@ SalLogAreas::SalLogAreas( ASTContext& context )
 void SalLogAreas::run()
     {
     inFunction = NULL;
+    lastSalDetailLogStreamMacro = SourceLocation();
     TraverseDecl( context.getTranslationUnitDecl());
     }
 
@@ -55,6 +56,13 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
                 {
                 if( const StringLiteral* area = dyn_cast< StringLiteral >( call->getArg( 1 )->IgnoreParenImpCasts()))
                     {
+                    // The SAL_DETAIL_LOG_STREAM macro expands to two calls to sal::detail::log(),
+                    // so do not warn repeatedly about the same macro (the area->getLocStart() of all the calls
+                    // from the same macro should be the same).
+                    SourceLocation expansionLocation = context.getSourceManager().getExpansionLoc(area->getLocStart());
+                    if( expansionLocation == lastSalDetailLogStreamMacro )
+                        return true;
+                    lastSalDetailLogStreamMacro = expansionLocation;
                     if( area->getKind() == StringLiteral::Ascii )
                         checkArea( area->getBytes(), area->getExprLoc());
                     else
diff --git a/compilerplugins/clang/sallogareas.hxx b/compilerplugins/clang/sallogareas.hxx
index 72f0e75..e83e890 100644
--- a/compilerplugins/clang/sallogareas.hxx
+++ b/compilerplugins/clang/sallogareas.hxx
@@ -31,6 +31,7 @@ class SalLogAreas
         void checkArea( StringRef area, SourceLocation location );
         void readLogAreas();
         const FunctionDecl* inFunction;
+        SourceLocation lastSalDetailLogStreamMacro;
         set< string > logAreas;
     };
 


More information about the Libreoffice-commits mailing list