TableGen: Remove Init::resolveListElementReference
authorNicolai Haehnle <nhaehnle@gmail.com>
Sun, 25 Feb 2018 20:50:04 +0000 (20:50 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Sun, 25 Feb 2018 20:50:04 +0000 (20:50 +0000)
commit801403acb358d3388636d3b36f28839758507306
tree4e28510a77fc1306cc97b7ae89f044171d0d40a7
parent836684aff3aeacb981ff500622d98981e9ac89ae
TableGen: Remove Init::resolveListElementReference

Summary:
Resolving a VarListElementInit should just resolve the list and then
take its element. This eliminates a lot of duplicated logic and
simplifies the next steps of refactoring resolveReferences.

This does potentially cause sub-elements of the entire list to be
resolved resulting in more work, but I didn't notice a measurable
change in performance, and a later patch adds a caching mechanism that
covers at least the common case of `var[i]` in a more generic way.

Change-Id: I7b59185b855c7368585c329c31e5be38c5749dac

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

Differential Revision: https://reviews.llvm.org/D43562

llvm-svn: 326059
llvm/include/llvm/TableGen/Record.h
llvm/lib/TableGen/Record.cpp