@@ -123,7 +123,7 @@ class ELFRelocation {
123123
124124 static elf_sxword RelocAddend64 (const ELFRelocation &rel);
125125
126- bool IsRela () { return (reloc. is <ELFRela *>()); }
126+ bool IsRela () { return (llvm::isa <ELFRela *>(reloc )); }
127127
128128private:
129129 typedef llvm::PointerUnion<ELFRel *, ELFRela *> RelocUnion;
@@ -144,74 +144,74 @@ ELFRelocation::ELFRelocation(unsigned type) {
144144}
145145
146146ELFRelocation::~ELFRelocation () {
147- if (reloc. is <ELFRel *>())
148- delete reloc. get <ELFRel *>() ;
147+ if (auto *elfrel = llvm::dyn_cast <ELFRel *>(reloc ))
148+ delete elfrel ;
149149 else
150- delete reloc. get <ELFRela *>();
150+ delete llvm::cast <ELFRela *>(reloc );
151151}
152152
153153bool ELFRelocation::Parse (const lldb_private::DataExtractor &data,
154154 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);
157157 else
158- return reloc. get <ELFRela *>()->Parse (data, offset);
158+ return llvm::cast <ELFRela *>(reloc )->Parse (data, offset);
159159}
160160
161161unsigned 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 );
164164 else
165- return ELFRela::RelocType32 (*rel. reloc . get <ELFRela *>());
165+ return ELFRela::RelocType32 (*llvm::cast <ELFRela *>(rel. reloc ));
166166}
167167
168168unsigned 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 );
171171 else
172- return ELFRela::RelocType64 (*rel. reloc . get <ELFRela *>());
172+ return ELFRela::RelocType64 (*llvm::cast <ELFRela *>(rel. reloc ));
173173}
174174
175175unsigned 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 );
178178 else
179- return ELFRela::RelocSymbol32 (*rel. reloc . get <ELFRela *>());
179+ return ELFRela::RelocSymbol32 (*llvm::cast <ELFRela *>(rel. reloc ));
180180}
181181
182182unsigned 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 );
185185 else
186- return ELFRela::RelocSymbol64 (*rel. reloc . get <ELFRela *>());
186+ return ELFRela::RelocSymbol64 (*llvm::cast <ELFRela *>(rel. reloc ));
187187}
188188
189189elf_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 ;
192192 else
193- return rel. reloc . get <ELFRela *>()->r_offset ;
193+ return llvm::cast <ELFRela *>(rel. reloc )->r_offset ;
194194}
195195
196196elf_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 ;
199199 else
200- return rel. reloc . get <ELFRela *>()->r_offset ;
200+ return llvm::cast <ELFRela *>(rel. reloc )->r_offset ;
201201}
202202
203203elf_sxword ELFRelocation::RelocAddend32 (const ELFRelocation &rel) {
204- if (rel. reloc . is <ELFRel *>())
204+ if (llvm::isa <ELFRel *>(rel. reloc ))
205205 return 0 ;
206206 else
207- return rel. reloc . get <ELFRela *>()->r_addend ;
207+ return llvm::cast <ELFRela *>(rel. reloc )->r_addend ;
208208}
209209
210210elf_sxword ELFRelocation::RelocAddend64 (const ELFRelocation &rel) {
211- if (rel. reloc . is <ELFRel *>())
211+ if (llvm::isa <ELFRel *>(rel. reloc ))
212212 return 0 ;
213213 else
214- return rel. reloc . get <ELFRela *>()->r_addend ;
214+ return llvm::cast <ELFRela *>(rel. reloc )->r_addend ;
215215}
216216
217217static user_id_t SegmentID (size_t PHdrIndex) {
0 commit comments