Skip to content

Commit 15be99f

Browse files
committed
update
1 parent 1014757 commit 15be99f

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

clang/lib/Basic/Targets.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
124124
return std::make_unique<XCoreTargetInfo>(Triple, Opts);
125125

126126
case llvm::Triple::hexagon:
127-
if (os == llvm::Triple::Linux && Triple.isMusl())
127+
if (os == llvm::Triple::Linux &&
128+
Triple.getEnvironment() == llvm::Triple::Musl)
128129
return std::make_unique<LinuxTargetInfo<HexagonTargetInfo>>(Triple, Opts);
129130
return std::make_unique<HexagonTargetInfo>(Triple, Opts);
130131

clang/lib/Driver/Driver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ static llvm::Triple computeTargetTriple(const Driver &D,
797797
Target.getEnvironment() == llvm::Triple::GNUT64 ||
798798
Target.getEnvironment() == llvm::Triple::GNUABI64)
799799
Target.setEnvironment(llvm::Triple::GNUABIN32);
800-
else if (Target.isMusl())
800+
else if (Target.getEnvironment() == llvm::Triple::Musl ||
801+
Target.getEnvironment() == llvm::Triple::MuslABI64)
801802
Target.setEnvironment(llvm::Triple::MuslABIN32);
802803
} else if (ABIName == "64") {
803804
Target = Target.get64BitArchVariant();

llvm/include/llvm/IR/RuntimeLibcalls.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,21 @@
1414
#ifndef LLVM_IR_RUNTIME_LIBCALLS_H
1515
#define LLVM_IR_RUNTIME_LIBCALLS_H
1616

17-
#include "llvm/ADT/APFloat.h"
1817
#include "llvm/ADT/ArrayRef.h"
1918
#include "llvm/IR/CallingConv.h"
2019
#include "llvm/Support/AtomicOrdering.h"
21-
#include "llvm/Target/TargetMachine.h"
2220
#include "llvm/TargetParser/Triple.h"
2321

2422
namespace llvm {
2523

2624
/// Library names to use for `fp128` libcalls.
27-
// If needed, this could be extended with a `Quadmath` option for `q`-suffixed
28-
// `libquadmath` symbols.
2925
enum class F128LibcallFormat {
3026
/// C23 `*f128` lowering, e.g. `sinf128`
3127
Default = 0,
3228
/// `long double` *l` lowering, e.g. `sinl`.
3329
LongDouble = 1,
30+
// If needed, this could be extended with an option for `q` suffixes from
31+
// libquadmath.
3432
};
3533

3634
namespace RTLIB {

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,10 +1231,10 @@ class Triple {
12311231
/// or an invalid version tuple if this triple doesn't have one.
12321232
VersionTuple getMinimumSupportedOSVersion() const;
12331233

1234-
/// Check whether (1) `f128` is the same format as `long double`, and (2)
1235-
/// `*f128` symbols are not available. In other words platforms for which
1236-
/// this returns true may safely use `sqrtl` instead of `sqrtf128`, and
1237-
/// should do so because `sqrtf128` isn't expected to be available.
1234+
/// Check whether (1) f128 is the same format as `long double`, and (2)
1235+
/// `*f128` symbols are likely unavailable. In other words, platforms for
1236+
/// which this returns true may safely use sqrtl instead of sqrtf128 and
1237+
/// should do so because sqrtf128 would probably error at link time.
12381238
bool shouldLowerf128AsLongDouble() const;
12391239

12401240
/// @}

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/IR/RuntimeLibcalls.h"
10-
#include "llvm/Target/TargetMachine.h"
1110

1211
using namespace llvm;
1312
using namespace RTLIB;
@@ -206,7 +205,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
206205
setLibcallName(RTLIB::MULO_I128, nullptr);
207206
}
208207

209-
// By default, `fp128` libcalls get lowered to `*f128` symbols, which is
208+
// By default fp128 libcalls get lowered to `*f128` symbols, which is
210209
// safest because the symbols are only ever for binary128 on all platforms.
211210
// Unfortunately many platforms only have the `*l` (`long double`) symbols,
212211
// which vary by architecture and compilation flags, so we have to use them

llvm/lib/Target/Hexagon/HexagonSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class HexagonSubtarget : public HexagonGenSubtargetInfo {
113113

114114
const Triple &getTargetTriple() const { return TargetTriple; }
115115
bool isEnvironmentMusl() const {
116-
return TargetTriple.isMusl();
116+
return TargetTriple.getEnvironment() == Triple::Musl;
117117
}
118118

119119
/// getInstrItins - Return the instruction itineraries based on subtarget

llvm/lib/TargetParser/Triple.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,8 +2180,8 @@ bool Triple::shouldLowerf128AsLongDouble() const {
21802180
if (isOSWindows() || isOSDarwin())
21812181
return false;
21822182

2183-
// Most 64-bit architectures use use binary128 on all OSs except Windows and
2184-
// Apple. A few are binary128 on both 64- and 32-bit.
2183+
// Most 64-bit architectures use use binary128, a few are binary128 on both
2184+
// 64- and 32-bit.
21852185
if (isAArch64() || isLoongArch() || isRISCV() || isSPARC() || isSystemZ() ||
21862186
isVE() || isWasm())
21872187
return true;
@@ -2197,7 +2197,7 @@ bool Triple::shouldLowerf128AsLongDouble() const {
21972197
return true;
21982198

21992199
// By default, make the safe assumption that `long double !== f128`. This
2200-
// also catchex x86 (`long double` is x87 `f80`) and PowerPC (`long double`
2200+
// also catches x86 (`long double` is x87 `f80`) and PowerPC (`long double`
22012201
// is `f64` or PPC double-double).
22022202
return false;
22032203
}

0 commit comments

Comments
 (0)