LLVM Directory Layout
Source-code of llvm-project clone with git:https://github.com/llvm/llvm-project.git
HEAD detached at llvmorg-9.0.0
After the source-code is downloaded, a directory named ‘llvm-project’ appears and the directory listing is as follows:
The following is a brief introduction to code layout.
llvm-project/clang
Clang is an “llvm native” C/C++/Objective-C compiler, which aims to deliver amazingly fast compiles (e.g. about 3x faster than GCC when compiling Objective-C code in a debug configuration), extremely useful error and warning messages and to provide a platform for building great source level tools. The Clang Static Analyzer is a tool that automatically finds bugs in your code, and is great example of the sort of tool that can be built using the Clang frontend as library to parse C/C++ code.
llvm-project/clang-tools-extra
This repository holds tools that are developed as a part of the LLVM compiler infrastructure project and the Clang frontend. The tools are kept in a separate “extra” repository to allow lighter weight checkouts of the core Clang codebase.
This repository is only intended to be checked out inside of a full LLVM+Clang tree, and in the ‘tool/extra’ subdirectory of the Clang checkout.
All discussing regarding Clang, Clang-based tools, and code in this repository should be held using the standard Clang mailing lists: http://lists.llvm.org/mailman/listinfo/cfe-dev
llvm-project/compiler-rt
The compiler-rt project provides highly tuned implementations of the low-level code generator support routines like “__fixunsdfdi” and other calls generated when a target doesn’t have a short sequence of native instructions to implement a core IR operation. It also provides implementations of run-time libraries for dynamic testing tools such as AdressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer
llvm-project/debuginfo-tests
This is a collection of tests to check debugging information generated by compiler. This test suite can be checked out inside clang/test folder. This will enable ‘make test’ for clang to pick up these tests. Typically, test cases included here includes debugger commands and intended debugger output as comments in source file using DEBUGGER: and CHECK: as prefixes respectively:
For example:
define i32 @f1(i32 %i) nounwing ssp{
; DEBUGGER: break f1
; DEBUGGER: r
; DEBUGGER: p i
; CHECK: $1 = 42
entry:
}
is a testcase where the debugger is asked to break at function ‘f1’ and print value of argument ‘i’. The expected value of ‘i’ is 42 in this case.
llvm-project/libclc
The