Skip to content

Commit 9633e04

Browse files
committed
Address review comments
1 parent c146bd4 commit 9633e04

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

llvm/include/llvm/CodeGen/AsmPrinter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ class AsmPrinter : public MachineFunctionPass {
586586
emitGlobalConstant(DL, CV);
587587
}
588588

589-
/// Lower the specified ptrauth constant to an MCExpr.
590589
virtual const MCExpr *lowerConstantPtrAuth(const ConstantPtrAuth &CPA) {
591590
report_fatal_error("ptrauth constant lowering not implemented");
592591
}

llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#include "llvm/CodeGen/TargetRegisterInfo.h"
4444
#include "llvm/IR/DataLayout.h"
4545
#include "llvm/IR/DebugInfoMetadata.h"
46-
#include "llvm/IR/DiagnosticInfo.h"
47-
#include "llvm/IR/DiagnosticPrinter.h"
4846
#include "llvm/MC/MCAsmInfo.h"
4947
#include "llvm/MC/MCContext.h"
5048
#include "llvm/MC/MCInst.h"
@@ -1611,12 +1609,14 @@ AArch64AsmPrinter::lowerConstantPtrAuth(const ConstantPtrAuth &CPA) {
16111609
// We later rely on valid KeyID value in AArch64PACKeyIDToString call from
16121610
// AArch64AuthMCExpr::printImpl, so fail fast.
16131611
if (KeyID > AArch64PACKey::LAST)
1614-
report_fatal_error("invalid AArch64 PAC Key ID '" + Twine(KeyID) + "'");
1612+
report_fatal_error("AArch64 PAC Key ID '" + Twine(KeyID) +
1613+
"' out of range [0, " +
1614+
Twine((unsigned)AArch64PACKey::LAST) + "]");
16151615

16161616
uint64_t Disc = CPA.getDiscriminator()->getZExtValue();
16171617
if (!isUInt<16>(Disc))
1618-
report_fatal_error("invalid AArch64 PAC Discriminator '" + Twine(Disc) +
1619-
"'");
1618+
report_fatal_error("AArch64 PAC Discriminator '" + Twine(Disc) +
1619+
"' out of range [0, 0xFFFF]");
16201620

16211621
// Finally build the complete @AUTH expr.
16221622
return AArch64AuthMCExpr::create(Sym, Disc, AArch64PACKey::ID(KeyID),

llvm/test/CodeGen/AArch64/ptrauth-reloc.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
; RUN: -global-isel -verify-machineinstrs -global-isel-abort=1 2>&1 \
152152
; RUN: | FileCheck %s --check-prefix=CHECK-ERR-KEY
153153

154-
; CHECK-ERR-KEY: LLVM ERROR: invalid AArch64 PAC Key ID '4'
154+
; CHECK-ERR-KEY: LLVM ERROR: AArch64 PAC Key ID '4' out of range [0, 3]
155155

156156
@g = external global i32
157157
@g.ref.4.0 = constant ptr ptrauth (ptr @g, i32 4, i64 0)
@@ -170,7 +170,7 @@
170170
; RUN: -global-isel -verify-machineinstrs -global-isel-abort=1 2>&1 \
171171
; RUN: | FileCheck %s --check-prefix=CHECK-ERR-DISC
172172

173-
; CHECK-ERR-DISC: LLVM ERROR: invalid AArch64 PAC Discriminator '65536'
173+
; CHECK-ERR-DISC: LLVM ERROR: AArch64 PAC Discriminator '65536' out of range [0, 0xFFFF]
174174

175175
@g = external global i32
176176
@g.ref.ia.65536 = constant ptr ptrauth (ptr @g, i32 0, i64 65536)

0 commit comments

Comments
 (0)