@@ -99,8 +99,7 @@ bool AArch64MachObjectWriter::getAArch64FixupKindMachOInfo(
9999 // This encompasses the relocation for the whole 21-bit value.
100100 switch (Spec) {
101101 default :
102- Asm.getContext ().reportError (Fixup.getLoc (),
103- " ADR/ADRP relocations must be GOT relative" );
102+ reportError (Fixup.getLoc (), " ADR/ADRP relocations must be GOT relative" );
104103 return false ;
105104 case AArch64MCExpr::M_PAGE:
106105 RelocType = unsigned (MachO::ARM64_RELOC_PAGE21);
@@ -176,25 +175,24 @@ void AArch64MachObjectWriter::recordRelocation(
176175 // assembler local symbols. If we got here, that's not what we have,
177176 // so complain loudly.
178177 if (Kind == AArch64::fixup_aarch64_pcrel_branch19) {
179- Asm. getContext (). reportError (
180- Fixup. getLoc (), " conditional branch requires assembler-local "
181- " label. ' " +
182- Target. getAddSym ()-> getName () + " ' is external." );
178+ reportError (Fixup. getLoc (), " conditional branch requires assembler-local "
179+ " label. ' " +
180+ Target. getAddSym ()-> getName () +
181+ " ' is external." );
183182 return ;
184183 }
185184
186185 // 14-bit branch relocations should only target internal labels, and so
187186 // should never get here.
188187 if (Kind == AArch64::fixup_aarch64_pcrel_branch14) {
189- Asm.getContext ().reportError (Fixup.getLoc (),
190- " Invalid relocation on conditional branch!" );
188+ reportError (Fixup.getLoc (), " Invalid relocation on conditional branch!" );
191189 return ;
192190 }
193191
194192 if (!getAArch64FixupKindMachOInfo (
195193 Fixup, Type, AArch64MCExpr::Specifier (Target.getSpecifier ()),
196194 Log2Size, Asm)) {
197- Asm. getContext (). reportError (Fixup.getLoc (), " unknown AArch64 fixup kind!" );
195+ reportError (Fixup.getLoc (), " unknown AArch64 fixup kind!" );
198196 return ;
199197 }
200198
@@ -206,8 +204,7 @@ void AArch64MachObjectWriter::recordRelocation(
206204 Type = MachO::ARM64_RELOC_UNSIGNED;
207205
208206 if (IsPCRel) {
209- Asm.getContext ().reportError (Fixup.getLoc (),
210- " PC relative absolute relocation!" );
207+ reportError (Fixup.getLoc (), " PC relative absolute relocation!" );
211208 return ;
212209
213210 // FIXME: x86_64 sets the type to a branch reloc here. Should we do
@@ -234,16 +231,14 @@ void AArch64MachObjectWriter::recordRelocation(
234231 return ;
235232 } else if (Target.getSpecifier () != AArch64MCExpr::None) {
236233 // Otherwise, neither symbol can be modified.
237- Asm.getContext ().reportError (Fixup.getLoc (),
238- " unsupported relocation of modified symbol" );
234+ reportError (Fixup.getLoc (), " unsupported relocation of modified symbol" );
239235 return ;
240236 }
241237
242238 // We don't support PCrel relocations of differences.
243239 if (IsPCRel) {
244- Asm.getContext ().reportError (Fixup.getLoc (),
245- " unsupported pc-relative relocation of "
246- " difference" );
240+ reportError (Fixup.getLoc (), " unsupported pc-relative relocation of "
241+ " difference" );
247242 return ;
248243 }
249244
@@ -254,23 +249,20 @@ void AArch64MachObjectWriter::recordRelocation(
254249 // FIXME: We should probably just synthesize an external symbol and use
255250 // that.
256251 if (!A_Base) {
257- Asm.getContext ().reportError (
258- Fixup.getLoc (),
259- " unsupported relocation of local symbol '" + A->getName () +
260- " '. Must have non-local symbol earlier in section." );
252+ reportError (Fixup.getLoc (),
253+ " unsupported relocation of local symbol '" + A->getName () +
254+ " '. Must have non-local symbol earlier in section." );
261255 return ;
262256 }
263257 if (!B_Base) {
264- Asm.getContext ().reportError (
265- Fixup.getLoc (),
266- " unsupported relocation of local symbol '" + B->getName () +
267- " '. Must have non-local symbol earlier in section." );
258+ reportError (Fixup.getLoc (),
259+ " unsupported relocation of local symbol '" + B->getName () +
260+ " '. Must have non-local symbol earlier in section." );
268261 return ;
269262 }
270263
271264 if (A_Base == B_Base && A_Base) {
272- Asm.getContext ().reportError (
273- Fixup.getLoc (), " unsupported relocation with identical base" );
265+ reportError (Fixup.getLoc (), " unsupported relocation with identical base" );
274266 return ;
275267 }
276268
@@ -303,10 +295,10 @@ void AArch64MachObjectWriter::recordRelocation(
303295 // Make sure that the symbol is actually in a section here. If it isn't,
304296 // emit an error and exit.
305297 if (!Symbol->isInSection ()) {
306- Asm. getContext (). reportError (
307- Fixup. getLoc (),
308- " unsupported relocation of local symbol ' " + Symbol->getName () +
309- " '. Must have non-local symbol earlier in section." );
298+ reportError (Fixup. getLoc (),
299+ " unsupported relocation of local symbol ' " +
300+ Symbol->getName () +
301+ " '. Must have non-local symbol earlier in section." );
310302 return ;
311303 }
312304 const MCSection &Sec = Symbol->getSection ();
@@ -340,10 +332,10 @@ void AArch64MachObjectWriter::recordRelocation(
340332 Value += Asm.getSymbolOffset (*Symbol) - Asm.getSymbolOffset (*Base);
341333 } else if (Symbol->isInSection ()) {
342334 if (!CanUseLocalRelocation) {
343- Asm. getContext (). reportError (
344- Fixup. getLoc (),
345- " unsupported relocation of local symbol ' " + Symbol->getName () +
346- " '. Must have non-local symbol earlier in section." );
335+ reportError (Fixup. getLoc (),
336+ " unsupported relocation of local symbol ' " +
337+ Symbol->getName () +
338+ " '. Must have non-local symbol earlier in section." );
347339 return ;
348340 }
349341 // Adjust the relocation to be section-relative.
@@ -369,8 +361,7 @@ void AArch64MachObjectWriter::recordRelocation(
369361 Type == MachO::ARM64_RELOC_PAGEOFF12) &&
370362 Value) {
371363 if (!isInt<24 >(Value)) {
372- Asm.getContext ().reportError (Fixup.getLoc (),
373- " addend too big for relocation" );
364+ reportError (Fixup.getLoc (), " addend too big for relocation" );
374365 return ;
375366 }
376367
@@ -398,30 +389,27 @@ void AArch64MachObjectWriter::recordRelocation(
398389 assert (Type == MachO::ARM64_RELOC_UNSIGNED);
399390
400391 if (IsPCRel) {
401- Asm.getContext ().reportError (Fixup.getLoc (),
402- " invalid PC relative auth relocation" );
392+ reportError (Fixup.getLoc (), " invalid PC relative auth relocation" );
403393 return ;
404394 }
405395
406396 if (Log2Size != 3 ) {
407- Asm. getContext (). reportError (
408- Fixup. getLoc (), " invalid auth relocation size, must be 8 bytes" );
397+ reportError (Fixup. getLoc (),
398+ " invalid auth relocation size, must be 8 bytes" );
409399 return ;
410400 }
411401
412402 if (Target.getSubSym ()) {
413- Asm.getContext ().reportError (
414- Fixup.getLoc (),
415- " invalid auth relocation, can't reference two symbols" );
403+ reportError (Fixup.getLoc (),
404+ " invalid auth relocation, can't reference two symbols" );
416405 return ;
417406 }
418407
419408 uint16_t Discriminator = Expr->getDiscriminator ();
420409 AArch64PACKey::ID Key = Expr->getKey ();
421410
422411 if (!isInt<32 >(Value)) {
423- Asm.getContext ().reportError (Fixup.getLoc (),
424- " addend too big for relocation" );
412+ reportError (Fixup.getLoc (), " addend too big for relocation" );
425413 return ;
426414 }
427415
0 commit comments