Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
9ed9ca61
Kaydet (Commit)
9ed9ca61
authored
Ara 18, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:stringconcat: Adapt to definition of OSL_THIS_FUNC on Windows
Change-Id: I9a2be8c4265095ff2ac5e2216cb08c35c9049bf8
üst
dbbd2c48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
stringconcat.cxx
compilerplugins/clang/stringconcat.cxx
+21
-4
No files found.
compilerplugins/clang/stringconcat.cxx
Dosyayı görüntüle @
9ed9ca61
...
...
@@ -36,10 +36,6 @@ Expr const * stripCtor(Expr const * expr) {
return
e3
->
getArg
(
0
)
->
IgnoreParenImpCasts
();
}
bool
isStringLiteral
(
Expr
const
*
expr
)
{
return
isa
<
clang
::
StringLiteral
>
(
stripCtor
(
expr
));
}
class
StringConcat
:
public
RecursiveASTVisitor
<
StringConcat
>
,
public
loplugin
::
Plugin
{
...
...
@@ -50,6 +46,9 @@ public:
{
TraverseDecl
(
compiler
.
getASTContext
().
getTranslationUnitDecl
());
}
bool
VisitCallExpr
(
CallExpr
const
*
expr
);
private
:
bool
isStringLiteral
(
Expr
const
*
expr
);
};
bool
StringConcat
::
VisitCallExpr
(
CallExpr
const
*
expr
)
{
...
...
@@ -109,6 +108,24 @@ bool StringConcat::VisitCallExpr(CallExpr const * expr) {
return
true
;
}
bool
StringConcat
::
isStringLiteral
(
Expr
const
*
expr
)
{
expr
=
stripCtor
(
expr
);
if
(
!
isa
<
clang
::
StringLiteral
>
(
expr
))
{
return
false
;
}
// OSL_THIS_FUNC may be defined as "" in include/osl/diagnose.h, so don't
// warn about expressions like 'SAL_INFO(..., OSL_THIS_FUNC << ":")' or
// 'OUString(OSL_THIS_FUNC) + ":"':
auto
loc
=
expr
->
getLocStart
();
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
);
}
return
!
compiler
.
getSourceManager
().
isMacroBodyExpansion
(
loc
)
||
(
Lexer
::
getImmediateMacroName
(
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
!=
"OSL_THIS_FUNC"
);
}
loplugin
::
Plugin
::
Registration
<
StringConcat
>
X
(
"stringconcat"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment