Skip to content

Commit

Permalink
Updated to LLVM/Clang revision 222533/222534.
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
  • Loading branch information
ddobrev committed Nov 21, 2014
1 parent a763abd commit 562fe35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ msbuild LLVM.sln /p:Configuration=RelWithDebInfo;Platform=Win32 /m

Last revisions known to work:

LLVM `r219061` / Git mirror revision `dbc6d9b9d7f71b25c6ea4264659460f81908e7e2`.
LLVM `r222533` / Git mirror revision `bd357588a106dc7c828c57ad8048e82003d638de`.

Clang `r219062` / Git mirror revision `cec1839edae2ca8a0321dde1ccd47009076d8557`.
Clang `r222534` / Git mirror revision `b643cf9daa35f3540a4420d93d7cc6f48cffb735`.

### Compiling CppSharp on Windows/Visual Studio

Expand Down
14 changes: 10 additions & 4 deletions src/CppParser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3198,25 +3198,31 @@ ParserResult* Parser::ParseLibrary(const std::string& File, ParserResult* res)
C->createFileManager();

auto &FM = C->getFileManager();
const clang::FileEntry* FileEntry = 0;
llvm::StringRef FileEntry;

for (unsigned I = 0, E = Opts->LibraryDirs.size(); I != E; ++I)
{
auto& LibDir = Opts->LibraryDirs[I];
llvm::SmallString<256> Path(LibDir);
llvm::sys::path::append(Path, File);

if ((FileEntry = FM.getFile(Path.str())))
if (!(FileEntry = Path.str()).empty())
break;
}

if (!FileEntry)
if (FileEntry.empty())
{
res->Kind = ParserResultKind::FileNotFound;
return res;
}

std::unique_ptr<llvm::MemoryBuffer> FileBuf(FM.getBufferForFile(FileEntry));
auto Buffer = FM.getBufferForFile(FileEntry);
if (Buffer.getError())
{
res->Kind = ParserResultKind::Error;
return res;
}
std::unique_ptr<llvm::MemoryBuffer> FileBuf(std::move(Buffer.get()));
auto BinaryOrErr = llvm::object::createBinary(FileBuf->getMemBufferRef(),
&llvm::getGlobalContext());
if (BinaryOrErr.getError())
Expand Down

0 comments on commit 562fe35

Please sign in to comment.