@@ -181,27 +181,26 @@ const char *getEdgeKindName(Edge::Kind K);
181181// / Apply fixup expression for edge to block content.
182182inline Error applyFixup (LinkGraph &G, Block &B, const Edge &E,
183183 const Symbol *GOTSymbol) {
184- using namespace i386 ;
185184 using namespace llvm ::support;
186185
187186 char *BlockWorkingMem = B.getAlreadyMutableContent ().data ();
188187 char *FixupPtr = BlockWorkingMem + E.getOffset ();
189188 auto FixupAddress = B.getAddress () + E.getOffset ();
190189
191190 switch (E.getKind ()) {
192- case i386:: Pointer32: {
191+ case Pointer32: {
193192 uint32_t Value = E.getTarget ().getAddress ().getValue () + E.getAddend ();
194193 *(ulittle32_t *)FixupPtr = Value;
195194 break ;
196195 }
197196
198- case i386:: PCRel32: {
197+ case PCRel32: {
199198 int32_t Value = E.getTarget ().getAddress () - FixupAddress + E.getAddend ();
200199 *(little32_t *)FixupPtr = Value;
201200 break ;
202201 }
203202
204- case i386:: Pointer16: {
203+ case Pointer16: {
205204 uint32_t Value = E.getTarget ().getAddress ().getValue () + E.getAddend ();
206205 if (LLVM_LIKELY (isUInt<16 >(Value)))
207206 *(ulittle16_t *)FixupPtr = Value;
@@ -210,7 +209,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
210209 break ;
211210 }
212211
213- case i386:: PCRel16: {
212+ case PCRel16: {
214213 int32_t Value = E.getTarget ().getAddress () - FixupAddress + E.getAddend ();
215214 if (LLVM_LIKELY (isInt<16 >(Value)))
216215 *(little16_t *)FixupPtr = Value;
@@ -219,23 +218,23 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
219218 break ;
220219 }
221220
222- case i386:: Delta32: {
221+ case Delta32: {
223222 int32_t Value = E.getTarget ().getAddress () - FixupAddress + E.getAddend ();
224223 *(little32_t *)FixupPtr = Value;
225224 break ;
226225 }
227226
228- case i386:: Delta32FromGOT: {
227+ case Delta32FromGOT: {
229228 assert (GOTSymbol && " No GOT section symbol" );
230229 int32_t Value =
231230 E.getTarget ().getAddress () - GOTSymbol->getAddress () + E.getAddend ();
232231 *(little32_t *)FixupPtr = Value;
233232 break ;
234233 }
235234
236- case i386:: BranchPCRel32:
237- case i386:: BranchPCRel32ToPtrJumpStub:
238- case i386:: BranchPCRel32ToPtrJumpStubBypassable: {
235+ case BranchPCRel32:
236+ case BranchPCRel32ToPtrJumpStub:
237+ case BranchPCRel32ToPtrJumpStubBypassable: {
239238 int32_t Value = E.getTarget ().getAddress () - FixupAddress + E.getAddend ();
240239 *(little32_t *)FixupPtr = Value;
241240 break ;
@@ -321,14 +320,14 @@ class GOTTableManager : public TableManager<GOTTableManager> {
321320 bool visitEdge (LinkGraph &G, Block *B, Edge &E) {
322321 Edge::Kind KindToSet = Edge::Invalid;
323322 switch (E.getKind ()) {
324- case i386:: Delta32FromGOT: {
323+ case Delta32FromGOT: {
325324 // we need to make sure that the GOT section exists, but don't otherwise
326325 // need to fix up this edge
327326 getGOTSection (G);
328327 return false ;
329328 }
330- case i386:: RequestGOTAndTransformToDelta32FromGOT:
331- KindToSet = i386:: Delta32FromGOT;
329+ case RequestGOTAndTransformToDelta32FromGOT:
330+ KindToSet = Delta32FromGOT;
332331 break ;
333332 default :
334333 return false ;
@@ -367,15 +366,15 @@ class PLTTableManager : public TableManager<PLTTableManager> {
367366 static StringRef getSectionName () { return " $__STUBS" ; }
368367
369368 bool visitEdge (LinkGraph &G, Block *B, Edge &E) {
370- if (E.getKind () == i386:: BranchPCRel32 && !E.getTarget ().isDefined ()) {
369+ if (E.getKind () == BranchPCRel32 && !E.getTarget ().isDefined ()) {
371370 DEBUG_WITH_TYPE (" jitlink" , {
372371 dbgs () << " Fixing " << G.getEdgeKindName (E.getKind ()) << " edge at "
373372 << B->getFixupAddress (E) << " (" << B->getAddress () << " + "
374373 << formatv (" {0:x}" , E.getOffset ()) << " )\n " ;
375374 });
376375 // Set the edge kind to Branch32ToPtrJumpStubBypassable to enable it to
377376 // be optimized when the target is in-range.
378- E.setKind (i386:: BranchPCRel32ToPtrJumpStubBypassable);
377+ E.setKind (BranchPCRel32ToPtrJumpStubBypassable);
379378 E.setTarget (getEntryForTarget (G, E.getTarget ()));
380379 return true ;
381380 }
0 commit comments