summaryrefslogtreecommitdiff
path: root/lib/Driver/Types.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-12-07 19:21:34 +0000
committerTeresa Johnson <tejohnson@google.com>2015-12-07 19:21:34 +0000
commitf735405854d0b5eec01aecaf831bec9b2a545478 (patch)
tree6977e8f8d2c701183c29fad9948411bba5b87717 /lib/Driver/Types.cpp
parent6c025d834d07d8354c0ed156b8a4b9e18d8c8230 (diff)
downloadclang-f735405854d0b5eec01aecaf831bec9b2a545478.tar.gz
[ThinLTO] Option to invoke ThinLTO backend passes and importing
Summary: Adds new option -fthinlto-index=<file> to invoke the LTO pipeline along with function importing via clang using the supplied function summary index file. This supports invoking the parallel ThinLTO backend processes in a distributed build environment via clang. Additionally, this causes the module linker to be invoked on the bitcode file being compiled to perform any necessary promotion and renaming of locals that are exported via the function summary index file. Add a couple tests that confirm we get expected errors when we try to use the new option on a file that isn't bitcode, or specify an invalid index file. The tests also confirm that we trigger the expected function import pass. Depends on D15024 Reviewers: joker.eph, dexonsmith Subscribers: joker.eph, davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D15025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Types.cpp')
-rw-r--r--lib/Driver/Types.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Driver/Types.cpp b/lib/Driver/Types.cpp
index 2085b01242..c29ce9462a 100644
--- a/lib/Driver/Types.cpp
+++ b/lib/Driver/Types.cpp
@@ -128,6 +128,19 @@ bool types::isCXX(ID Id) {
}
}
+bool types::isLLVMIR(ID Id) {
+ switch (Id) {
+ default:
+ return false;
+
+ case TY_LLVM_IR:
+ case TY_LLVM_BC:
+ case TY_LTO_IR:
+ case TY_LTO_BC:
+ return true;
+ }
+}
+
bool types::isCuda(ID Id) {
switch (Id) {
default: