how to generate IR file when linking

HI!

How the generated LLVM IR with clang?
Want to learn By IR files how to use the external Library type ?

My code:

#include
#include

int main(int argc, char* argv[])
{
std::wstring strOut = L"error msg!";
std::wcout << strOut << std::endl;

return 0;
}

Hi,

Where you normally would add ā€˜-cā€™ to the clang argument list to generate an object, instead add '-S -emit-llvm '. That will generate you a textual IR file that you can inspect.

Cheers,

James