[cfe-dev] compiling from memory buffer
Vlad
vlad at demoninsight.com
Fri May 7 12:12:22 PDT 2010
Try
sourceManager->createMainFileIDForMemBuffer (buffer);
HTH,
Vlad
On May 7, 2010, at 1:26 PM, Jochen Wilhelmy wrote:
> Hi!
>
> To compile from file I do:
> const clang::FileEntry* file = fileManager->getFile(fileName);
> sourceManager->createMainFileID(file, clang::SourceLocation());
>
> To compile from memory buffer I do:
> llvm::MemoryBuffer* buffer = llvm::MemoryBuffer::getMemBuffer(str);
> sourceManager->createFileIDForMemBuffer(buffer);
>
> but this asserts in SourceManager.h
> in SLocEntry::getFile():
> assert(isFile() && "Not a file SLocEntry!");
>
> Whan am I doing wrong?
>
> -Jochen
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list