Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: lib/Driver/Driver.cpp

Issue 1810033004: Use LLVM LTO instead of IR types to improve compatibility (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-clang.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===--- Driver.cpp - Clang GCC Compatible Driver -------------------------===// 1 //===--- Driver.cpp - Clang GCC Compatible Driver -------------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 9
10 #include "clang/Driver/Driver.h" 10 #include "clang/Driver/Driver.h"
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 if (Args.hasArg(options::OPT_module_file_info)) 1357 if (Args.hasArg(options::OPT_module_file_info))
1358 return llvm::make_unique<CompileJobAction>(std::move(Input), 1358 return llvm::make_unique<CompileJobAction>(std::move(Input),
1359 types::TY_ModuleFile); 1359 types::TY_ModuleFile);
1360 if (Args.hasArg(options::OPT_verify_pch)) 1360 if (Args.hasArg(options::OPT_verify_pch))
1361 return llvm::make_unique<VerifyPCHJobAction>(std::move(Input), 1361 return llvm::make_unique<VerifyPCHJobAction>(std::move(Input),
1362 types::TY_Nothing); 1362 types::TY_Nothing);
1363 return llvm::make_unique<CompileJobAction>(std::move(Input), 1363 return llvm::make_unique<CompileJobAction>(std::move(Input),
1364 types::TY_LLVM_BC); 1364 types::TY_LLVM_BC);
1365 } 1365 }
1366 case phases::Backend: { 1366 case phases::Backend: {
1367 if (IsUsingLTO(TC, Args)) { 1367 if (IsUsingLTO(TC, Args) || TC.isBitcodeOnlyTarget()) {
1368 types::ID Output = 1368 types::ID Output =
1369 Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC; 1369 Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC;
1370 return llvm::make_unique<BackendJobAction>(std::move(Input), Output); 1370 return llvm::make_unique<BackendJobAction>(std::move(Input), Output);
1371 } 1371 }
1372 if (Args.hasArg(options::OPT_emit_llvm) || TC.isBitcodeOnlyTarget()) { 1372 if (Args.hasArg(options::OPT_emit_llvm)) {
1373 types::ID Output = 1373 types::ID Output =
1374 Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC; 1374 Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC;
1375 return llvm::make_unique<BackendJobAction>(std::move(Input), Output); 1375 return llvm::make_unique<BackendJobAction>(std::move(Input), Output);
1376 } 1376 }
1377 return llvm::make_unique<BackendJobAction>(std::move(Input), 1377 return llvm::make_unique<BackendJobAction>(std::move(Input),
1378 types::TY_PP_Asm); 1378 types::TY_PP_Asm);
1379 } 1379 }
1380 case phases::Assemble: 1380 case phases::Assemble:
1381 return llvm::make_unique<AssembleJobAction>(std::move(Input), 1381 return llvm::make_unique<AssembleJobAction>(std::move(Input),
1382 types::TY_Object); 1382 types::TY_Object);
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 } else { 2197 } else {
2198 ExcludedFlagsBitmask |= options::CLOption; 2198 ExcludedFlagsBitmask |= options::CLOption;
2199 } 2199 }
2200 2200
2201 return std::make_pair(IncludedFlagsBitmask, ExcludedFlagsBitmask); 2201 return std::make_pair(IncludedFlagsBitmask, ExcludedFlagsBitmask);
2202 } 2202 }
2203 2203
2204 bool clang::driver::isOptimizationLevelFast(const llvm::opt::ArgList &Args) { 2204 bool clang::driver::isOptimizationLevelFast(const llvm::opt::ArgList &Args) {
2205 return Args.hasFlag(options::OPT_Ofast, options::OPT_O_Group, false); 2205 return Args.hasFlag(options::OPT_Ofast, options::OPT_O_Group, false);
2206 } 2206 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698