Skip to content

Commit 2ab7a75

Browse files
author
anoopkg6
committed
Fixed clang outputting extra byte '\7F' in clang test and fix a warning in SystemZISelLowering.cpp.
1 parent 5aef564 commit 2ab7a75

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

clang/lib/Basic/Targets/SystemZ.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
121121

122122
std::string convertConstraint(const char *&Constraint) const override {
123123
if (llvm::StringRef(Constraint).starts_with("@cc")) {
124+
auto Len = llvm::StringRef("@cc").size();
124125
std::string Converted =
125-
std::string("{") + std::string("@cc") + std::string("}");
126-
Constraint += 3;
126+
std::string("{") + std::string(Constraint, Len) + std::string("}");
127+
Constraint += Len - 1;
127128
return Converted;
128129
}
129130
switch (Constraint[0]) {

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8012,6 +8012,10 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
80128012
NewCCMask = NewCCMask1;
80138013
else if (isSRL_IPM_CCSequence(AndOp2.getNode()) && IsOp2)
80148014
NewCCMask = NewCCMask2;
8015+
else {
8016+
CCValid = RestoreCCValid;
8017+
return false;
8018+
}
80158019
// Bit 29 set => CC == 2 || CC == 3.
80168020
if ((NewCCMask & 0x3) == 2)
80178021
NewCCMask = SystemZ::CCMASK_2 | SystemZ::CCMASK_3;

0 commit comments

Comments
 (0)