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
4d3c6a04
Kaydet (Commit)
4d3c6a04
authored
Eki 09, 2012
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ignore macro expansion completely for now
Change-Id: Ie37b83fef1279a0a953de27941e3b342437c81d1
üst
7cd19a8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
bodynotinblock.cxx
compilerplugins/clang/bodynotinblock.cxx
+7
-7
No files found.
compilerplugins/clang/bodynotinblock.cxx
Dosyayı görüntüle @
4d3c6a04
...
...
@@ -74,6 +74,13 @@ void BodyNotInBlock::checkBody( const Stmt* body, const StmtParents& parents, in
{
if
(
body
==
NULL
||
parents
.
size
()
<
2
)
return
;
// TODO: If the if/while/for comes from a macro expansion, ignore it completely for
// now. The code below could assume everything is in the same place (and thus also column)
// and give a false warning. Moreover some macros are rather lousily written and would
// result in poor formatting. To be evaluated later, maybe this could be handled
// including macro expansion.
if
(
parents
.
back
()
->
getLocStart
().
isMacroID
())
return
;
if
(
dyn_cast
<
CompoundStmt
>
(
body
))
return
;
// if body is a compound statement, then it is in {}
// Find the next statement (in source position) after 'body'.
...
...
@@ -93,13 +100,6 @@ void BodyNotInBlock::checkBody( const Stmt* body, const StmtParents& parents, in
++
it
;
// skip empty ones (missing 'else' bodies for example)
if
(
it
!=
parents
[
parent_pos
]
->
child_end
())
{
// TODO: If both statements come from macro expansions, they may be
// below evaluated to be in the same place (because they may be
// the result of expansion of the same macro). Analysing this including
// macro expansions would be probably more complicated, so just
// ignore that in order to avoid false positives.
if
(
body
->
getLocStart
().
isMacroID
()
&&
(
*
it
)
->
getLocStart
().
isMacroID
())
return
;
bool
invalid1
,
invalid2
;
unsigned
bodyColumn
=
context
.
getSourceManager
()
.
getPresumedColumnNumber
(
body
->
getLocStart
(),
&
invalid1
);
...
...
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