File indexing completed on 2024-04-06 12:31:50
0001
0002
0003
0004
0005
0006
0007 #include "CmsException.h"
0008 #include "CmsSupport.h"
0009
0010 namespace clangcms {
0011
0012 bool CmsException::reportGeneral(clang::ento::PathDiagnosticLocation const& path,
0013 clang::ento::BugReporter& BR) const {
0014 const char* sfile = BR.getSourceManager().getPresumedLoc(path.asLocation()).getFilename();
0015 if ((!sfile) || (!support::isCmsLocalFile(sfile)))
0016 return false;
0017 return true;
0018 }
0019
0020 bool CmsException::reportConstCast(const clang::ento::BugReport& R, clang::ento::CheckerContext& C) const {
0021 clang::ento::BugReporter& BR = C.getBugReporter();
0022 const clang::SourceManager& SM = BR.getSourceManager();
0023 clang::ento::PathDiagnosticLocation const& path = R.getLocation();
0024 return reportGeneral(path, BR);
0025 }
0026
0027 bool CmsException::reportConstCastAway(const clang::ento::BugReport& R, clang::ento::CheckerContext& C) const {
0028 clang::ento::BugReporter& BR = C.getBugReporter();
0029 const clang::SourceManager& SM = BR.getSourceManager();
0030 clang::ento::PathDiagnosticLocation const& path = R.getLocation();
0031 return reportGeneral(path, BR);
0032 }
0033
0034 bool CmsException::reportGlobalStatic(clang::QualType const& t,
0035 clang::ento::PathDiagnosticLocation const& path,
0036 clang::ento::BugReporter& BR) const {
0037 return reportGeneral(path, BR);
0038 }
0039
0040 bool CmsException::reportMutableMember(clang::QualType const& t,
0041 clang::ento::PathDiagnosticLocation const& path,
0042 clang::ento::BugReporter& BR) const {
0043 return reportGeneral(path, BR);
0044 }
0045
0046 bool CmsException::reportClass(clang::ento::PathDiagnosticLocation const& path, clang::ento::BugReporter& BR) const {
0047 return reportGeneral(path, BR);
0048 }
0049
0050 bool CmsException::reportGlobalStaticForType(clang::QualType const& t,
0051 clang::ento::PathDiagnosticLocation const& path,
0052 clang::ento::BugReporter& BR) const {
0053 return reportGeneral(path, BR);
0054 }
0055 }