How can I implement a string data type in LLVM?

后端 未结 5 1906
眼角桃花
眼角桃花 2021-01-31 10:31

I have been looking at LLVM lately, and I find it to be quite an interesting architecture. However, looking through the tutorial and the reference material, I can\'t see any ex

5条回答
  •  甜味超标
    2021-01-31 11:03

    For those using the C++ API of LLVM, you can rely on IRBuilder's CreateGlobalStringPtr :

    Builder.CreateGlobalStringPtr(StringRef("Hello, world!"));
    

    This will be represented as i8* in the final LLVM IR.

提交回复
热议问题