Skip to content

Commit

Permalink
Updated to a recent LLVM and Clang revision.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Mar 13, 2014
1 parent b6d4a24 commit fb70229
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
4 changes: 1 addition & 3 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ Git repository urls found here: [http://llvm.org/docs/GettingStarted.html#git-mi
Building in *Release* is recommended because else the Clang parser will be
excruciatingly slow.

Last updated to LLVM/Clang revision: `r198449`
Last updated to LLVM/Clang revision: `r202563`

## Compiling on Mac OS X (experimental)

Requirements: Clang revision >= 198625

1. Clone CppSharp to `<CppSharp>`
2. Clone LLVM to `<CppSharp>\deps\llvm`
3. Clone Clang to `<CppSharp>\deps\llvm\tools\clang`
Expand Down
30 changes: 16 additions & 14 deletions src/CppParser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Parser.h"

#include <llvm/Support/Path.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Object/Archive.h>
#include <llvm/Object/ObjectFile.h>
#include <llvm/IR/LLVMContext.h>
Expand Down Expand Up @@ -507,11 +508,10 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, Class* C)
auto& VFPtrInfo = *I;

VFTableInfo Info;
Info.VBTableIndex = VFPtrInfo.VBTableIndex;
Info.VFPtrOffset = VFPtrInfo.VFPtrOffset.getQuantity();
Info.VFPtrFullOffset = VFPtrInfo.VFPtrFullOffset.getQuantity();
Info.VFPtrOffset = VFPtrInfo->NonVirtualOffset.getQuantity();
Info.VFPtrFullOffset = VFPtrInfo->FullOffsetInMDC.getQuantity();

auto& VTLayout = VTContext.getVFTableLayout(RD, VFPtrInfo.VFPtrFullOffset);
auto& VTLayout = VTContext.getVFTableLayout(RD, VFPtrInfo->FullOffsetInMDC);
Info.Layout = WalkVTableLayout(VTLayout);

C->Layout.VFTables.push_back(Info);
Expand Down Expand Up @@ -2632,23 +2632,25 @@ ParserResultKind Parser::ParseSharedLib(llvm::StringRef File,
for(auto it = Object.get()->symbol_begin(); it != Object.get()->symbol_end();
++it)
{
llvm::StringRef SymRef;

if (it->getName(SymRef))
continue;
std::string Sym;
llvm::raw_string_ostream SymStream(Sym);

if (it->printName(SymStream))
continue;

NativeLib->Symbols.push_back(SymRef);
NativeLib->Symbols.push_back(Sym);
}

for (auto it = Object.get()->symbol_begin(); it != Object.get()->symbol_end();
++it)
{
llvm::StringRef SymRef;

if (it->getName(SymRef))
continue;
std::string Sym;
llvm::raw_string_ostream SymStream(Sym);

if (it->printName(SymStream))
continue;

NativeLib->Symbols.push_back(SymRef);
NativeLib->Symbols.push_back(Sym);
}

return ParserResultKind::Success;
Expand Down
22 changes: 12 additions & 10 deletions src/Parser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "Interop.h"

#include <llvm/Support/Path.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Object/Archive.h>
#include <llvm/Object/ObjectFile.h>
#include <llvm/IR/LLVMContext.h>
Expand Down Expand Up @@ -508,11 +509,10 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, CppSharp::AST::Class^ C)
auto& VFPtrInfo = *I;

CppSharp::AST::VFTableInfo Info;
Info.VBTableIndex = VFPtrInfo.VBTableIndex;
Info.VFPtrOffset = VFPtrInfo.VFPtrOffset.getQuantity();
Info.VFPtrFullOffset = VFPtrInfo.VFPtrFullOffset.getQuantity();
Info.VFPtrOffset = VFPtrInfo->NonVirtualOffset.getQuantity();
Info.VFPtrFullOffset = VFPtrInfo->FullOffsetInMDC.getQuantity();

auto& VTLayout = VTContext.getVFTableLayout(RD, VFPtrInfo.VFPtrFullOffset);
auto& VTLayout = VTContext.getVFTableLayout(RD, VFPtrInfo->FullOffsetInMDC);
Info.Layout = WalkVTableLayout(VTLayout);

C->Layout->VFTables->Add(Info);
Expand Down Expand Up @@ -2644,24 +2644,26 @@ ParserResultKind Parser::ParseSharedLib(llvm::StringRef File,
for(auto it = Object.get()->symbol_begin(); it != Object.get()->symbol_end();
++it)
{
llvm::StringRef SymRef;
std::string Sym;
llvm::raw_string_ostream SymStream(Sym);

if (it->getName(SymRef))
if (it->printName(SymStream))
continue;

System::String^ SymName = clix::marshalString<clix::E_UTF8>(SymRef);
System::String^ SymName = clix::marshalString<clix::E_UTF8>(Sym);
NativeLib->Symbols->Add(SymName);
}

for(auto it = Object.get()->symbol_begin(); it != Object.get()->symbol_end();
++it)
{
llvm::StringRef SymRef;
std::string Sym;
llvm::raw_string_ostream SymStream(Sym);

if (it->getName(SymRef))
if (it->printName(SymStream))
continue;

System::String^ SymName = clix::marshalString<clix::E_UTF8>(SymRef);
System::String^ SymName = clix::marshalString<clix::E_UTF8>(Sym);
NativeLib->Symbols->Add(SymName);
}

Expand Down

4 comments on commit fb70229

@tritao
Copy link
Collaborator Author

@tritao tritao commented on fb70229 Mar 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity CppSharp :: VS2012 Build 939 is now running

@tritao
Copy link
Collaborator Author

@tritao tritao commented on fb70229 Mar 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity CppSharp :: VS2012 Build 939 outcome was SUCCESS
Summary: Tests passed: 63, ignored: 2 Build time: 0:0:0

@tritao
Copy link
Collaborator Author

@tritao tritao commented on fb70229 Mar 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity CppSharp :: VS2012_NewParser Build 286 is now running

@tritao
Copy link
Collaborator Author

@tritao tritao commented on fb70229 Mar 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity CppSharp :: VS2012_NewParser Build 286 outcome was FAILURE
Summary: Compilation error: src\Core\CppSharp.csproj; compilation error: build\vs2012\CppSharp.sln Build time: 0:0:0

Please sign in to comment.