Browse Source

Do not try to walk through built-in functions. This can happen when trying to parse things that include (transitively) the intrinsic Clang headers.

pull/1/head
triton 13 years ago
parent
commit
3ed33c6e21
  1. 8
      src/Parser/Parser.cpp

8
src/Parser/Parser.cpp

@ -1025,6 +1025,8 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, Cxxi::Function^ F,
using namespace clang; using namespace clang;
using namespace clix; using namespace clix;
assert (FD->getBuiltinID() == 0);
auto FT = FD->getType()->getAs<FunctionType>(); auto FT = FD->getType()->getAs<FunctionType>();
auto CC = FT->getCallConv(); auto CC = FT->getCallConv();
@ -1072,6 +1074,8 @@ Cxxi::Function^ Parser::WalkFunction(clang::FunctionDecl* FD, bool IsDependent,
using namespace clang; using namespace clang;
using namespace clix; using namespace clix;
assert (FD->getBuiltinID() == 0);
auto NS = GetNamespace(FD); auto NS = GetNamespace(FD);
assert(NS && "Expected a valid namespace"); assert(NS && "Expected a valid namespace");
@ -1397,6 +1401,10 @@ Cxxi::Declaration^ Parser::WalkDeclaration(clang::Decl* D, clang::TypeLoc* TL,
if (!FD->isFirstDeclaration()) if (!FD->isFirstDeclaration())
break; break;
// Check for and ignore built-in functions.
if (FD->getBuiltinID() != 0)
break;
auto F = WalkFunction(FD); auto F = WalkFunction(FD);
HandleComments(FD, F); HandleComments(FD, F);

Loading…
Cancel
Save