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
6f69fb5d
Kaydet (Commit)
6f69fb5d
authored
Şub 15, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Run the non-rewriter plugins even when rewriters are specified
Change-Id: I8262091c52522c54f84c0fac5fd180871d4a3a9f
üst
be0177fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
24 deletions
+11
-24
pluginhandler.cxx
compilerplugins/clang/pluginhandler.cxx
+10
-23
pluginhandler.hxx
compilerplugins/clang/pluginhandler.hxx
+1
-1
No files found.
compilerplugins/clang/pluginhandler.cxx
Dosyayı görüntüle @
6f69fb5d
...
...
@@ -56,7 +56,7 @@ PluginHandler::PluginHandler( CompilerInstance& compiler, const vector< string >
,
rewriter
(
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
,
scope
(
"mainfile"
)
{
bool
wasPlugin
=
false
;
set
<
string
>
rewriters
;
for
(
vector
<
string
>::
const_iterator
it
=
args
.
begin
();
it
!=
args
.
end
();
++
it
)
...
...
@@ -64,13 +64,9 @@ PluginHandler::PluginHandler( CompilerInstance& compiler, const vector< string >
if
(
it
->
size
()
>=
2
&&
(
*
it
)[
0
]
==
'-'
&&
(
*
it
)[
1
]
==
'-'
)
handleOption
(
it
->
substr
(
2
));
else
{
createPlugin
(
*
it
);
wasPlugin
=
true
;
}
rewriters
.
insert
(
*
it
);
}
if
(
!
wasPlugin
)
createPlugin
(
""
);
// = all non-rewriters
createPlugins
(
rewriters
);
pluginObjectsCreated
=
true
;
}
...
...
@@ -109,28 +105,19 @@ void PluginHandler::handleOption( const string& option )
report
(
DiagnosticsEngine
::
Fatal
,
"unknown option %0"
)
<<
option
;
}
void
PluginHandler
::
createPlugin
(
const
string
&
name
)
void
PluginHandler
::
createPlugin
s
(
set
<
string
>
rewriters
)
{
for
(
int
i
=
0
;
i
<
pluginCount
;
++
i
)
{
// if no plugin is given, create all by-default plugins as non-
// rewriters; otherwise, create the given plugin as a potential
// rewriter:
if
(
name
.
empty
())
{
if
(
plugins
[
i
].
byDefault
)
plugins
[
i
].
object
=
plugins
[
i
].
create
(
Plugin
::
InstantiationData
{
plugins
[
i
].
optionName
,
*
this
,
compiler
,
NULL
}
);
}
else
if
(
plugins
[
i
].
optionName
==
name
)
{
plugins
[
i
].
object
=
plugins
[
i
].
create
(
Plugin
::
InstantiationData
{
plugins
[
i
].
optionName
,
*
this
,
compiler
,
&
rewriter
}
);
return
;
}
if
(
rewriters
.
erase
(
plugins
[
i
].
optionName
)
!=
0
)
plugins
[
i
].
object
=
plugins
[
i
].
create
(
Plugin
::
InstantiationData
{
plugins
[
i
].
optionName
,
*
this
,
compiler
,
&
rewriter
}
);
else
if
(
plugins
[
i
].
byDefault
)
plugins
[
i
].
object
=
plugins
[
i
].
create
(
Plugin
::
InstantiationData
{
plugins
[
i
].
optionName
,
*
this
,
compiler
,
NULL
}
);
}
if
(
!
name
.
empty
()
)
report
(
DiagnosticsEngine
::
Fatal
,
"unknown plugin tool %0"
)
<<
name
;
for
(
auto
r
:
rewriters
)
report
(
DiagnosticsEngine
::
Fatal
,
"unknown plugin tool %0"
)
<<
r
;
}
void
PluginHandler
::
registerPlugin
(
Plugin
*
(
*
create
)(
const
Plugin
::
InstantiationData
&
),
const
char
*
optionName
,
bool
isPPCallback
,
bool
byDefault
)
...
...
compilerplugins/clang/pluginhandler.hxx
Dosyayı görüntüle @
6f69fb5d
...
...
@@ -35,7 +35,7 @@ class PluginHandler
CompilerInstance
&
compiler
,
SourceLocation
loc
=
SourceLocation
());
private
:
void
handleOption
(
const
string
&
option
);
void
createPlugin
(
const
string
&
name
);
void
createPlugin
s
(
set
<
string
>
rewriters
);
DiagnosticBuilder
report
(
DiagnosticsEngine
::
Level
level
,
StringRef
message
,
SourceLocation
loc
=
SourceLocation
());
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