Kaydet (Commit) 50f35e5b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix for compilerplugins/clang/test/salcall.cxx with clang-cl

Change-Id: I6e58b6bf0d10297ed3ac20de25c1eea42c9f2334
Reviewed-on: https://gerrit.libreoffice.org/46844Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 6fc7f85d
...@@ -498,6 +498,9 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation ...@@ -498,6 +498,9 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation
} }
} }
#if defined _WIN32
auto const macroExpansion = SM.getExpansionLoc(endLoc);
#endif
endLoc = SM.getSpellingLoc(endLoc); endLoc = SM.getSpellingLoc(endLoc);
// Ctors/dtors/conversion functions don't have a return type, start searching for "SAL_CALL" // Ctors/dtors/conversion functions don't have a return type, start searching for "SAL_CALL"
...@@ -515,7 +518,17 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation ...@@ -515,7 +518,17 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation
#endif #endif
startLoc = SM.getSpellingLoc(startLoc); startLoc = SM.getSpellingLoc(startLoc);
#if !defined _WIN32 #if defined _WIN32
if (macroRange.isValid()
&& !compat::isPointWithin(SM, startLoc, macroRange.getBegin(), macroRange.getEnd()))
{
// endLoc is within a macro body but startLoc is not; two source ranges, first is from
// startLoc to the macro invocation, second is the leading part of the corresponding
// macro definition's replacement text:
ranges.emplace_back(startLoc, macroExpansion);
startLoc = macroRange.getBegin();
}
#else
// When the SAL_CALL macro expands to nothing, it may even precede the function // When the SAL_CALL macro expands to nothing, it may even precede the function
// declaration's source range, so go back one token (unless the declaration is known to // declaration's source range, so go back one token (unless the declaration is known to
// start with a token that must precede a possible "SAL_CALL", like "virtual" or // start with a token that must precede a possible "SAL_CALL", like "virtual" or
......
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