llvm.org GIT mirror llvm / 60bc0ab
[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called. I don't think converting the inputs to the Ops was the right behavior anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238543 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 5 years ago
2 changed file(s) with 0 addition(s) and 61 deletion(s). Raw diff Collapse all Expand all
106106 virtual Init *convertValue( IntInit *II) { return nullptr; }
107107 virtual Init *convertValue(StringInit *SI) { return nullptr; }
108108 virtual Init *convertValue( ListInit *LI) { return nullptr; }
109 virtual Init *convertValue( UnOpInit *UO) {
110 return convertValue((TypedInit*)UO);
111 }
112 virtual Init *convertValue( BinOpInit *BO) {
113 return convertValue((TypedInit*)BO);
114 }
115 virtual Init *convertValue( TernOpInit *TO) {
116 return convertValue((TypedInit*)TO);
117 }
118109 virtual Init *convertValue(VarBitInit *VB) { return nullptr; }
119110 virtual Init *convertValue( DefInit *DI) { return nullptr; }
120111 virtual Init *convertValue( DagInit *DI) { return nullptr; }
239230 using RecTy::convertValue;
240231 Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
241232 Init *convertValue(StringInit *SI) override { return (Init*)SI; }
242 Init *convertValue( UnOpInit *UO) override;
243 Init *convertValue( BinOpInit *BO) override;
244233 Init *convertValue( TypedInit *TI) override;
245234
246235 std::string getAsString() const override { return "string"; }
295284
296285 using RecTy::convertValue;
297286 Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
298 Init *convertValue( UnOpInit *UO) override;
299 Init *convertValue( BinOpInit *BO) override;
300287 Init *convertValue( DagInit *DI) override { return (Init*)DI; }
301288 Init *convertValue( TypedInit *TI) override;
302289
246246 return kind==BitRecTyKind || kind==BitsRecTyKind || kind==IntRecTyKind;
247247 }
248248
249 Init *StringRecTy::convertValue(UnOpInit *UO) {
250 if (UO->getOpcode() == UnOpInit::CAST) {
251 Init *L = UO->getOperand()->convertInitializerTo(this);
252 if (!L) return nullptr;
253 if (L != UO->getOperand())
254 return UnOpInit::get(UnOpInit::CAST, L, StringRecTy::get());
255 return UO;
256 }
257
258 return convertValue((TypedInit*)UO);
259 }
260
261 Init *StringRecTy::convertValue(BinOpInit *BO) {
262 if (BO->getOpcode() == BinOpInit::STRCONCAT) {
263 Init *L = BO->getLHS()->convertInitializerTo(this);
264 Init *R = BO->getRHS()->convertInitializerTo(this);
265 if (!L || !R) return nullptr;
266 if (L != BO->getLHS() || R != BO->getRHS())
267 return BinOpInit::get(BinOpInit::STRCONCAT, L, R, StringRecTy::get());
268 return BO;
269 }
270
271 return convertValue((TypedInit*)BO);
272 }
273
274249
275250 Init *StringRecTy::convertValue(TypedInit *TI) {
276251 if (isa(TI->getType()))
316291 Init *DagRecTy::convertValue(TypedInit *TI) {
317292 if (TI->getType()->typeIsConvertibleTo(this))
318293 return TI;
319 return nullptr;
320 }
321
322 Init *DagRecTy::convertValue(UnOpInit *UO) {
323 if (UO->getOpcode() == UnOpInit::CAST) {
324 Init *L = UO->getOperand()->convertInitializerTo(this);
325 if (!L) return nullptr;
326 if (L != UO->getOperand())
327 return UnOpInit::get(UnOpInit::CAST, L, DagRecTy::get());
328 return UO;
329 }
330 return nullptr;
331 }
332
333 Init *DagRecTy::convertValue(BinOpInit *BO) {
334 if (BO->getOpcode() == BinOpInit::CONCAT) {
335 Init *L = BO->getLHS()->convertInitializerTo(this);
336 Init *R = BO->getRHS()->convertInitializerTo(this);
337 if (!L || !R) return nullptr;
338 if (L != BO->getLHS() || R != BO->getRHS())
339 return BinOpInit::get(BinOpInit::CONCAT, L, R, DagRecTy::get());
340 return BO;
341 }
342294 return nullptr;
343295 }
344296