[flang] Another pass with clean builds

Original-commit: flang-compiler/f18@e05dc1f444
Reviewed-on: https://github.com/flang-compiler/f18/pull/666
This commit is contained in:
peter klausler 2019-08-15 14:25:05 -07:00
parent 10688e0903
commit 7749d43f3f
4 changed files with 17 additions and 8 deletions

View File

@ -29,6 +29,7 @@ if(BUILD_WITH_CLANG)
if(GCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --gcc-toolchain=${GCC}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument")
endif()
# Set RPATH in every executable, overriding the default setting.
@ -96,6 +97,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wimplicit-fallthrough")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdelete-non-virtual-dtor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-O2 '-DCHECK=(void)'")
set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUGF18")

View File

@ -712,7 +712,7 @@ template<typename CHAR> bool FormatValidator<CHAR>::Check() {
}
hasDataEditDesc = false;
NextToken();
// fall through
[[fallthrough]];
case TokenKind::LParen:
if (knrValue_ == 0) {
ReportError("List repeat specifier must be positive", knrToken_);
@ -748,7 +748,7 @@ template<typename CHAR> bool FormatValidator<CHAR>::Check() {
if (suppressMessageCascade_ || reporterExit_) {
break;
}
// fall through
[[fallthrough]];
default: ReportError("Unexpected '%s' in format expression"); NextToken();
}

View File

@ -20,7 +20,12 @@
using Fortran::evaluate::RealFlag;
ScopedHostFloatingPointEnvironment::ScopedHostFloatingPointEnvironment(
bool treatSubnormalOperandsAsZero, bool flushSubnormalResultsToZero) {
#if __x86_64__
bool treatSubnormalOperandsAsZero, bool flushSubnormalResultsToZero
#else
bool, bool
#endif
) {
errno = 0;
if (feholdexcept(&originalFenv_) != 0) {
std::fprintf(stderr, "feholdexcept() failed: %s\n", std::strerror(errno));

View File

@ -268,11 +268,13 @@ enum FlagBits {
Inexact = 16,
};
std::uint32_t FlagsToBits(const RealFlags &flags) {
#ifdef __clang__
// clang support for fenv.h is broken, so tests of flag settings
// are disabled.
inline std::uint32_t FlagsToBits(const RealFlags &) { return 0; }
#else
inline std::uint32_t FlagsToBits(const RealFlags &flags) {
std::uint32_t bits{0};
#ifndef __clang__
// TODO: clang support for fenv.h is broken, so tests of flag settings
// are disabled.
if (flags.test(RealFlag::Overflow)) {
bits |= Overflow;
}
@ -288,9 +290,9 @@ std::uint32_t FlagsToBits(const RealFlags &flags) {
if (flags.test(RealFlag::Inexact)) {
bits |= Inexact;
}
#endif // __clang__
return bits;
}
#endif // __clang__
template<typename UINT = std::uint32_t, typename FLT = float, typename REAL>
void inttest(std::int64_t x, int pass, Rounding rounding) {