diff --git a/examples/Parser/Parser.cs b/examples/Parser/Parser.cs index 0f0e3dbe..a39518cd 100644 --- a/examples/Parser/Parser.cs +++ b/examples/Parser/Parser.cs @@ -68,7 +68,7 @@ namespace CppSharp // First we will convert the output, bindings for the native Clang AST, // to CppSharp's managed AST representation. - var astContext = ClangParser.ConvertASTContext(parserResult.ASTContext); + var astContext = ClangParser.ConvertASTContext(parserOptions.ASTContext); // After its converted, we can dispose of the native AST bindings. parserResult.Dispose(); diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 082cf7bf..a46f113e 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -113,7 +113,7 @@ void Parser::ReadClassLayout(Class* Class, const clang::RecordDecl* RD, // Vtable pointer. if (CXXRD->isDynamicClass() && !PrimaryBase && - !c->getASTContext().getTargetInfo().getCXXABI().isMicrosoft()) { + !c->getTarget().getCXXABI().isMicrosoft()) { auto VPtr = WalkVTablePointer(Parent, Offset, "vptr"); Class->layout->Fields.push_back(VPtr); } @@ -2870,7 +2870,7 @@ bool Parser::CanCheckCodeGenInfo(clang::Sema& S, const clang::Type* Ty) // Lock in the MS inheritance model if we have a member pointer to a class, // else we get an assertion error inside Clang's codegen machinery. - if (c->getASTContext().getTargetInfo().getCXXABI().isMicrosoft()) + if (c->getTarget().getCXXABI().isMicrosoft()) { if (auto MPT = Ty->getAs()) if (!MPT->isDependentType()) @@ -4049,8 +4049,8 @@ ParserResult* Parser::ParseHeader(const std::vector& SourceFiles) llvm::LLVMContext Ctx; std::unique_ptr M(new llvm::Module("", Ctx)); - M->setTargetTriple(AST.getTargetInfo().getTriple().getTriple()); - M->setDataLayout(AST.getTargetInfo().getDataLayout()); + M->setTargetTriple(c->getTarget().getTriple().getTriple()); + M->setDataLayout(c->getTarget().getDataLayout()); std::unique_ptr CGM( new clang::CodeGen::CodeGenModule(c->getASTContext(), c->getHeaderSearchOpts(), @@ -4291,7 +4291,7 @@ ParserTargetInfo* Parser::GetTargetInfo() { auto parserTargetInfo = new ParserTargetInfo(); - auto& TI = c->getASTContext().getTargetInfo(); + auto& TI = c->getTarget(); parserTargetInfo->ABI = TI.getABI(); parserTargetInfo->char16Type = ConvertIntType(TI.getChar16Type());