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
c15b4cf3
Kaydet (Commit)
c15b4cf3
authored
Agu 04, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapt to current Clang trunk towards 3.7
Change-Id: Ibb2c641d49a1773be789c9259f53a040db6f605f
üst
f17f89aa
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
12 deletions
+77
-12
compat.hxx
compilerplugins/clang/compat.hxx
+32
-0
implicitboolconversion.cxx
compilerplugins/clang/implicitboolconversion.cxx
+4
-0
inlinesimplememberfunctions.cxx
compilerplugins/clang/inlinesimplememberfunctions.cxx
+5
-5
refcounting.cxx
compilerplugins/clang/refcounting.cxx
+11
-1
staticmethods.cxx
compilerplugins/clang/staticmethods.cxx
+8
-2
unusedvariablecheck.cxx
compilerplugins/clang/unusedvariablecheck.cxx
+9
-2
vclwidgets.cxx
compilerplugins/clang/vclwidgets.cxx
+8
-2
No files found.
compilerplugins/clang/compat.hxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -65,6 +65,18 @@ inline bool isInExternCContext(clang::FunctionDecl const & decl) {
...
@@ -65,6 +65,18 @@ inline bool isInExternCContext(clang::FunctionDecl const & decl) {
#endif
#endif
}
}
inline
bool
forallBases
(
clang
::
CXXRecordDecl
const
&
decl
,
clang
::
CXXRecordDecl
::
ForallBasesCallback
BaseMatches
,
bool
AllowShortCircuit
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
return
decl
.
forallBases
(
BaseMatches
,
AllowShortCircuit
);
#else
return
decl
.
forallBases
(
BaseMatches
,
nullptr
,
AllowShortCircuit
);
#endif
}
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
typedef
clang
::
LinkageInfo
LinkageInfo
;
typedef
clang
::
LinkageInfo
LinkageInfo
;
#else
#else
...
@@ -129,6 +141,26 @@ inline clang::QualType getParamType(
...
@@ -129,6 +141,26 @@ inline clang::QualType getParamType(
#endif
#endif
}
}
inline
clang
::
Stmt
::
const_child_iterator
begin
(
clang
::
Stmt
::
const_child_range
const
&
range
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
return
range
.
begin
();
#else
return
range
.
first
;
#endif
}
inline
clang
::
Stmt
::
const_child_iterator
end
(
clang
::
Stmt
::
const_child_range
const
&
range
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
return
range
.
end
();
#else
return
range
.
second
;
#endif
}
inline
unsigned
getBuiltinCallee
(
clang
::
CallExpr
const
&
expr
)
{
inline
unsigned
getBuiltinCallee
(
clang
::
CallExpr
const
&
expr
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3
#if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3
return
expr
.
getBuiltinCallee
();
return
expr
.
getBuiltinCallee
();
...
...
compilerplugins/clang/implicitboolconversion.cxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
#include "compat.hxx"
#include "compat.hxx"
#include "plugin.hxx"
#include "plugin.hxx"
#if __clang_major__ == 3 && __clang_minor__ < 7
template
<>
struct
std
::
iterator_traits
<
ExprIterator
>
{
template
<>
struct
std
::
iterator_traits
<
ExprIterator
>
{
typedef
std
::
ptrdiff_t
difference_type
;
typedef
std
::
ptrdiff_t
difference_type
;
typedef
Expr
*
value_type
;
typedef
Expr
*
value_type
;
...
@@ -34,6 +36,8 @@ template<> struct std::iterator_traits<ConstExprIterator> {
...
@@ -34,6 +36,8 @@ template<> struct std::iterator_traits<ConstExprIterator> {
typedef
std
::
random_access_iterator_tag
iterator_category
;
typedef
std
::
random_access_iterator_tag
iterator_category
;
};
};
#endif
namespace
{
namespace
{
Expr
const
*
ignoreParenAndTemporaryMaterialization
(
Expr
const
*
expr
)
{
Expr
const
*
ignoreParenAndTemporaryMaterialization
(
Expr
const
*
expr
)
{
...
...
compilerplugins/clang/inlinesimplememberfunctions.cxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -31,10 +31,10 @@ private:
...
@@ -31,10 +31,10 @@ private:
};
};
static
bool
oneAndOnlyOne
(
clang
::
Stmt
::
const_child_range
range
)
{
static
bool
oneAndOnlyOne
(
clang
::
Stmt
::
const_child_range
range
)
{
if
(
range
.
empty
(
))
{
if
(
compat
::
begin
(
range
)
==
compat
::
end
(
range
))
{
return
false
;
return
false
;
}
}
if
(
(
++
range
.
first
)
!=
range
.
second
)
{
if
(
++
compat
::
begin
(
range
)
!=
compat
::
end
(
range
)
)
{
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -134,7 +134,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
...
@@ -134,7 +134,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
{
{
childStmt2
=
*
childStmt2
->
child_begin
();
childStmt2
=
*
childStmt2
->
child_begin
();
if
(
dyn_cast
<
CXXThisExpr
>
(
childStmt2
)
!=
nullptr
if
(
dyn_cast
<
CXXThisExpr
>
(
childStmt2
)
!=
nullptr
&&
c
hildStmt2
->
children
().
empty
(
))
&&
c
ompat
::
begin
(
childStmt2
->
children
())
==
compat
::
end
(
childStmt2
->
children
()
))
{
{
return
true
;
return
true
;
}
}
...
@@ -145,7 +145,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
...
@@ -145,7 +145,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
{
{
const
Stmt
*
childStmt2
=
*
childStmt
->
child_begin
();
const
Stmt
*
childStmt2
=
*
childStmt
->
child_begin
();
if
(
dyn_cast
<
CXXThisExpr
>
(
childStmt2
)
!=
nullptr
if
(
dyn_cast
<
CXXThisExpr
>
(
childStmt2
)
!=
nullptr
&&
c
hildStmt2
->
children
().
empty
(
))
&&
c
ompat
::
begin
(
childStmt2
->
children
())
==
compat
::
end
(
childStmt2
->
children
()
))
{
{
return
true
;
return
true
;
}
}
...
@@ -208,7 +208,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
...
@@ -208,7 +208,7 @@ bool InlineSimpleMemberFunctions::VisitCXXMethodDecl(const CXXMethodDecl * funct
}
}
return
true
;
return
true
;
}
}
if
(
c
hildStmt
->
children
().
empty
(
)
)
if
(
c
ompat
::
begin
(
childStmt
->
children
())
==
compat
::
end
(
childStmt
->
children
()
)
)
return
true
;
return
true
;
childStmt
=
*
childStmt
->
child_begin
();
childStmt
=
*
childStmt
->
child_begin
();
}
}
...
...
compilerplugins/clang/refcounting.cxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -73,7 +73,17 @@ bool isDerivedFrom(const CXXRecordDecl *decl, const char *pString) {
...
@@ -73,7 +73,17 @@ bool isDerivedFrom(const CXXRecordDecl *decl, const char *pString) {
if
(
// not sure what hasAnyDependentBases() does,
if
(
// not sure what hasAnyDependentBases() does,
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
forallBases
(
BaseCheckNotSubclass
,
static_cast
<
void
*>
(
const_cast
<
char
*>
(
pString
)),
true
))
{
!
compat
::
forallBases
(
*
decl
,
#if __clang_major__ == 3 && __clang_minor__ < 7
BaseCheckNotSubclass
,
#else
[
pString
](
const
CXXRecordDecl
*
BaseDefinition
)
->
bool
{
return
BaseCheckNotSubclass
(
BaseDefinition
,
const_cast
<
char
*>
(
pString
));
},
#endif
true
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
compilerplugins/clang/staticmethods.cxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -36,7 +36,13 @@ private:
...
@@ -36,7 +36,13 @@ private:
std
::
string
getFilename
(
SourceLocation
loc
);
std
::
string
getFilename
(
SourceLocation
loc
);
};
};
bool
BaseCheckNotTestFixtureSubclass
(
const
CXXRecordDecl
*
BaseDefinition
,
void
*
)
{
bool
BaseCheckNotTestFixtureSubclass
(
const
CXXRecordDecl
*
BaseDefinition
#if __clang_major__ == 3 && __clang_minor__ < 7
,
void
*
#endif
)
{
if
(
BaseDefinition
->
getQualifiedNameAsString
().
compare
(
"CppUnit::TestFixture"
)
==
0
)
{
if
(
BaseDefinition
->
getQualifiedNameAsString
().
compare
(
"CppUnit::TestFixture"
)
==
0
)
{
return
false
;
return
false
;
}
}
...
@@ -49,7 +55,7 @@ bool isDerivedFromTestFixture(const CXXRecordDecl *decl) {
...
@@ -49,7 +55,7 @@ bool isDerivedFromTestFixture(const CXXRecordDecl *decl) {
if
(
// not sure what hasAnyDependentBases() does,
if
(
// not sure what hasAnyDependentBases() does,
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
forallBases
(
BaseCheckNotTestFixtureSubclass
,
nullptr
,
true
))
{
!
compat
::
forallBases
(
*
decl
,
BaseCheckNotTestFixtureSubclass
,
true
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
compilerplugins/clang/unusedvariablecheck.cxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
// (LO classes won't get duplicated warnings, as the attribute is different).
// (LO classes won't get duplicated warnings, as the attribute is different).
#if !HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL
#if !HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL
#include "compat.hxx"
#include "unusedvariablecheck.hxx"
#include "unusedvariablecheck.hxx"
#include <clang/AST/Attr.h>
#include <clang/AST/Attr.h>
...
@@ -48,7 +49,13 @@ void UnusedVariableCheck::run()
...
@@ -48,7 +49,13 @@ void UnusedVariableCheck::run()
TraverseDecl
(
compiler
.
getASTContext
().
getTranslationUnitDecl
());
TraverseDecl
(
compiler
.
getASTContext
().
getTranslationUnitDecl
());
}
}
bool
BaseCheckNotDialogSubclass
(
const
CXXRecordDecl
*
BaseDefinition
,
void
*
)
{
bool
BaseCheckNotDialogSubclass
(
const
CXXRecordDecl
*
BaseDefinition
#if __clang_major__ == 3 && __clang_minor__ < 7
,
void
*
#endif
)
{
if
(
BaseDefinition
&&
BaseDefinition
->
getQualifiedNameAsString
().
compare
(
"Dialog"
)
==
0
)
{
if
(
BaseDefinition
&&
BaseDefinition
->
getQualifiedNameAsString
().
compare
(
"Dialog"
)
==
0
)
{
return
false
;
return
false
;
}
}
...
@@ -66,7 +73,7 @@ bool isDerivedFromDialog(const CXXRecordDecl *decl) {
...
@@ -66,7 +73,7 @@ bool isDerivedFromDialog(const CXXRecordDecl *decl) {
if
(
// not sure what hasAnyDependentBases() does,
if
(
// not sure what hasAnyDependentBases() does,
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
forallBases
(
BaseCheckNotDialogSubclass
,
nullptr
,
true
))
{
!
compat
::
forallBases
(
*
decl
,
BaseCheckNotDialogSubclass
,
true
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
compilerplugins/clang/vclwidgets.cxx
Dosyayı görüntüle @
c15b4cf3
...
@@ -57,7 +57,13 @@ static bool startsWith(const std::string& s, const char* other)
...
@@ -57,7 +57,13 @@ static bool startsWith(const std::string& s, const char* other)
return
s
.
compare
(
0
,
strlen
(
other
),
other
)
==
0
;
return
s
.
compare
(
0
,
strlen
(
other
),
other
)
==
0
;
}
}
bool
BaseCheckNotWindowSubclass
(
const
CXXRecordDecl
*
BaseDefinition
,
void
*
)
{
bool
BaseCheckNotWindowSubclass
(
const
CXXRecordDecl
*
BaseDefinition
#if __clang_major__ == 3 && __clang_minor__ < 7
,
void
*
#endif
)
{
if
(
BaseDefinition
&&
BaseDefinition
->
getQualifiedNameAsString
()
==
"OutputDevice"
)
{
if
(
BaseDefinition
&&
BaseDefinition
->
getQualifiedNameAsString
()
==
"OutputDevice"
)
{
return
false
;
return
false
;
}
}
...
@@ -75,7 +81,7 @@ bool isDerivedFromWindow(const CXXRecordDecl *decl) {
...
@@ -75,7 +81,7 @@ bool isDerivedFromWindow(const CXXRecordDecl *decl) {
if
(
// not sure what hasAnyDependentBases() does,
if
(
// not sure what hasAnyDependentBases() does,
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
hasAnyDependentBases
()
&&
!
decl
->
forallBases
(
BaseCheckNotWindowSubclass
,
nullptr
,
true
))
{
!
compat
::
forallBases
(
*
decl
,
BaseCheckNotWindowSubclass
,
true
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
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