Quiz time
Now that you have completed reading this chapter, answer the following questions to test your knowledge:
- You have a pristine clone of the LLVM code base and yet the build fails with weird compiler errors. What could be the reason?
The most likely reasons are as follows:
- The LLVM code base is temporarily broken.
- Check the build bots at https://lab.llvm.org/buildbot/.
- Your environment is not properly set up.
- Check that your tools meet the expected minimal requirements. See Installing the right tools.
- You have a C file, and you are curious about what the LLVM IR looks like without optimization. How can you print this IR using Clang?
You can run the following:
$ clang -S -O0 -emit-llvm myFile.c -o -
See Experimenting with Clang.
- You want to build LLVM for just the AMDGPU and X86 backends. Which CMake variable should you set and how do you set it?
You want to set the variable...