Browse Source

Updated to latest LLVM/Clang revisions.

pull/86/head
triton 12 years ago
parent
commit
2cc3e1cfa7
  1. 2
      docs/GettingStarted.md
  2. 10
      src/CppParser/Parser.cpp
  3. 10
      src/Parser/Parser.cpp

2
docs/GettingStarted.md

@ -20,6 +20,8 @@ source first. @@ -20,6 +20,8 @@ source first.
Building in *Release* is recommended because else the Clang parser will be
excruciatingly slow.
Last updated to LLVM/Clang revision: `r193383`
## Generating bindings
Suppose we have the following declarations in a file named `Sample.h` and we

10
src/CppParser/Parser.cpp

@ -233,12 +233,10 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI, @@ -233,12 +233,10 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
llvm_unreachable("Unknown mangling ABI");
break;
case TargetCXXABI::GenericItanium:
MC.reset(createItaniumMangleContext(*AST, AST->getDiagnostics()));
//AST->setCXXABI(CreateItaniumCXXABI(*AST));
MC.reset(ItaniumMangleContext::create(*AST, AST->getDiagnostics()));
break;
case TargetCXXABI::Microsoft:
MC.reset(createMicrosoftMangleContext(*AST, AST->getDiagnostics()));
//AST->setCXXABI(CreateMicrosoftCXXABI(*AST));
MC.reset(MicrosoftMangleContext::create(*AST, AST->getDiagnostics()));
break;
}
@ -516,7 +514,7 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, Class* C) @@ -516,7 +514,7 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, Class* C)
case TargetCXXABI::GenericItanium:
{
C->Layout.ABI = CppAbi::Itanium;
VTableContext VTContext(*AST);
ItaniumVTableContext VTContext(*AST);
auto& VTLayout = VTContext.getVTableLayout(RD);
C->Layout.Layout = WalkVTableLayout(VTLayout);
@ -2015,7 +2013,7 @@ Declaration* Parser::WalkDeclaration(clang::Decl* D, @@ -2015,7 +2013,7 @@ Declaration* Parser::WalkDeclaration(clang::Decl* D,
case Decl::Function:
{
FunctionDecl* FD = cast<FunctionDecl>(D);
if (!FD->isFirstDeclaration())
if (!FD->isFirstDecl())
break;
// Check for and ignore built-in functions.

10
src/Parser/Parser.cpp

@ -234,12 +234,10 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI, @@ -234,12 +234,10 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
llvm_unreachable("Unknown mangling ABI");
break;
case TargetCXXABI::GenericItanium:
MC.reset(createItaniumMangleContext(*AST, AST->getDiagnostics()));
//AST->setCXXABI(CreateItaniumCXXABI(*AST));
MC.reset(ItaniumMangleContext::create(*AST, AST->getDiagnostics()));
break;
case TargetCXXABI::Microsoft:
MC.reset(createMicrosoftMangleContext(*AST, AST->getDiagnostics()));
//AST->setCXXABI(CreateMicrosoftCXXABI(*AST));
MC.reset(MicrosoftMangleContext::create(*AST, AST->getDiagnostics()));
break;
}
@ -518,7 +516,7 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, CppSharp::AST::Class^ C) @@ -518,7 +516,7 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, CppSharp::AST::Class^ C)
case TargetCXXABI::GenericItanium:
{
C->Layout->ABI = CppSharp::AST::CppAbi::Itanium;
VTableContext VTContext(*AST);
ItaniumVTableContext VTContext(*AST);
auto& VTLayout = VTContext.getVTableLayout(RD);
C->Layout->Layout = WalkVTableLayout(VTLayout);
@ -2022,7 +2020,7 @@ CppSharp::AST::Declaration^ Parser::WalkDeclaration(clang::Decl* D, @@ -2022,7 +2020,7 @@ CppSharp::AST::Declaration^ Parser::WalkDeclaration(clang::Decl* D,
case Decl::Function:
{
FunctionDecl* FD = cast<FunctionDecl>(D);
if (!FD->isFirstDeclaration())
if (!FD->isFirstDecl())
break;
// Check for and ignore built-in functions.

Loading…
Cancel
Save