Kaydet (Commit) 17a8a03a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Add some debug checks to loplugin:salcall

Change-Id: I27b7281723dd705e4304958458be3ea2fee7f3e6
Reviewed-on: https://gerrit.libreoffice.org/46112Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 959ecc99
......@@ -383,6 +383,12 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation
auto const TSI = functionDecl->getTypeSourceInfo();
if (TSI == nullptr)
{
if (isDebugMode())
{
report(DiagnosticsEngine::Fatal, "TODO: unexpected failure #1, needs investigation",
functionDecl->getLocation())
<< functionDecl->getSourceRange();
}
return false;
}
auto TL = TSI->getTypeLoc().IgnoreParens();
......@@ -488,8 +494,21 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation
}
if (startLoc.isInvalid() || endLoc.isInvalid())
//TODO: should probably not happen
{
if (isDebugMode())
{
report(DiagnosticsEngine::Fatal, "TODO: unexpected failure #2, needs investigation",
functionDecl->getLocation())
<< functionDecl->getSourceRange();
}
return false;
}
if (isDebugMode() && startLoc != endLoc && !SM.isBeforeInTranslationUnit(startLoc, endLoc))
{
report(DiagnosticsEngine::Fatal, "TODO: unexpected failure #3, needs investigation",
functionDecl->getLocation())
<< functionDecl->getSourceRange();
}
SourceLocation found;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment