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
a0da6725
Kaydet (Commit)
a0da6725
authored
May 03, 2013
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ignore already seen locations in compiler plugins
Change-Id: Icba8dfa61aee7237af569b2414b1cf4ce93ca476
üst
6f16cfb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
plugin.cxx
compilerplugins/clang/plugin.cxx
+15
-6
plugin.hxx
compilerplugins/clang/plugin.hxx
+1
-0
No files found.
compilerplugins/clang/plugin.cxx
Dosyayı görüntüle @
a0da6725
...
...
@@ -56,12 +56,21 @@ bool Plugin::ignoreLocation( SourceLocation loc )
const
char
*
bufferName
=
compiler
.
getSourceManager
().
getPresumedLoc
(
expansionLoc
).
getFilename
();
if
(
bufferName
==
NULL
)
return
true
;
if
(
strncmp
(
bufferName
,
OUTDIR
,
strlen
(
OUTDIR
))
==
0
||
strncmp
(
bufferName
,
WORKDIR
,
strlen
(
WORKDIR
))
==
0
||
strncmp
(
bufferName
,
BUILDDIR
,
strlen
(
BUILDDIR
))
==
0
||
strncmp
(
bufferName
,
SRCDIR
,
strlen
(
SRCDIR
))
==
0
)
return
false
;
// ok
return
true
;
if
(
strncmp
(
bufferName
,
OUTDIR
,
strlen
(
OUTDIR
))
!=
0
&&
strncmp
(
bufferName
,
WORKDIR
,
strlen
(
WORKDIR
))
!=
0
&&
strncmp
(
bufferName
,
BUILDDIR
,
strlen
(
BUILDDIR
))
!=
0
&&
strncmp
(
bufferName
,
SRCDIR
,
strlen
(
SRCDIR
))
!=
0
)
return
true
;
// not in LO sources
// Sometimes a VisitXXX function may be called more than once for one source location.
// This can happen e.g. with a default argument for a function, if it involves constructing
// a temporary, then this temporary will be constructed whenever the function is called
// and the default argument is needed. As this would mean processing the same piece of code
// more than once, and thus possibly modifying the source code more than once, just
// ignore an already seen location.
if
(
alreadySeen
.
find
(
loc
)
!=
alreadySeen
.
end
())
return
true
;
alreadySeen
.
insert
(
loc
);
return
false
;
}
void
Plugin
::
registerPlugin
(
Plugin
*
(
*
create
)(
CompilerInstance
&
,
Rewriter
&
),
const
char
*
optionName
,
bool
isRewriter
)
...
...
compilerplugins/clang/plugin.hxx
Dosyayı görüntüle @
a0da6725
...
...
@@ -53,6 +53,7 @@ class Plugin
bool
ignoreLocation
(
const
Decl
*
decl
);
bool
ignoreLocation
(
const
Stmt
*
stmt
);
CompilerInstance
&
compiler
;
set
<
SourceLocation
>
alreadySeen
;
private
:
static
void
registerPlugin
(
Plugin
*
(
*
create
)(
CompilerInstance
&
,
Rewriter
&
),
const
char
*
optionName
,
bool
isRewriter
);
template
<
typename
T
>
static
Plugin
*
createHelper
(
CompilerInstance
&
compiler
,
Rewriter
&
rewriter
);
...
...
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