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
b4e5b8bc
Kaydet (Commit)
b4e5b8bc
authored
Nis 02, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add compat::isInMainFile
Change-Id: I0e155c6c68a43020110a8e1c0cb29cabdcade454
üst
9db717d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
compat.hxx
compilerplugins/clang/compat.hxx
+11
-0
literaltoboolconversion.cxx
compilerplugins/clang/literaltoboolconversion.cxx
+5
-11
No files found.
compilerplugins/clang/compat.hxx
Dosyayı görüntüle @
b4e5b8bc
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "clang/AST/Type.h"
#include "clang/AST/Type.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/raw_ostream.h"
...
@@ -101,6 +102,16 @@ inline unsigned getBuiltinCallee(clang::CallExpr const & expr) {
...
@@ -101,6 +102,16 @@ inline unsigned getBuiltinCallee(clang::CallExpr const & expr) {
#endif
#endif
}
}
inline
bool
isInMainFile
(
clang
::
SourceManager
const
&
manager
,
clang
::
SourceLocation
Loc
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
return
manager
.
isInMainFile
(
Loc
);
#else
return
manager
.
isFromMainFile
(
Loc
);
#endif
}
inline
unsigned
getCustomDiagID
(
inline
unsigned
getCustomDiagID
(
clang
::
DiagnosticsEngine
&
engine
,
clang
::
DiagnosticsEngine
::
Level
L
,
clang
::
DiagnosticsEngine
&
engine
,
clang
::
DiagnosticsEngine
::
Level
L
,
llvm
::
StringRef
FormatString
)
llvm
::
StringRef
FormatString
)
...
...
compilerplugins/clang/literaltoboolconversion.cxx
Dosyayı görüntüle @
b4e5b8bc
...
@@ -151,17 +151,11 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
...
@@ -151,17 +151,11 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
bool
LiteralToBoolConversion
::
isFromCIncludeFile
(
bool
LiteralToBoolConversion
::
isFromCIncludeFile
(
SourceLocation
spellingLocation
)
const
SourceLocation
spellingLocation
)
const
{
{
#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
return
!
compat
::
isInMainFile
(
compiler
.
getSourceManager
(),
spellingLocation
)
if
(
compiler
.
getSourceManager
().
isInMainFile
(
spellingLocation
))
{
&&
(
StringRef
(
return
false
;
compiler
.
getSourceManager
().
getPresumedLoc
(
spellingLocation
)
}
.
getFilename
())
#else
.
endswith
(
".h"
));
if
(
compiler
.
getSourceManager
().
isFromMainFile
(
spellingLocation
))
{
return
false
;
}
#endif
return
StringRef
(
compiler
.
getSourceManager
().
getPresumedLoc
(
spellingLocation
)
.
getFilename
()).
endswith
(
".h"
);
}
}
bool
LiteralToBoolConversion
::
isMacroBodyExpansion
(
SourceLocation
location
)
bool
LiteralToBoolConversion
::
isMacroBodyExpansion
(
SourceLocation
location
)
...
...
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