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
9308f353
Kaydet (Commit)
9308f353
authored
Haz 28, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapt to Clang 3.4 (in preparation of a buildbot on CentOS 7)
Change-Id: Ie2859f03b31c57deb7fd0deba3285f782e33b239
üst
36936d5a
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
55 additions
and
18 deletions
+55
-18
compat.hxx
compilerplugins/clang/compat.hxx
+21
-0
faileddyncast.cxx
compilerplugins/clang/faileddyncast.cxx
+1
-0
implicitboolconversion.cxx
compilerplugins/clang/implicitboolconversion.cxx
+6
-2
passstuffbyref.cxx
compilerplugins/clang/passstuffbyref.cxx
+1
-1
privatebase.cxx
compilerplugins/clang/privatebase.cxx
+4
-4
refcounting.cxx
compilerplugins/clang/refcounting.cxx
+1
-1
singlevalfields.cxx
compilerplugins/clang/singlevalfields.cxx
+3
-3
staticmethods.cxx
compilerplugins/clang/staticmethods.cxx
+2
-0
typecheck.cxx
compilerplugins/clang/typecheck.cxx
+2
-1
unuseddefaultparams.cxx
compilerplugins/clang/unuseddefaultparams.cxx
+2
-0
unusedmethods.cxx
compilerplugins/clang/unusedmethods.cxx
+4
-1
vclwidgets.cxx
compilerplugins/clang/vclwidgets.cxx
+5
-3
weakobject.cxx
compilerplugins/clang/weakobject.cxx
+3
-2
No files found.
compilerplugins/clang/compat.hxx
Dosyayı görüntüle @
9308f353
...
...
@@ -323,6 +323,27 @@ inline auto getAsTagDecl(clang::Type const& t) -> clang::TagDecl *
#endif
}
inline
bool
isStdNamespace
(
clang
::
DeclContext
const
&
context
)
{
#if CLANG_VERSION >= 30500
return
context
.
isStdNamespace
();
#else
// cf. lib/AST/DeclBase.cpp:
if
(
!
context
.
isNamespace
())
{
return
false
;
}
const
clang
::
NamespaceDecl
*
ND
=
clang
::
cast
<
clang
::
NamespaceDecl
>
(
&
context
);
if
(
ND
->
isInline
())
{
return
isStdNamespace
(
*
ND
->
getParent
());
}
if
(
!
context
.
getParent
()
->
getRedeclContext
()
->
isTranslationUnit
())
{
return
false
;
}
const
clang
::
IdentifierInfo
*
II
=
ND
->
getIdentifier
();
return
II
&&
II
->
isStr
(
"std"
);
#endif
}
}
#endif
...
...
compilerplugins/clang/faileddyncast.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -9,6 +9,7 @@
#include <algorithm>
#include "clang/AST/Attr.h"
#include "clang/AST/CXXInheritance.h"
#include "plugin.hxx"
...
...
compilerplugins/clang/implicitboolconversion.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -21,7 +21,9 @@
#if CLANG_VERSION < 30700
template
<>
struct
std
::
iterator_traits
<
ExprIterator
>
{
namespace
std
{
template
<>
struct
iterator_traits
<
ExprIterator
>
{
typedef
std
::
ptrdiff_t
difference_type
;
typedef
Expr
*
value_type
;
typedef
Expr
const
**
pointer
;
...
...
@@ -29,7 +31,7 @@ template<> struct std::iterator_traits<ExprIterator> {
typedef
std
::
random_access_iterator_tag
iterator_category
;
};
template
<>
struct
std
::
iterator_traits
<
ConstExprIterator
>
{
template
<>
struct
iterator_traits
<
ConstExprIterator
>
{
typedef
std
::
ptrdiff_t
difference_type
;
typedef
Expr
const
*
value_type
;
typedef
Expr
const
**
pointer
;
...
...
@@ -37,6 +39,8 @@ template<> struct std::iterator_traits<ConstExprIterator> {
typedef
std
::
random_access_iterator_tag
iterator_category
;
};
}
#endif
namespace
{
...
...
compilerplugins/clang/passstuffbyref.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -231,7 +231,7 @@ void PassStuffByRef::checkReturnValue(const FunctionDecl * functionDecl, const C
return
;
}
const
QualType
type
=
functionDecl
->
getReturnType
(
).
getDesugaredType
(
compiler
.
getASTContext
());
const
QualType
type
=
compat
::
getReturnType
(
*
functionDecl
).
getDesugaredType
(
compiler
.
getASTContext
());
if
(
type
->
isReferenceType
()
||
type
->
isIntegralOrEnumerationType
()
||
type
->
isPointerType
()
||
type
->
isTemplateTypeParmType
()
||
type
->
isDependentType
()
||
type
->
isBuiltinType
()
||
type
->
isScalarType
())
...
...
compilerplugins/clang/privatebase.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -34,14 +34,14 @@ bool PrivateBase::VisitCXXRecordDecl(CXXRecordDecl const * decl) {
{
return
true
;
}
for
(
auto
const
&
i
:
decl
->
bases
()
)
{
if
(
i
.
getAccessSpecifierAsWritten
()
==
AS_none
)
{
for
(
auto
i
=
decl
->
bases_begin
();
i
!=
decl
->
bases_end
();
++
i
)
{
if
(
i
->
getAccessSpecifierAsWritten
()
==
AS_none
)
{
report
(
DiagnosticsEngine
::
Warning
,
"base class is private by default; explicitly give an access"
" specifier"
,
i
.
getLocStart
())
<<
i
.
getSourceRange
();
i
->
getLocStart
())
<<
i
->
getSourceRange
();
}
}
return
true
;
...
...
compilerplugins/clang/refcounting.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -427,7 +427,7 @@ bool RefCounting::VisitFunctionDecl(const FunctionDecl * functionDecl) {
if
(
methodDecl
&&
methodDecl
->
size_overridden_methods
()
>
0
)
{
return
true
;
}
checkUnoReference
(
functionDecl
->
getReturnType
(
),
functionDecl
,
""
,
"return"
);
checkUnoReference
(
compat
::
getReturnType
(
*
functionDecl
),
functionDecl
,
""
,
"return"
);
return
true
;
}
...
...
compilerplugins/clang/singlevalfields.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -258,7 +258,7 @@ bool SingleValFields::VisitMemberExpr( const MemberExpr* memberExpr )
if
(
parent
&&
isa
<
ReturnStmt
>
(
parent
))
{
const
Stmt
*
parent2
=
parentStmt
(
parent
);
if
(
parent2
&&
isa
<
CompoundStmt
>
(
parent2
))
{
QualType
qt
=
parentFunction
->
getReturnType
(
).
getDesugaredType
(
compiler
.
getASTContext
());
QualType
qt
=
compat
::
getReturnType
(
*
parentFunction
).
getDesugaredType
(
compiler
.
getASTContext
());
if
(
!
qt
.
isConstQualified
()
&&
qt
->
isReferenceType
())
{
assignValue
=
"?"
;
bPotentiallyAssignedTo
=
true
;
...
...
@@ -443,10 +443,10 @@ void SingleValFields::checkCallExpr(const Stmt* child, const CallExpr* callExpr,
return
;
}
for
(
unsigned
i
=
0
;
i
<
callExpr
->
getNumArgs
();
++
i
)
{
if
(
i
>=
proto
->
getNumParams
(
))
// can happen in template code
if
(
i
>=
compat
::
getNumParams
(
*
proto
))
// can happen in template code
break
;
if
(
callExpr
->
getArg
(
i
)
==
child
)
{
QualType
qt
=
proto
->
getParamTypes
()[
i
]
.
getDesugaredType
(
compiler
.
getASTContext
());
QualType
qt
=
compat
::
getParamType
(
*
proto
,
i
)
.
getDesugaredType
(
compiler
.
getASTContext
());
if
(
!
qt
.
isConstQualified
()
&&
qt
->
isReferenceType
())
{
assignValue
=
"?"
;
bPotentiallyAssignedTo
=
true
;
...
...
compilerplugins/clang/staticmethods.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "clang/AST/Attr.h"
#include "plugin.hxx"
#include "compat.hxx"
...
...
compilerplugins/clang/typecheck.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -81,7 +81,8 @@ TerminalCheck NamespaceCheck::GlobalNamespace() const {
}
TerminalCheck
NamespaceCheck
::
StdNamespace
()
const
{
return
TerminalCheck
(
context_
!=
nullptr
&&
context_
->
isStdNamespace
());
return
TerminalCheck
(
context_
!=
nullptr
&&
compat
::
isStdNamespace
(
*
context_
));
}
}
...
...
compilerplugins/clang/unuseddefaultparams.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -12,6 +12,8 @@
#include <iostream>
#include <fstream>
#include "clang/AST/Attr.h"
#include "plugin.hxx"
#include "compat.hxx"
...
...
compilerplugins/clang/unusedmethods.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -12,6 +12,9 @@
#include <iostream>
#include <fstream>
#include <set>
#include "clang/AST/Attr.h"
#include "plugin.hxx"
#include "compat.hxx"
...
...
@@ -265,7 +268,7 @@ gotfunc:
}
// Now do the checks necessary for the "unused return value" analysis
if
(
c
alleeFunctionDecl
->
getReturnType
(
)
->
isVoidType
())
{
if
(
c
ompat
::
getReturnType
(
*
calleeFunctionDecl
)
->
isVoidType
())
{
return
true
;
}
if
(
!
parent
)
{
...
...
compilerplugins/clang/vclwidgets.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -205,9 +205,11 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
if
(
pCompoundStatement
)
{
bool
bFoundDisposeOnce
=
false
;
int
nNumExtraStatements
=
0
;
for
(
auto
const
*
x
:
pCompoundStatement
->
body
())
for
(
auto
i
=
pCompoundStatement
->
body_begin
();
i
!=
pCompoundStatement
->
body_end
();
++
i
)
{
const
CXXMemberCallExpr
*
pCallExpr
=
dyn_cast
<
CXXMemberCallExpr
>
(
x
);
const
CXXMemberCallExpr
*
pCallExpr
=
dyn_cast
<
CXXMemberCallExpr
>
(
*
i
);
if
(
pCallExpr
)
{
if
(
const
FunctionDecl
*
func
=
pCallExpr
->
getDirectCallee
())
{
if
(
func
->
getNumParams
()
==
0
&&
func
->
getIdentifier
()
!=
NULL
...
...
@@ -217,7 +219,7 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
}
}
// checking for ParenExpr is a hacky way to ignore assert statements in older versions of clang (i.e. <= 3.2)
if
(
!
pCallExpr
&&
!
dyn_cast
<
ParenExpr
>
(
x
))
if
(
!
pCallExpr
&&
!
dyn_cast
<
ParenExpr
>
(
*
i
))
nNumExtraStatements
++
;
}
bOk
=
bFoundDisposeOnce
&&
nNumExtraStatements
==
0
;
...
...
compilerplugins/clang/weakobject.cxx
Dosyayı görüntüle @
9308f353
...
...
@@ -98,10 +98,11 @@ public:
}
CompoundStmt
const
*
const
pCompoundStatement
(
dyn_cast
<
CompoundStmt
>
(
pMethodDecl
->
getBody
()));
for
(
auto
const
pStmt
:
pCompoundStatement
->
body
())
for
(
auto
i
=
pCompoundStatement
->
body_begin
();
i
!=
pCompoundStatement
->
body_end
();
++
i
)
{
// note: this is not a CXXMemberCallExpr
CallExpr
const
*
const
pCallExpr
(
dyn_cast
<
CallExpr
>
(
pStmt
));
CallExpr
const
*
const
pCallExpr
(
dyn_cast
<
CallExpr
>
(
*
i
));
if
(
pCallExpr
)
{
// note: this is only sometimes a CXXMethodDecl
...
...
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