r290305 - Driver: use the triple to query the arch, not the toolchain
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 21 19:09:05 PST 2016
Author: compnerd
Date: Wed Dec 21 21:09:04 2016
New Revision: 290305
URL: http://llvm.org/viewvc/llvm-project?rev=290305&view=rev
Log:
Driver: use the triple to query the arch, not the toolchain
Although the result is the same, the intent is much more clear this way:
we care about the architecture we are targeting. NFC.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=290305&r1=290304&r2=290305&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Dec 21 21:09:04 2016
@@ -3805,7 +3805,7 @@ ParsePICArgs(const ToolChain &ToolChain,
// Android-specific defaults for PIC/PIE
if (Triple.isAndroid()) {
- switch (ToolChain.getArch()) {
+ switch (Triple.getArch()) {
case llvm::Triple::arm:
case llvm::Triple::armeb:
case llvm::Triple::thumb:
@@ -3917,7 +3917,7 @@ ParsePICArgs(const ToolChain &ToolChain,
}
bool EmbeddedPISupported;
- switch (ToolChain.getArch()) {
+ switch (Triple.getArch()) {
case llvm::Triple::arm:
case llvm::Triple::armeb:
case llvm::Triple::thumb:
@@ -3946,9 +3946,8 @@ ParsePICArgs(const ToolChain &ToolChain,
}
// ROPI and RWPI are not comaptible with PIC or PIE.
- if ((ROPI || RWPI) && (PIC || PIE)) {
+ if ((ROPI || RWPI) && (PIC || PIE))
ToolChain.getDriver().Diag(diag::err_drv_ropi_rwpi_incompatible_with_pic);
- }
if (PIC)
return std::make_tuple(llvm::Reloc::PIC_, IsPICLevelTwo ? 2U : 1U, PIE);
More information about the cfe-commits
mailing list