From a074ac8dd76b759884c99f5a0af8085b9b24cb27 Mon Sep 17 00:00:00 2001 From: Sjoerd Meijer Date: Tue, 4 Oct 2016 08:03:36 +0000 Subject: [PATCH] Consistent fp denormal mode names. NFC. This fixes the inconsistency of the fp denormal option names: in LLVM this was DenormalType, but in Clang this is DenormalMode which seems better. Differential Revision: https://reviews.llvm.org/D24906 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283192 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/CommandFlags.h | 6 +++--- include/llvm/Target/TargetOptions.h | 10 +++++----- lib/Target/ARM/ARMAsmPrinter.cpp | 4 ++-- lib/Target/TargetMachine.cpp | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/llvm/CodeGen/CommandFlags.h b/include/llvm/CodeGen/CommandFlags.h index 0eacf07c710..65ca7a7e613 100644 --- a/include/llvm/CodeGen/CommandFlags.h +++ b/include/llvm/CodeGen/CommandFlags.h @@ -155,8 +155,8 @@ EnableNoTrappingFPMath("enable-no-trapping-fp-math", "attribute not to use exceptions"), cl::init(false)); -cl::opt -DenormalType("denormal-fp-math", +cl::opt +DenormalMode("denormal-fp-math", cl::desc("Select which denormal numbers the code is permitted to require"), cl::init(FPDenormal::IEEE), cl::values( @@ -310,7 +310,7 @@ static inline TargetOptions InitTargetOptionsFromCodeGenFlags() { Options.NoInfsFPMath = EnableNoInfsFPMath; Options.NoNaNsFPMath = EnableNoNaNsFPMath; Options.NoTrappingFPMath = EnableNoTrappingFPMath; - Options.FPDenormalType = DenormalType; + Options.FPDenormalMode = DenormalMode; Options.HonorSignDependentRoundingFPMathOption = EnableHonorSignDependentRoundingFPMath; if (FloatABIForCalls != FloatABI::Default) diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h index 07906e3f7e5..b051d80b567 100644 --- a/include/llvm/Target/TargetOptions.h +++ b/include/llvm/Target/TargetOptions.h @@ -57,7 +57,7 @@ namespace llvm { } namespace FPDenormal { - enum DenormalType { + enum DenormalMode { IEEE, // IEEE 754 denormal numbers PreserveSign, // the sign of a flushed-to-zero number is preserved in // the sign of 0 @@ -114,7 +114,7 @@ namespace llvm { AllowFPOpFusion(FPOpFusion::Standard), Reciprocals(TargetRecip()), JTType(JumpTable::Single), ThreadModel(ThreadModel::POSIX), EABIVersion(EABI::Default), DebuggerTuning(DebuggerKind::Default), - FPDenormalType(FPDenormal::IEEE), + FPDenormalMode(FPDenormal::IEEE), ExceptionModel(ExceptionHandling::None) {} /// PrintMachineCode - This flag is enabled when the -print-machineinstrs @@ -269,9 +269,9 @@ namespace llvm { /// Which debugger to tune for. DebuggerKind DebuggerTuning; - /// FPDenormalType - This flags specificies which denormal numbers the code + /// FPDenormalMode - This flags specificies which denormal numbers the code /// is permitted to require. - FPDenormal::DenormalType FPDenormalType; + FPDenormal::DenormalMode FPDenormalMode; /// What exception model to use ExceptionHandling ExceptionModel; @@ -306,7 +306,7 @@ inline bool operator==(const TargetOptions &LHS, ARE_EQUAL(ThreadModel) && ARE_EQUAL(EABIVersion) && ARE_EQUAL(DebuggerTuning) && - ARE_EQUAL(FPDenormalType) && + ARE_EQUAL(FPDenormalMode) && ARE_EQUAL(ExceptionModel) && ARE_EQUAL(MCOptions) && ARE_EQUAL(EnableIPRA); diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index b73225ef1e8..b1b4f865691 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -781,12 +781,12 @@ void ARMAsmPrinter::emitAttributes() { // Set FP Denormals. if (haveAllFunctionsAttribute(*MMI->getModule(), "denormal-fp-math", "preserve-sign") || - TM.Options.FPDenormalType == FPDenormal::PreserveSign) + TM.Options.FPDenormalMode == FPDenormal::PreserveSign) ATS.emitAttribute(ARMBuildAttrs::ABI_FP_denormal, ARMBuildAttrs::PreserveFPSign); else if (haveAllFunctionsAttribute(*MMI->getModule(), "denormal-fp-math", "positive-zero") || - TM.Options.FPDenormalType == FPDenormal::PositiveZero) + TM.Options.FPDenormalMode == FPDenormal::PositiveZero) ATS.emitAttribute(ARMBuildAttrs::ABI_FP_denormal, ARMBuildAttrs::PositiveZero); else if (!TM.Options.UnsafeFPMath) diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index f58535d8767..43a587ba847 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -82,11 +82,11 @@ void TargetMachine::resetTargetOptions(const Function &F) const { StringRef Denormal = F.getFnAttribute("denormal-fp-math").getValueAsString(); if (Denormal == "ieee") - Options.FPDenormalType = FPDenormal::IEEE; + Options.FPDenormalMode = FPDenormal::IEEE; else if (Denormal == "preserve-sign") - Options.FPDenormalType = FPDenormal::PreserveSign; + Options.FPDenormalMode = FPDenormal::PreserveSign; else if (Denormal == "positive-zero") - Options.FPDenormalType = FPDenormal::PositiveZero; + Options.FPDenormalMode = FPDenormal::PositiveZero; } /// Returns the code generation relocation model. The choices are static, PIC, -- 2.50.1