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
78ad5ecd
Kaydet (Commit)
78ad5ecd
authored
Mar 28, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up isMacroBodyExpansion
Change-Id: I745b320dd5f44d54371d8a0b961c49793e3e0ad6
üst
c1434d68
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
25 deletions
+3
-25
compat.hxx
compilerplugins/clang/compat.hxx
+0
-11
literaltoboolconversion.cxx
compilerplugins/clang/literaltoboolconversion.cxx
+1
-1
salbool.cxx
compilerplugins/clang/salbool.cxx
+1
-12
staticmethods.cxx
compilerplugins/clang/staticmethods.cxx
+1
-1
No files found.
compilerplugins/clang/compat.hxx
Dosyayı görüntüle @
78ad5ecd
...
@@ -221,17 +221,6 @@ inline bool isMacroBodyExpansion(clang::CompilerInstance& compiler, clang::Sourc
...
@@ -221,17 +221,6 @@ inline bool isMacroBodyExpansion(clang::CompilerInstance& compiler, clang::Sourc
#endif
#endif
}
}
}
inline
bool
isMacroBodyExpansion
(
clang
::
CompilerInstance
&
compiler
,
clang
::
SourceLocation
location
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return
compiler
.
getSourceManager
().
isMacroBodyExpansion
(
location
);
#else
return
location
.
isMacroID
()
&&
!
compiler
.
getSourceManager
().
isMacroArgExpansion
(
location
);
#endif
}
}
#endif
#endif
...
...
compilerplugins/clang/literaltoboolconversion.cxx
Dosyayı görüntüle @
78ad5ecd
...
@@ -62,7 +62,7 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
...
@@ -62,7 +62,7 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
);
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
);
}
}
if
(
isMacroBodyExpansion
(
compiler
,
loc
))
{
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
loc
))
{
StringRef
name
{
Lexer
::
getImmediateMacroName
(
StringRef
name
{
Lexer
::
getImmediateMacroName
(
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
};
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
};
if
(
name
==
"sal_False"
||
name
==
"sal_True"
)
{
if
(
name
==
"sal_False"
||
name
==
"sal_True"
)
{
...
...
compilerplugins/clang/salbool.cxx
Dosyayı görüntüle @
78ad5ecd
...
@@ -153,8 +153,6 @@ public:
...
@@ -153,8 +153,6 @@ public:
private
:
private
:
bool
isInSpecialMainFile
(
SourceLocation
spellingLocation
)
const
;
bool
isInSpecialMainFile
(
SourceLocation
spellingLocation
)
const
;
bool
isMacroBodyExpansion
(
SourceLocation
location
)
const
;
bool
rewrite
(
SourceLocation
location
);
bool
rewrite
(
SourceLocation
location
);
std
::
set
<
VarDecl
const
*>
varDecls_
;
std
::
set
<
VarDecl
const
*>
varDecls_
;
...
@@ -274,7 +272,7 @@ bool SalBool::VisitCStyleCastExpr(CStyleCastExpr * expr) {
...
@@ -274,7 +272,7 @@ bool SalBool::VisitCStyleCastExpr(CStyleCastExpr * expr) {
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
while
(
compiler
.
getSourceManager
().
isMacroArgExpansion
(
loc
))
{
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
);
loc
=
compiler
.
getSourceManager
().
getImmediateMacroCallerLoc
(
loc
);
}
}
if
(
isMacroBodyExpansion
(
loc
))
{
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
loc
))
{
StringRef
name
{
Lexer
::
getImmediateMacroName
(
StringRef
name
{
Lexer
::
getImmediateMacroName
(
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
};
loc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
};
if
(
name
==
"sal_False"
||
name
==
"sal_True"
)
{
if
(
name
==
"sal_False"
||
name
==
"sal_True"
)
{
...
@@ -580,15 +578,6 @@ bool SalBool::isInSpecialMainFile(SourceLocation spellingLocation) const {
...
@@ -580,15 +578,6 @@ bool SalBool::isInSpecialMainFile(SourceLocation spellingLocation) const {
==
SRCDIR
"/cppu/qa/test_any.cxx"
);
==
SRCDIR
"/cppu/qa/test_any.cxx"
);
}
}
bool
SalBool
::
isMacroBodyExpansion
(
SourceLocation
location
)
const
{
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return
compiler
.
getSourceManager
().
isMacroBodyExpansion
(
location
);
#else
return
location
.
isMacroID
()
&&
!
compiler
.
getSourceManager
().
isMacroArgExpansion
(
location
);
#endif
}
bool
SalBool
::
rewrite
(
SourceLocation
location
)
{
bool
SalBool
::
rewrite
(
SourceLocation
location
)
{
if
(
rewriter
!=
nullptr
)
{
if
(
rewriter
!=
nullptr
)
{
//TODO: "::sal_Bool" -> "bool", not "::bool"
//TODO: "::sal_Bool" -> "bool", not "::bool"
...
...
compilerplugins/clang/staticmethods.cxx
Dosyayı görüntüle @
78ad5ecd
...
@@ -84,7 +84,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
...
@@ -84,7 +84,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
// leave these alone for now, it is possible to fix them, but I don't understand how
// leave these alone for now, it is possible to fix them, but I don't understand how
SourceLocation
canonicalLoc
=
pCXXMethodDecl
->
getCanonicalDecl
()
->
getLocStart
();
SourceLocation
canonicalLoc
=
pCXXMethodDecl
->
getCanonicalDecl
()
->
getLocStart
();
if
(
isMacroBodyExpansion
(
compiler
,
canonicalLoc
)
)
{
if
(
compat
::
isMacroBodyExpansion
(
compiler
,
canonicalLoc
)
)
{
StringRef
name
{
Lexer
::
getImmediateMacroName
(
StringRef
name
{
Lexer
::
getImmediateMacroName
(
canonicalLoc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
};
canonicalLoc
,
compiler
.
getSourceManager
(),
compiler
.
getLangOpts
())
};
if
(
name
==
"DECL_LINK"
)
{
if
(
name
==
"DECL_LINK"
)
{
...
...
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