summaryrefslogtreecommitdiffstats
path: root/clang/unittests/CodeGen/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Add CLANG_LINK_CLANG_DYLIB optionTom Stellard2019-07-031-1/+1
| | | | | | | | | | | | | | | | Summary: Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against libclang_shared.so instead of the individual component libraries. Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru Subscribers: arphaman, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63503 llvm-svn: 365092
* Add explicit dependency on clangSerialization for a bunch of components to ↵Fangrui Song2018-12-121-0/+1
| | | | | | | | | | | | | | | fix -DBUILD_SHARED_LIBS=on build This is a more thorough fix of rC348911. The story about -DBUILD_SHARED_LIBS=on build after rC348907 (Move PCHContainerOperations from Frontend to Serialization) is: 1. libclangSerialization.so defines PCHContainerReader dtor, ... 2. clangFrontend and clangTooling define classes inheriting from PCHContainerReader, thus their DSOs have undefined references on PCHContainerReader dtor 3. Components depending on either clangFrontend or clangTooling cannot be linked unless they have explicit dependency on clangSerialization due to the default linker option -z defs. The explicit dependency could be avoided if libclang{Frontend,Tooling}.so had these undefined references. This patch adds the explicit dependency on clangSerialization to make them build. llvm-svn: 348915
* Unit tests for TBAA metadata generation.Serge Pavlov2017-12-221-0/+1
| | | | | | | | | | | | | | | | | | Now tests for metadata created by clang involve compiling code snippets placed into c/c++ source files and matching interesting patterns in the obtained textual representation of IR. Writting such tests is a painful process as metadata often form complex tree-like structures but textual representation of IR contains only a pile of metadata at the module end. This change implements IR matchers that may be used to match required patterns in the binary IR representation. In this case the metadata structure is not broken and creation of match patterns is easier. The change adds unit tests for TBAA metadata generation. Differential Revision: https://reviews.llvm.org/D41433 llvm-svn: 321360
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* Reorder.NAKAMURA Takumi2017-10-111-1/+1
| | | | llvm-svn: 315435
* ClangCodeGenTests: Update libdeps in rL315392, +clangAST.NAKAMURA Takumi2017-10-111-0/+1
| | | | llvm-svn: 315428
* Include getting generated struct offsets in CodegenABITypesAdrian Prantl2017-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | This change adds a new function, CodeGen::getFieldNumber, that enables a user of clang's code generation to get the field number in a generated LLVM IR struct that corresponds to a particular field in a C struct. It is important to expose this information in Clang's code generation interface because there is no reasonable way for users of Clang's code generation to get this information. In particular: LLVM struct types do not include field names. Clang adds a non-trivial amount of logic to the code generation of LLVM IR types for structs, in particular to handle padding and bit fields. Patch by Michael Ferguson! Differential Revision: https://reviews.llvm.org/D38473 llvm-svn: 315392
* ClangCodeGenTests: Update libdeps.NAKAMURA Takumi2017-08-271-0/+1
| | | | llvm-svn: 311846
* D34059: Get the file name for the symbol from the Module, not the SourceManager.Vassil Vassilev2017-08-271-0/+1
| | | | | | | | | This allows multi-module / incremental compilation environments to have unique initializer symbols. Patch by Axel Naumann with minor modifications by me! llvm-svn: 311844
* ClangCodeGenTests: Prune redundant libdeps.NAKAMURA Takumi2014-08-271-4/+0
| | | | llvm-svn: 216516
* [CMake] ClangCodeGenTests: Add Core. It's referenced by the test.NAKAMURA Takumi2014-08-271-0/+1
| | | | llvm-svn: 216515
* ClangCodeGenTests: Reorder libdeps.NAKAMURA Takumi2014-08-271-2/+2
| | | | llvm-svn: 216514
* Attempt to address cmake buildbot failureKeno Fischer2014-08-261-2/+3
| | | | | | | | | CMake gets confused by the fact that both LLVM and Clang now have a CodeGen unittest. Rename the target to avoid that. The new test was also missing ProfileData (thanks to Julien Lerouge for pointing that out) llvm-svn: 216499
* Don't segfault in EmitCXXGlobalInitFunc when main file is a membufKeno Fischer2014-08-261-0/+17
Summary: When the main file is created from a membuffer, there is no file entry that can be retrieved. This uses "__GLOBAL_I_a" in that case which is what was always used before r208128. Reviewers: majnemer, thakis Reviewed By: thakis Subscribers: yaron.keren, rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D5043 llvm-svn: 216495
OpenPOWER on IntegriCloud