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
f5ee30c3
Kaydet (Commit)
f5ee30c3
authored
Şub 02, 2013
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
append [loplugin] automatically in report() rathen than manually everywhere
Change-Id: I2f98622f152ae0c7ac8d1113d6380f686ac7234c
üst
b4392c57
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
20 deletions
+21
-20
bodynotinblock.cxx
compilerplugins/clang/bodynotinblock.cxx
+2
-2
plugin.cxx
compilerplugins/clang/plugin.cxx
+4
-3
pluginhandler.cxx
compilerplugins/clang/pluginhandler.cxx
+6
-6
postfixincrementfix.cxx
compilerplugins/clang/postfixincrementfix.cxx
+2
-2
sallogareas.cxx
compilerplugins/clang/sallogareas.cxx
+5
-5
unusedvariablecheck.cxx
compilerplugins/clang/unusedvariablecheck.cxx
+2
-2
No files found.
compilerplugins/clang/bodynotinblock.cxx
Dosyayı görüntüle @
f5ee30c3
...
...
@@ -122,10 +122,10 @@ void BodyNotInBlock::checkBody( const Stmt* body, SourceLocation stmtLocation, c
if
(
bodyColumn
==
nextStatementColumn
)
{
report
(
DiagnosticsEngine
::
Warning
,
"statement aligned as second statement in %select{if|while|for}0 body but not in a statement block
[loplugin]
"
,
"statement aligned as second statement in %select{if|while|for}0 body but not in a statement block"
,
(
*
it
)
->
getLocStart
())
<<
stmtType
;
report
(
DiagnosticsEngine
::
Note
,
"%select{if|while|for}0 body statement is here
[loplugin]
"
,
"%select{if|while|for}0 body statement is here"
,
body
->
getLocStart
())
<<
stmtType
;
}
return
;
...
...
compilerplugins/clang/plugin.cxx
Dosyayı görüntüle @
f5ee30c3
...
...
@@ -42,10 +42,11 @@ DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef mess
if( level == DiagnosticsEngine::Error && diag.getErrorsAsFatal())
level = DiagnosticsEngine::Fatal;
#endif
string
fullMessage
=
(
message
+
" [loplugin]"
).
str
();
if
(
loc
.
isValid
())
return
diag
.
Report
(
loc
,
diag
.
getCustomDiagID
(
level
,
m
essage
));
return
diag
.
Report
(
loc
,
diag
.
getCustomDiagID
(
level
,
fullM
essage
));
else
return
diag
.
Report
(
diag
.
getCustomDiagID
(
level
,
m
essage
));
return
diag
.
Report
(
diag
.
getCustomDiagID
(
level
,
fullM
essage
));
}
bool
Plugin
::
ignoreLocation
(
SourceLocation
loc
)
...
...
@@ -174,7 +175,7 @@ bool RewritePlugin::replaceText( SourceRange range, SourceRange replacementRange
bool
RewritePlugin
::
reportEditFailure
(
SourceLocation
loc
)
{
report
(
DiagnosticsEngine
::
Warning
,
"cannot perform source modification (macro expansion involved?)
[loplugin]
"
,
loc
);
report
(
DiagnosticsEngine
::
Warning
,
"cannot perform source modification (macro expansion involved?)"
,
loc
);
return
false
;
}
...
...
compilerplugins/clang/pluginhandler.cxx
Dosyayı görüntüle @
f5ee30c3
...
...
@@ -61,7 +61,7 @@ PluginHandler::PluginHandler( ASTContext& context, const vector< string >& args
}
pluginObjectsCreated
=
true
;
if
(
!
args
.
empty
()
&&
!
wasCreated
)
report
(
DiagnosticsEngine
::
Fatal
,
"unknown plugin tool %0
[loplugin]
"
)
<<
args
.
front
();
report
(
DiagnosticsEngine
::
Fatal
,
"unknown plugin tool %0"
)
<<
args
.
front
();
}
PluginHandler
::~
PluginHandler
()
...
...
@@ -126,17 +126,17 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
}
}
if
(
modifyFile
.
empty
())
report
(
DiagnosticsEngine
::
Warning
,
"modified source in solver/ : %0
[loplugin]
"
)
<<
e
->
getName
();
report
(
DiagnosticsEngine
::
Warning
,
"modified source in solver/ : %0"
)
<<
e
->
getName
();
}
else
if
(
strncmp
(
e
->
getName
(),
WORKDIR
,
strlen
(
WORKDIR
))
==
0
)
report
(
DiagnosticsEngine
::
Warning
,
"modified source in workdir/ : %0
[loplugin]
"
)
<<
e
->
getName
();
report
(
DiagnosticsEngine
::
Warning
,
"modified source in workdir/ : %0"
)
<<
e
->
getName
();
else
if
(
strcmp
(
SRCDIR
,
BUILDDIR
)
!=
0
&&
strncmp
(
e
->
getName
(),
BUILDDIR
,
strlen
(
BUILDDIR
))
==
0
)
report
(
DiagnosticsEngine
::
Warning
,
"modified source in build dir : %0
[loplugin]
"
)
<<
e
->
getName
();
report
(
DiagnosticsEngine
::
Warning
,
"modified source in build dir : %0"
)
<<
e
->
getName
();
else
if
(
strncmp
(
e
->
getName
(),
SRCDIR
,
strlen
(
SRCDIR
))
==
0
)
;
// ok
else
{
report
(
DiagnosticsEngine
::
Warning
,
"modified source in unknown location, not modifying : %0
[loplugin]
"
)
report
(
DiagnosticsEngine
::
Warning
,
"modified source in unknown location, not modifying : %0"
)
<<
e
->
getName
();
continue
;
// --->
}
...
...
@@ -157,7 +157,7 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
ostream
.
clear_error
();
unlink
(
filename
);
if
(
!
ok
)
report
(
DiagnosticsEngine
::
Error
,
"cannot write modified source to %0 (%1)
[loplugin]
"
)
<<
modifyFile
<<
error
;
report
(
DiagnosticsEngine
::
Error
,
"cannot write modified source to %0 (%1)"
)
<<
modifyFile
<<
error
;
delete
[]
filename
;
}
}
...
...
compilerplugins/clang/postfixincrementfix.cxx
Dosyayı görüntüle @
f5ee30c3
...
...
@@ -119,7 +119,7 @@ bool PostfixIncrementFix::canChangePostfixToPrefix( const CXXOperatorCallExpr* o
return
canChangeInConditionStatement
(
op
,
dyn_cast
<
ForStmt
>
(
parents
[
parent_pos
]
)
->
getCond
(),
parents
,
parent_pos
);
default
:
report
(
DiagnosticsEngine
::
Fatal
,
"cannot analyze operator++ (plugin needs fixing)
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Fatal
,
"cannot analyze operator++ (plugin needs fixing)"
,
op
->
getLocStart
())
<<
parents
[
parent_pos
]
->
getSourceRange
();
// parents[ parent_pos ]->dump();
// parents[ std::max( parent_pos - 3, 0 ) ]->dump();
...
...
@@ -155,7 +155,7 @@ bool PostfixIncrementFix::shouldDoChange( const Expr* operand )
return
true
;
default
:
{
report
(
DiagnosticsEngine
::
Fatal
,
"cannot analyze operator++ (plugin needs fixing)
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Fatal
,
"cannot analyze operator++ (plugin needs fixing)"
,
expr
->
getLocStart
())
<<
operand
->
getSourceRange
();
expr
->
dump
();
operand
->
dump
();
...
...
compilerplugins/clang/sallogareas.cxx
Dosyayı görüntüle @
f5ee30c3
...
...
@@ -70,7 +70,7 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
if
(
area
->
getKind
()
==
StringLiteral
::
Ascii
)
checkArea
(
area
->
getBytes
(),
area
->
getExprLoc
());
else
report
(
DiagnosticsEngine
::
Warning
,
"unsupported string literal kind (plugin needs fixing?)
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Warning
,
"unsupported string literal kind (plugin needs fixing?)"
,
area
->
getLocStart
());
return
true
;
}
...
...
@@ -87,11 +87,11 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
if
(
inMacro
==
"SAL_DEBUG"
)
return
true
;
// ok
}
report
(
DiagnosticsEngine
::
Warning
,
"missing log area
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Warning
,
"missing log area"
,
call
->
getArg
(
1
)
->
IgnoreParenImpCasts
()
->
getLocStart
());
return
true
;
}
report
(
DiagnosticsEngine
::
Warning
,
"cannot analyse log area argument (plugin needs fixing?)
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Warning
,
"cannot analyse log area argument (plugin needs fixing?)"
,
call
->
getLocStart
());
}
}
...
...
@@ -105,7 +105,7 @@ void SalLogAreas::checkArea( StringRef area, SourceLocation location )
readLogAreas
();
if
(
!
logAreas
.
count
(
area
))
{
report
(
DiagnosticsEngine
::
Warning
,
"unknown log area '%0' (check or extend sal/inc/sal/log-areas.dox)
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Warning
,
"unknown log area '%0' (check or extend sal/inc/sal/log-areas.dox)"
,
location
)
<<
area
;
}
}
...
...
@@ -130,7 +130,7 @@ void SalLogAreas::readLogAreas()
}
// If you get this error message, you possibly have too old icecream (ICECC_EXTRAFILES is needed).
if
(
logAreas
.
empty
())
report
(
DiagnosticsEngine
::
Warning
,
"error reading log areas
[loplugin]
"
);
report
(
DiagnosticsEngine
::
Warning
,
"error reading log areas"
);
}
static
Plugin
::
Registration
<
SalLogAreas
>
X
(
"sallogareas"
);
...
...
compilerplugins/clang/unusedvariablecheck.cxx
Dosyayı görüntüle @
f5ee30c3
...
...
@@ -89,11 +89,11 @@ bool UnusedVariableCheck::VisitVarDecl( VarDecl* var )
if
(
const
FunctionDecl
*
func
=
dyn_cast_or_null
<
FunctionDecl
>
(
param
->
getParentFunctionOrMethod
()))
if
(
!
func
->
doesThisDeclarationHaveABody
())
return
true
;
report
(
DiagnosticsEngine
::
Warning
,
"unused parameter %0
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Warning
,
"unused parameter %0"
,
var
->
getLocation
())
<<
var
->
getDeclName
();
}
else
report
(
DiagnosticsEngine
::
Warning
,
"unused variable %0
[loplugin]
"
,
report
(
DiagnosticsEngine
::
Warning
,
"unused variable %0"
,
var
->
getLocation
())
<<
var
->
getDeclName
();
}
}
...
...
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