aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorPeixin Qiao <qiaopeixin@huawei.com>2022-10-02 10:26:55 +0800
committerPeixin Qiao <qiaopeixin@huawei.com>2022-10-02 10:30:49 +0800
commitd11e406e369fc90be5e2e2a0798ea7b7d2625882 (patch)
tree461baa701ecfad2a6d64e6629a1e46503c3a5026 /flang/lib/Frontend/CompilerInvocation.cpp
parentaef03c9b3bed5cef5a1940774b80128aefcb4095 (diff)
downloadllvm-d11e406e369fc90be5e2e2a0798ea7b7d2625882.zip
llvm-d11e406e369fc90be5e2e2a0798ea7b7d2625882.tar.gz
llvm-d11e406e369fc90be5e2e2a0798ea7b7d2625882.tar.bz2
[flang] Make real type of kind 10 target dependent
The real(10) is supported on x86_64. On aarch64, the value of selected_real_kind(16) should be 16 rather than 10 since real(10) is not supported on x86_64. Previously, the real type support check is not target dependent. Support it now through the target triple information. Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D134021
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 88e6298..0ad63b0 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -826,6 +826,14 @@ void CompilerInvocation::setSemanticsOpts(
.set_warnOnNonstandardUsage(getEnableConformanceChecks())
.set_warningsAreErrors(getWarnAsErr())
.set_moduleFileSuffix(getModuleFileSuffix());
+
+ llvm::Triple targetTriple{llvm::Triple(this->targetOpts.triple)};
+ // FIXME: Handle real(3) ?
+ if (targetTriple.getArch() != llvm::Triple::ArchType::x86 &&
+ targetTriple.getArch() != llvm::Triple::ArchType::x86_64) {
+ semanticsContext->targetCharacteristics().DisableType(
+ Fortran::common::TypeCategory::Real, /*kind=*/10);
+ }
}
/// Set \p loweringOptions controlling lowering behavior based