@@ -123,7 +123,7 @@ class ELFRelocation {
123
123
124
124
static elf_sxword RelocAddend64 (const ELFRelocation &rel);
125
125
126
- bool IsRela () { return (reloc. is <ELFRela *>()); }
126
+ bool IsRela () { return (llvm::isa <ELFRela *>(reloc )); }
127
127
128
128
private:
129
129
typedef llvm::PointerUnion<ELFRel *, ELFRela *> RelocUnion;
@@ -144,74 +144,74 @@ ELFRelocation::ELFRelocation(unsigned type) {
144
144
}
145
145
146
146
ELFRelocation::~ELFRelocation () {
147
- if (reloc. is <ELFRel *>())
148
- delete reloc. get <ELFRel *>() ;
147
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(reloc ))
148
+ delete elfrel ;
149
149
else
150
- delete reloc. get <ELFRela *>();
150
+ delete llvm::cast <ELFRela *>(reloc );
151
151
}
152
152
153
153
bool ELFRelocation::Parse (const lldb_private::DataExtractor &data,
154
154
lldb::offset_t *offset) {
155
- if (reloc. is <ELFRel *>())
156
- return reloc. get <ELFRel *>() ->Parse (data, offset);
155
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(reloc ))
156
+ return elfrel ->Parse (data, offset);
157
157
else
158
- return reloc. get <ELFRela *>()->Parse (data, offset);
158
+ return llvm::cast <ELFRela *>(reloc )->Parse (data, offset);
159
159
}
160
160
161
161
unsigned ELFRelocation::RelocType32 (const ELFRelocation &rel) {
162
- if (rel. reloc . is <ELFRel *>())
163
- return ELFRel::RelocType32 (*rel. reloc . get <ELFRel *>() );
162
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(rel. reloc ))
163
+ return ELFRel::RelocType32 (*elfrel );
164
164
else
165
- return ELFRela::RelocType32 (*rel. reloc . get <ELFRela *>());
165
+ return ELFRela::RelocType32 (*llvm::cast <ELFRela *>(rel. reloc ));
166
166
}
167
167
168
168
unsigned ELFRelocation::RelocType64 (const ELFRelocation &rel) {
169
- if (rel. reloc . is <ELFRel *>())
170
- return ELFRel::RelocType64 (*rel. reloc . get <ELFRel *>() );
169
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(rel. reloc ))
170
+ return ELFRel::RelocType64 (*elfrel );
171
171
else
172
- return ELFRela::RelocType64 (*rel. reloc . get <ELFRela *>());
172
+ return ELFRela::RelocType64 (*llvm::cast <ELFRela *>(rel. reloc ));
173
173
}
174
174
175
175
unsigned ELFRelocation::RelocSymbol32 (const ELFRelocation &rel) {
176
- if (rel. reloc . is <ELFRel *>())
177
- return ELFRel::RelocSymbol32 (*rel. reloc . get <ELFRel *>() );
176
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(rel. reloc ))
177
+ return ELFRel::RelocSymbol32 (*elfrel );
178
178
else
179
- return ELFRela::RelocSymbol32 (*rel. reloc . get <ELFRela *>());
179
+ return ELFRela::RelocSymbol32 (*llvm::cast <ELFRela *>(rel. reloc ));
180
180
}
181
181
182
182
unsigned ELFRelocation::RelocSymbol64 (const ELFRelocation &rel) {
183
- if (rel. reloc . is <ELFRel *>())
184
- return ELFRel::RelocSymbol64 (*rel. reloc . get <ELFRel *>() );
183
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(rel. reloc ))
184
+ return ELFRel::RelocSymbol64 (*elfrel );
185
185
else
186
- return ELFRela::RelocSymbol64 (*rel. reloc . get <ELFRela *>());
186
+ return ELFRela::RelocSymbol64 (*llvm::cast <ELFRela *>(rel. reloc ));
187
187
}
188
188
189
189
elf_addr ELFRelocation::RelocOffset32 (const ELFRelocation &rel) {
190
- if (rel. reloc . is <ELFRel *>())
191
- return rel. reloc . get <ELFRel *>() ->r_offset ;
190
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(rel. reloc ))
191
+ return elfrel ->r_offset ;
192
192
else
193
- return rel. reloc . get <ELFRela *>()->r_offset ;
193
+ return llvm::cast <ELFRela *>(rel. reloc )->r_offset ;
194
194
}
195
195
196
196
elf_addr ELFRelocation::RelocOffset64 (const ELFRelocation &rel) {
197
- if (rel. reloc . is <ELFRel *>())
198
- return rel. reloc . get <ELFRel *>() ->r_offset ;
197
+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(rel. reloc ))
198
+ return elfrel ->r_offset ;
199
199
else
200
- return rel. reloc . get <ELFRela *>()->r_offset ;
200
+ return llvm::cast <ELFRela *>(rel. reloc )->r_offset ;
201
201
}
202
202
203
203
elf_sxword ELFRelocation::RelocAddend32 (const ELFRelocation &rel) {
204
- if (rel. reloc . is <ELFRel *>())
204
+ if (llvm::isa <ELFRel *>(rel. reloc ))
205
205
return 0 ;
206
206
else
207
- return rel. reloc . get <ELFRela *>()->r_addend ;
207
+ return llvm::cast <ELFRela *>(rel. reloc )->r_addend ;
208
208
}
209
209
210
210
elf_sxword ELFRelocation::RelocAddend64 (const ELFRelocation &rel) {
211
- if (rel. reloc . is <ELFRel *>())
211
+ if (llvm::isa <ELFRel *>(rel. reloc ))
212
212
return 0 ;
213
213
else
214
- return rel. reloc . get <ELFRela *>()->r_addend ;
214
+ return llvm::cast <ELFRela *>(rel. reloc )->r_addend ;
215
215
}
216
216
217
217
static user_id_t SegmentID (size_t PHdrIndex) {
0 commit comments