parsing llvm type strings from an in-memory string

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

parsing llvm type strings from an in-memory string

Eric Fiselier via cfe-dev
For various reasons, I want to be able to use the `LLParser` machinery to create `Type` objects.  So, I need to create an LLParser which will parse a string, instead of a reading it from a file.  If I was doing this in clang, then I think I would need to use an instance of `InMemoryFileSystem` which inherits from `FileSystem`.  

However, I want to do this in an llvm pass.  Any suggestions?

--------------
Seth Copen Goldstein
Carnegie Mellon University
Computer Science Dept
7111 GHC
412-268-3828

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: parsing llvm type strings from an in-memory string

Eric Fiselier via cfe-dev
Hi,

> On 18 Dec 2017, at 16:01, Seth Goldstein via cfe-dev <[hidden email]> wrote:
>
> For various reasons, I want to be able to use the `LLParser` machinery to create `Type` objects.  So, I need to create an LLParser which will parse a string, instead of a reading it from a file.  If I was doing this in clang, then I think I would need to use an instance of `InMemoryFileSystem` which inherits from `FileSystem`.  
>
> However, I want to do this in an llvm pass.  Any suggestions?

You can find some functions that might do this in include/llvm/AsmParser/Parser.h, probably

> Type *parseType(StringRef Asm, SMDiagnostic &Err, const Module &M, const SlotMapping *Slots = nullptr);


might be what you’re looking for.

Cheers,


Francis Visoiu Mistrih

>
> --------------
> Seth Copen Goldstein
> Carnegie Mellon University
> Computer Science Dept
> 7111 GHC
> 412-268-3828
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev