|
|
|
|
@ -2413,7 +2413,8 @@ ParserResult^ Parser::ParseHeader(const std::string& File)
@@ -2413,7 +2413,8 @@ ParserResult^ Parser::ParseHeader(const std::string& File)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ParserResultKind Parser::ParseArchive(llvm::StringRef File, |
|
|
|
|
llvm::MemoryBuffer *Buffer) |
|
|
|
|
llvm::MemoryBuffer *Buffer, |
|
|
|
|
CppSharp::AST::NativeLibrary^ NativeLib) |
|
|
|
|
{ |
|
|
|
|
llvm::error_code Code; |
|
|
|
|
llvm::object::Archive Archive(Buffer, Code); |
|
|
|
|
@ -2422,7 +2423,7 @@ ParserResultKind Parser::ParseArchive(llvm::StringRef File,
@@ -2422,7 +2423,7 @@ ParserResultKind Parser::ParseArchive(llvm::StringRef File,
|
|
|
|
|
return ParserResultKind::Error; |
|
|
|
|
|
|
|
|
|
auto LibName = clix::marshalString<clix::E_UTF8>(File); |
|
|
|
|
auto NativeLib = Symbols->FindOrCreateLibrary(LibName); |
|
|
|
|
NativeLib->FileName = LibName; |
|
|
|
|
|
|
|
|
|
for(auto it = Archive.begin_symbols(); it != Archive.end_symbols(); ++it) |
|
|
|
|
{ |
|
|
|
|
@ -2439,7 +2440,8 @@ ParserResultKind Parser::ParseArchive(llvm::StringRef File,
@@ -2439,7 +2440,8 @@ ParserResultKind Parser::ParseArchive(llvm::StringRef File,
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ParserResultKind Parser::ParseSharedLib(llvm::StringRef File, |
|
|
|
|
llvm::MemoryBuffer *Buffer) |
|
|
|
|
llvm::MemoryBuffer *Buffer, |
|
|
|
|
CppSharp::AST::NativeLibrary^ NativeLib) |
|
|
|
|
{ |
|
|
|
|
auto Object = llvm::object::ObjectFile::createObjectFile(Buffer); |
|
|
|
|
|
|
|
|
|
@ -2447,7 +2449,7 @@ ParserResultKind Parser::ParseSharedLib(llvm::StringRef File,
@@ -2447,7 +2449,7 @@ ParserResultKind Parser::ParseSharedLib(llvm::StringRef File,
|
|
|
|
|
return ParserResultKind::Error; |
|
|
|
|
|
|
|
|
|
auto LibName = clix::marshalString<clix::E_UTF8>(File); |
|
|
|
|
auto NativeLib = Symbols->FindOrCreateLibrary(LibName); |
|
|
|
|
NativeLib->FileName = LibName; |
|
|
|
|
|
|
|
|
|
llvm::error_code ec; |
|
|
|
|
for(auto it = Object->begin_symbols(); it != Object->end_symbols(); it.increment(ec)) |
|
|
|
|
@ -2510,11 +2512,15 @@ ParserResult^ Parser::ParseLibrary(const std::string& File)
@@ -2510,11 +2512,15 @@ ParserResult^ Parser::ParseLibrary(const std::string& File)
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
res->Kind = ParseArchive(File, FM.getBufferForFile(FileEntry)); |
|
|
|
|
res->Kind = ParseArchive(File, FM.getBufferForFile(FileEntry), |
|
|
|
|
res->Library); |
|
|
|
|
|
|
|
|
|
if (res->Kind == ParserResultKind::Success) |
|
|
|
|
return res; |
|
|
|
|
|
|
|
|
|
res->Kind = ParseSharedLib(File, FM.getBufferForFile(FileEntry)); |
|
|
|
|
res->Kind = ParseSharedLib(File, FM.getBufferForFile(FileEntry), |
|
|
|
|
res->Library); |
|
|
|
|
|
|
|
|
|
if (res->Kind == ParserResultKind::Success) |
|
|
|
|
return res; |
|
|
|
|
|
|
|
|
|
|