mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-14 04:02:16 +00:00
Fix compilation error on MSYS2 systems
This commit is contained in:
parent
16d1f6b002
commit
83b22013e3
@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
|
#define __STDC_FORMAT_MACROS
|
||||||
|
|
||||||
#include "indexer.h"
|
#include "indexer.h"
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
@ -762,8 +764,8 @@ public:
|
|||||||
switch (D->getKind()) {
|
switch (D->getKind()) {
|
||||||
case Decl::CXXConversion: // *operator* int => *operator int*
|
case Decl::CXXConversion: // *operator* int => *operator int*
|
||||||
case Decl::CXXDestructor: // *~*A => *~A*
|
case Decl::CXXDestructor: // *~*A => *~A*
|
||||||
case Decl::CXXMethod: // *operator*= => *operator=*
|
case Decl::CXXMethod: // *operator*= => *operator=*
|
||||||
case Decl::Function: // operator delete
|
case Decl::Function: // operator delete
|
||||||
if (Loc.isFileID()) {
|
if (Loc.isFileID()) {
|
||||||
SourceRange R =
|
SourceRange R =
|
||||||
cast<FunctionDecl>(OrigD)->getNameInfo().getSourceRange();
|
cast<FunctionDecl>(OrigD)->getNameInfo().getSourceRange();
|
||||||
@ -793,7 +795,7 @@ public:
|
|||||||
GetSymbolKind(cast<Decl>(SemDC), entity->def.parent_kind);
|
GetSymbolKind(cast<Decl>(SemDC), entity->def.parent_kind);
|
||||||
} else if (is_decl) {
|
} else if (is_decl) {
|
||||||
DeclRef &dr = entity->declarations.emplace_back();
|
DeclRef &dr = entity->declarations.emplace_back();
|
||||||
static_cast<Use&>(dr) = {{loc, role}, lid};
|
static_cast<Use &>(dr) = {{loc, role}, lid};
|
||||||
SourceRange R = OrigD->getSourceRange();
|
SourceRange R = OrigD->getSourceRange();
|
||||||
dr.extent = R.getBegin().isFileID() ? FromTokenRange(SM, Lang, R) : loc;
|
dr.extent = R.getBegin().isFileID() ? FromTokenRange(SM, Lang, R) : loc;
|
||||||
} else {
|
} else {
|
||||||
@ -1303,13 +1305,13 @@ Index(CompletionManager *completion, WorkingFiles *wfiles, VFS *vfs,
|
|||||||
{
|
{
|
||||||
llvm::CrashRecoveryContext CRC;
|
llvm::CrashRecoveryContext CRC;
|
||||||
auto parse = [&]() {
|
auto parse = [&]() {
|
||||||
if (!Action->BeginSourceFile(*Clang, Clang->getFrontendOpts().Inputs[0]))
|
if (!Action->BeginSourceFile(*Clang, Clang->getFrontendOpts().Inputs[0]))
|
||||||
return;
|
return;
|
||||||
if (!Action->Execute())
|
if (!Action->Execute())
|
||||||
return;
|
return;
|
||||||
Action->EndSourceFile();
|
Action->EndSourceFile();
|
||||||
ok = true;
|
ok = true;
|
||||||
};
|
};
|
||||||
if (!CRC.RunSafely(parse)) {
|
if (!CRC.RunSafely(parse)) {
|
||||||
LOG_S(ERROR) << "clang crashed for " << file;
|
LOG_S(ERROR) << "clang crashed for " << file;
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
Reference in New Issue
Block a user