@@ -160,29 +160,33 @@ class MachineInstr
160160 // /
161161 // / This has to be defined eagerly due to the implementation constraints of
162162 // / `PointerSumType` where it is used.
163- class ExtraInfo final : TrailingObjects<ExtraInfo, MachineMemOperand *,
164- MCSymbol *, MDNode *, uint32_t > {
163+ class ExtraInfo final
164+ : TrailingObjects<ExtraInfo, MachineMemOperand *, MCSymbol *, MDNode *,
165+ uint32_t , Value *> {
165166 public:
166167 static ExtraInfo *create (BumpPtrAllocator &Allocator,
167168 ArrayRef<MachineMemOperand *> MMOs,
168169 MCSymbol *PreInstrSymbol = nullptr ,
169170 MCSymbol *PostInstrSymbol = nullptr ,
170171 MDNode *HeapAllocMarker = nullptr ,
171172 MDNode *PCSections = nullptr , uint32_t CFIType = 0 ,
172- MDNode *MMRAs = nullptr ) {
173+ MDNode *MMRAs = nullptr , Value *DS = nullptr ) {
173174 bool HasPreInstrSymbol = PreInstrSymbol != nullptr ;
174175 bool HasPostInstrSymbol = PostInstrSymbol != nullptr ;
175176 bool HasHeapAllocMarker = HeapAllocMarker != nullptr ;
176177 bool HasMMRAs = MMRAs != nullptr ;
177178 bool HasCFIType = CFIType != 0 ;
178179 bool HasPCSections = PCSections != nullptr ;
180+ bool HasDS = DS != nullptr ;
179181 auto *Result = new (Allocator.Allocate (
180- totalSizeToAlloc<MachineMemOperand *, MCSymbol *, MDNode *, uint32_t >(
182+ totalSizeToAlloc<MachineMemOperand *, MCSymbol *, MDNode *, uint32_t ,
183+ Value *>(
181184 MMOs.size (), HasPreInstrSymbol + HasPostInstrSymbol,
182- HasHeapAllocMarker + HasPCSections + HasMMRAs, HasCFIType),
185+ HasHeapAllocMarker + HasPCSections + HasMMRAs, HasCFIType, HasDS ),
183186 alignof (ExtraInfo)))
184187 ExtraInfo (MMOs.size (), HasPreInstrSymbol, HasPostInstrSymbol,
185- HasHeapAllocMarker, HasPCSections, HasCFIType, HasMMRAs);
188+ HasHeapAllocMarker, HasPCSections, HasCFIType, HasMMRAs,
189+ HasDS);
186190
187191 // Copy the actual data into the trailing objects.
188192 llvm::copy (MMOs, Result->getTrailingObjects <MachineMemOperand *>());
@@ -202,6 +206,8 @@ class MachineInstr
202206 Result->getTrailingObjects <uint32_t >()[0 ] = CFIType;
203207 if (HasMMRAs)
204208 Result->getTrailingObjects <MDNode *>()[MDNodeIdx++] = MMRAs;
209+ if (HasDS)
210+ Result->getTrailingObjects <Value *>()[0 ] = DS;
205211
206212 return Result;
207213 }
@@ -240,6 +246,10 @@ class MachineInstr
240246 : nullptr ;
241247 }
242248
249+ Value *getDeactivationSymbol () const {
250+ return HasDS ? getTrailingObjects<Value *>()[0 ] : 0 ;
251+ }
252+
243253 private:
244254 friend TrailingObjects;
245255
@@ -255,6 +265,7 @@ class MachineInstr
255265 const bool HasPCSections;
256266 const bool HasCFIType;
257267 const bool HasMMRAs;
268+ const bool HasDS;
258269
259270 // Implement the `TrailingObjects` internal API.
260271 size_t numTrailingObjects (OverloadToken<MachineMemOperand *>) const {
@@ -269,16 +280,17 @@ class MachineInstr
269280 size_t numTrailingObjects (OverloadToken<uint32_t >) const {
270281 return HasCFIType;
271282 }
283+ size_t numTrailingObjects (OverloadToken<Value *>) const { return HasDS; }
272284
273285 // Just a boring constructor to allow us to initialize the sizes. Always use
274286 // the `create` routine above.
275287 ExtraInfo (int NumMMOs, bool HasPreInstrSymbol, bool HasPostInstrSymbol,
276288 bool HasHeapAllocMarker, bool HasPCSections, bool HasCFIType,
277- bool HasMMRAs)
289+ bool HasMMRAs, bool HasDS )
278290 : NumMMOs(NumMMOs), HasPreInstrSymbol(HasPreInstrSymbol),
279291 HasPostInstrSymbol (HasPostInstrSymbol),
280292 HasHeapAllocMarker(HasHeapAllocMarker), HasPCSections(HasPCSections),
281- HasCFIType(HasCFIType), HasMMRAs(HasMMRAs) {}
293+ HasCFIType(HasCFIType), HasMMRAs(HasMMRAs), HasDS(HasDS) {}
282294 };
283295
284296 // / Enumeration of the kinds of inline extra info available. It is important
@@ -867,6 +879,14 @@ class MachineInstr
867879 return nullptr ;
868880 }
869881
882+ Value *getDeactivationSymbol () const {
883+ if (!Info)
884+ return nullptr ;
885+ if (ExtraInfo *EI = Info.get <EIIK_OutOfLine>())
886+ return EI->getDeactivationSymbol ();
887+ return nullptr ;
888+ }
889+
870890 // / Helper to extract a CFI type hash if one has been added.
871891 uint32_t getCFIType () const {
872892 if (!Info)
@@ -1969,6 +1989,8 @@ class MachineInstr
19691989 // / Set the CFI type for the instruction.
19701990 LLVM_ABI void setCFIType (MachineFunction &MF, uint32_t Type);
19711991
1992+ LLVM_ABI void setDeactivationSymbol (MachineFunction &MF, Value *DS);
1993+
19721994 // / Return the MIFlags which represent both MachineInstrs. This
19731995 // / should be used when merging two MachineInstrs into one. This routine does
19741996 // / not modify the MIFlags of this MachineInstr.
@@ -2088,7 +2110,7 @@ class MachineInstr
20882110 void setExtraInfo (MachineFunction &MF, ArrayRef<MachineMemOperand *> MMOs,
20892111 MCSymbol *PreInstrSymbol, MCSymbol *PostInstrSymbol,
20902112 MDNode *HeapAllocMarker, MDNode *PCSections,
2091- uint32_t CFIType, MDNode *MMRAs);
2113+ uint32_t CFIType, MDNode *MMRAs, Value *DS );
20922114};
20932115
20942116// / Special DenseMapInfo traits to compare MachineInstr* by *value* of the
0 commit comments