From: Saleem Abdulrasool Date: Thu, 22 Dec 2016 03:09:04 +0000 (+0000) Subject: Driver: use the triple to query the arch, not the toolchain X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4a1e63f1a8953f21513eb3fe800661113e58fb6;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290305 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 8b52f52576..c389d9376d 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -3805,7 +3805,7 @@ ParsePICArgs(const ToolChain &ToolChain, const ArgList &Args) { // 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, const ArgList &Args) { } 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, const ArgList &Args) { } // 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);