mstorsjo created this revision. mstorsjo added reviewers: MaskRay, rnk. Herald added a subscriber: kristof.beyls. mstorsjo requested review of this revision. Herald added a project: clang.
This doesn't practically affect the code generation. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D111707 Files: clang/lib/Driver/ToolChains/MSVC.cpp clang/lib/Driver/ToolChains/MinGW.cpp clang/test/Driver/pic.c Index: clang/test/Driver/pic.c =================================================================== --- clang/test/Driver/pic.c +++ clang/test/Driver/pic.c @@ -314,8 +314,12 @@ // RUN: %clang -c %s -target aarch64-linux-android24 -fno-PIE -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC // -// On Windows-X64 PIC is enabled by default +// On Windows x86_64 and aarch64 PIC is enabled by default // RUN: %clang -c %s -target x86_64-pc-windows-msvc18.0.0 -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 // RUN: %clang -c %s -target x86_64-pc-windows-gnu -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target aarch64-windows-msvc -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target aarch64-windows-gnu -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 Index: clang/lib/Driver/ToolChains/MinGW.cpp =================================================================== --- clang/lib/Driver/ToolChains/MinGW.cpp +++ clang/lib/Driver/ToolChains/MinGW.cpp @@ -474,13 +474,15 @@ } bool toolchains::MinGW::isPICDefault() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } bool toolchains::MinGW::isPIEDefault() const { return false; } bool toolchains::MinGW::isPICDefaultForced() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } llvm::ExceptionHandling Index: clang/lib/Driver/ToolChains/MSVC.cpp =================================================================== --- clang/lib/Driver/ToolChains/MSVC.cpp +++ clang/lib/Driver/ToolChains/MSVC.cpp @@ -795,7 +795,8 @@ } bool MSVCToolChain::isPICDefault() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } bool MSVCToolChain::isPIEDefault() const { @@ -803,7 +804,8 @@ } bool MSVCToolChain::isPICDefaultForced() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } void MSVCToolChain::AddCudaIncludeArgs(const ArgList &DriverArgs,
Index: clang/test/Driver/pic.c =================================================================== --- clang/test/Driver/pic.c +++ clang/test/Driver/pic.c @@ -314,8 +314,12 @@ // RUN: %clang -c %s -target aarch64-linux-android24 -fno-PIE -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC // -// On Windows-X64 PIC is enabled by default +// On Windows x86_64 and aarch64 PIC is enabled by default // RUN: %clang -c %s -target x86_64-pc-windows-msvc18.0.0 -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 // RUN: %clang -c %s -target x86_64-pc-windows-gnu -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target aarch64-windows-msvc -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target aarch64-windows-gnu -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 Index: clang/lib/Driver/ToolChains/MinGW.cpp =================================================================== --- clang/lib/Driver/ToolChains/MinGW.cpp +++ clang/lib/Driver/ToolChains/MinGW.cpp @@ -474,13 +474,15 @@ } bool toolchains::MinGW::isPICDefault() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } bool toolchains::MinGW::isPIEDefault() const { return false; } bool toolchains::MinGW::isPICDefaultForced() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } llvm::ExceptionHandling Index: clang/lib/Driver/ToolChains/MSVC.cpp =================================================================== --- clang/lib/Driver/ToolChains/MSVC.cpp +++ clang/lib/Driver/ToolChains/MSVC.cpp @@ -795,7 +795,8 @@ } bool MSVCToolChain::isPICDefault() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } bool MSVCToolChain::isPIEDefault() const { @@ -803,7 +804,8 @@ } bool MSVCToolChain::isPICDefaultForced() const { - return getArch() == llvm::Triple::x86_64; + return getArch() == llvm::Triple::x86_64 || + getArch() == llvm::Triple::aarch64; } void MSVCToolChain::AddCudaIncludeArgs(const ArgList &DriverArgs,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits