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
40fd53a2
Kaydet (Commit)
40fd53a2
authored
Eki 18, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugins: extract some common functionality
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
üst
9d8d2e07
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
24 additions
and
35 deletions
+24
-35
constantparam.cxx
compilerplugins/clang/constantparam.cxx
+1
-1
constparams.cxx
compilerplugins/clang/constparams.cxx
+1
-2
countusersofdefaultparams.cxx
compilerplugins/clang/countusersofdefaultparams.cxx
+1
-2
inlineablemethods.cxx
compilerplugins/clang/inlineablemethods.cxx
+1
-2
inlinesimplememberfunctions.cxx
compilerplugins/clang/inlinesimplememberfunctions.cxx
+1
-2
passstuffbyref.cxx
compilerplugins/clang/passstuffbyref.cxx
+2
-4
plugin.cxx
compilerplugins/clang/plugin.cxx
+5
-0
plugin.hxx
compilerplugins/clang/plugin.hxx
+1
-0
salbool.cxx
compilerplugins/clang/salbool.cxx
+2
-6
staticmethods.cxx
compilerplugins/clang/staticmethods.cxx
+1
-1
constantfunction.cxx
compilerplugins/clang/store/constantfunction.cxx
+1
-1
removevirtuals.cxx
compilerplugins/clang/store/removevirtuals.cxx
+1
-2
returnbyref.cxx
compilerplugins/clang/store/returnbyref.cxx
+1
-2
unnecessaryvirtual.cxx
compilerplugins/clang/unnecessaryvirtual.cxx
+1
-2
unreffun.cxx
compilerplugins/clang/unreffun.cxx
+1
-3
unusedmethods.cxx
compilerplugins/clang/unusedmethods.cxx
+2
-3
unusedmethodsremove.cxx
compilerplugins/clang/unusedmethodsremove.cxx
+1
-2
No files found.
compilerplugins/clang/constantparam.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -100,7 +100,7 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde
if
(
ignoreLocation
(
functionDecl
))
return
;
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getLocation
())
))
if
(
isInUnoIncludeFile
(
functionDecl
))
return
;
SourceLocation
expansionLoc
=
compiler
.
getSourceManager
().
getExpansionLoc
(
functionDecl
->
getLocation
()
);
StringRef
filename
=
compiler
.
getSourceManager
().
getFilename
(
expansionLoc
);
...
...
compilerplugins/clang/constparams.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -52,8 +52,7 @@ bool ConstParams::VisitFunctionDecl(FunctionDecl * functionDecl)
return
true
;
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
// TODO ignore these for now, requires some extra work
...
...
compilerplugins/clang/countusersofdefaultparams.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -234,8 +234,7 @@ bool CountUsersOfDefaultParams::VisitFunctionDecl( const FunctionDecl* functionD
return
true
;
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
if
(
isa
<
CXXDestructorDecl
>
(
functionDecl
))
{
...
...
compilerplugins/clang/inlineablemethods.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -293,8 +293,7 @@ void InlineableMethods::functionTouchedFromExpr( const FunctionDecl* calleeFunct
bool
InlineableMethods
::
isCalleeFunctionInteresting
(
const
FunctionDecl
*
functionDecl
)
{
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
false
;
}
if
(
isa
<
CXXDestructorDecl
>
(
functionDecl
))
{
...
...
compilerplugins/clang/inlinesimplememberfunctions.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -71,8 +71,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
return
true
;
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
// ignore stuff like:
...
...
compilerplugins/clang/passstuffbyref.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -205,8 +205,7 @@ void PassStuffByRef::checkParams(const FunctionDecl * functionDecl) {
}
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
;
}
// these functions are passed as parameters to another function
...
...
@@ -245,8 +244,7 @@ void PassStuffByRef::checkReturnValue(const FunctionDecl * functionDecl, const C
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
;
}
loplugin
::
DeclCheck
dc
(
functionDecl
);
...
...
compilerplugins/clang/plugin.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -170,6 +170,11 @@ bool Plugin::isInUnoIncludeFile(SourceLocation spellingLocation) const {
||
name
.
startswith
(
WORKDIR
"/"
));
}
bool
Plugin
::
isInUnoIncludeFile
(
const
FunctionDecl
*
functionDecl
)
const
{
return
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
()));
}
namespace
{
class
ParentBuilder
...
...
compilerplugins/clang/plugin.hxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -75,6 +75,7 @@ class Plugin
which is not allowed to be changed.
*/
bool
isInUnoIncludeFile
(
SourceLocation
spellingLocation
)
const
;
bool
isInUnoIncludeFile
(
const
FunctionDecl
*
)
const
;
static
void
normalizeDotDotInFilePath
(
std
::
string
&
);
private
:
...
...
compilerplugins/clang/salbool.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -479,9 +479,7 @@ bool SalBool::VisitParmVarDecl(ParmVarDecl const * decl) {
if
(
f
!=
nullptr
)
{
// e.g.: typedef sal_Bool (* FuncPtr )( sal_Bool );
f
=
f
->
getCanonicalDecl
();
if
(
!
(
hasCLanguageLinkageType
(
f
)
||
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
f
->
getNameInfo
().
getLoc
()))
||
(
isInUnoIncludeFile
(
f
)
&&
(
!
f
->
isInlined
()
||
f
->
hasAttr
<
DeprecatedAttr
>
()
||
decl
->
getType
()
->
isReferenceType
()
||
hasBoolOverload
(
f
,
false
)))
...
...
@@ -654,9 +652,7 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) {
OverrideKind
k
=
getOverrideKind
(
f
);
if
(
k
!=
OverrideKind
::
YES
&&
!
(
hasCLanguageLinkageType
(
f
)
||
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
f
->
getNameInfo
().
getLoc
()))
||
(
isInUnoIncludeFile
(
f
)
&&
(
!
f
->
isInlined
()
||
f
->
hasAttr
<
DeprecatedAttr
>
()))))
{
SourceLocation
loc
{
decl
->
getLocStart
()
};
...
...
compilerplugins/clang/staticmethods.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -87,7 +87,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
if
(
isa
<
CXXConstructorDecl
>
(
pCXXMethodDecl
)
||
isa
<
CXXDestructorDecl
>
(
pCXXMethodDecl
)
||
isa
<
CXXConversionDecl
>
(
pCXXMethodDecl
))
{
return
true
;
}
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
pCXXMethodDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())
))
{
if
(
isInUnoIncludeFile
(
pCXXMethodDecl
))
{
return
true
;
}
if
(
pCXXMethodDecl
!=
pCXXMethodDecl
->
getCanonicalDecl
()
)
{
...
...
compilerplugins/clang/store/constantfunction.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -152,7 +152,7 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
return
true
;
}
SourceLocation
canonicalLoc
=
pFunctionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
();
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
canonicalLoc
)
))
{
if
(
isInUnoIncludeFile
(
pFunctionDecl
))
{
return
true
;
}
...
...
compilerplugins/clang/store/removevirtuals.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -97,8 +97,7 @@ bool RemoveVirtuals::VisitCXXMethodDecl( const CXXMethodDecl* functionDecl )
return
true
;
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
...
...
compilerplugins/clang/store/returnbyref.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -52,8 +52,7 @@ bool ReturnByRef::VisitCXXMethodDecl(const CXXMethodDecl * functionDecl) {
return
true
;
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
QualType
t1
{
compat
::
getReturnType
(
*
functionDecl
)
};
...
...
compilerplugins/clang/unnecessaryvirtual.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -154,8 +154,7 @@ bool UnnecessaryVirtual::VisitCXXMethodDecl( const CXXMethodDecl* methodDecl )
}
if
(
methodDecl
->
size_overridden_methods
()
==
0
)
{
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
methodDecl
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
methodDecl
))
{
return
true
;
}
// ignore templates and template instantiations,
...
...
compilerplugins/clang/unreffun.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -112,9 +112,7 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) {
||
!
(
canon
->
isDefined
()
?
decl
->
isThisDeclarationADefinition
()
:
decl
->
isFirstDecl
())
||
!
compiler
.
getSourceManager
().
isInMainFile
(
canon
->
getLocation
())
||
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
canon
->
getNameInfo
().
getLoc
()))
||
isInUnoIncludeFile
(
canon
)
||
canon
->
isMain
()
||
(
decl
->
getTemplatedKind
()
==
FunctionDecl
::
TK_FunctionTemplate
&&
(
decl
->
getDescribedFunctionTemplate
()
->
spec_begin
()
...
...
compilerplugins/clang/unusedmethods.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -312,12 +312,11 @@ bool UnusedMethods::VisitCXXConstructExpr( const CXXConstructExpr* constructExpr
bool
UnusedMethods
::
VisitFunctionDecl
(
const
FunctionDecl
*
functionDecl
)
{
const
FunctionDecl
*
canonicalFunctionDecl
=
functionDecl
->
getCanonicalDecl
();
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
canonicalFunctionDecl
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
const
FunctionDecl
*
canonicalFunctionDecl
=
functionDecl
->
getCanonicalDecl
();
if
(
isa
<
CXXDestructorDecl
>
(
functionDecl
))
{
return
true
;
}
...
...
compilerplugins/clang/unusedmethodsremove.cxx
Dosyayı görüntüle @
40fd53a2
...
...
@@ -102,8 +102,7 @@ bool UnusedMethodsRemove::VisitCXXMethodDecl( const CXXMethodDecl* functionDecl
return
true
;
}
// ignore stuff that forms part of the stable URE interface
if
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
functionDecl
->
getCanonicalDecl
()
->
getNameInfo
().
getLoc
())))
{
if
(
isInUnoIncludeFile
(
functionDecl
))
{
return
true
;
}
...
...
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