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
1a77b93a
Kaydet (Commit)
1a77b93a
authored
Eki 17, 2012
tarafından
Lubos Lunak
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
only one warning per one SAL_INFO/SAL_WARN
Change-Id: I5aafe9ed51c86dc31492d205f44fba6b1db137d2
üst
06b8cdc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
sallogareas.cxx
compilerplugins/clang/sallogareas.cxx
+8
-0
sallogareas.hxx
compilerplugins/clang/sallogareas.hxx
+1
-0
No files found.
compilerplugins/clang/sallogareas.cxx
Dosyayı görüntüle @
1a77b93a
...
@@ -31,6 +31,7 @@ SalLogAreas::SalLogAreas( ASTContext& context )
...
@@ -31,6 +31,7 @@ SalLogAreas::SalLogAreas( ASTContext& context )
void
SalLogAreas
::
run
()
void
SalLogAreas
::
run
()
{
{
inFunction
=
NULL
;
inFunction
=
NULL
;
lastSalDetailLogStreamMacro
=
SourceLocation
();
TraverseDecl
(
context
.
getTranslationUnitDecl
());
TraverseDecl
(
context
.
getTranslationUnitDecl
());
}
}
...
@@ -55,6 +56,13 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
...
@@ -55,6 +56,13 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
{
{
if
(
const
StringLiteral
*
area
=
dyn_cast
<
StringLiteral
>
(
call
->
getArg
(
1
)
->
IgnoreParenImpCasts
()))
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
)
if
(
area
->
getKind
()
==
StringLiteral
::
Ascii
)
checkArea
(
area
->
getBytes
(),
area
->
getExprLoc
());
checkArea
(
area
->
getBytes
(),
area
->
getExprLoc
());
else
else
...
...
compilerplugins/clang/sallogareas.hxx
Dosyayı görüntüle @
1a77b93a
...
@@ -31,6 +31,7 @@ class SalLogAreas
...
@@ -31,6 +31,7 @@ class SalLogAreas
void
checkArea
(
StringRef
area
,
SourceLocation
location
);
void
checkArea
(
StringRef
area
,
SourceLocation
location
);
void
readLogAreas
();
void
readLogAreas
();
const
FunctionDecl
*
inFunction
;
const
FunctionDecl
*
inFunction
;
SourceLocation
lastSalDetailLogStreamMacro
;
set
<
string
>
logAreas
;
set
<
string
>
logAreas
;
};
};
...
...
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