aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorPeixin Qiao <qiaopeixin@huawei.com>2022-10-03 15:24:39 +0800
committerPeixin Qiao <qiaopeixin@huawei.com>2022-10-03 15:24:39 +0800
commitc4f04a126aa2c16b0185dbf55a2ab5db1d9de653 (patch)
tree824f1b289ff6ad16307721d4112fda899973f4ff /flang/lib/Frontend/CompilerInvocation.cpp
parent2ddbe56b34aba005f1605ed001203d427ae9f823 (diff)
downloadllvm-c4f04a126aa2c16b0185dbf55a2ab5db1d9de653.zip
llvm-c4f04a126aa2c16b0185dbf55a2ab5db1d9de653.tar.gz
llvm-c4f04a126aa2c16b0185dbf55a2ab5db1d9de653.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