summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2018-02-13 23:02:44 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2018-02-13 23:02:44 +0000
commit7fc87360e94e97bae91161cda79e3e4b1c108ffe (patch)
treeae4fa418b7c895a4d6d3ce5cc9cab0d6546f15a8 /llvm/lib/CodeGen
parent3ce76ad26f18443ea2c2733c75343976ecff43ce (diff)
downloadbcm5719-llvm-7fc87360e94e97bae91161cda79e3e4b1c108ffe.tar.gz
bcm5719-llvm-7fc87360e94e97bae91161cda79e3e4b1c108ffe.zip
[globalisel][legalizerinfo] Follow up on post-commit review comments after r323681
* Document most API's * Delete a useless function call * Fix a discrepancy between the single and multi-opcode variants of getActionDefinitions(). The multi-opcode variant now requires that more than one opcode is requested. Previously it acted much like the single-opcode form but unnecessarily enforced the requirements of the multi-opcode form. llvm-svn: 325067
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index 3b8eb103297..6b2c3644749 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -261,6 +261,10 @@ LegalizeRuleSet &LegalizerInfo::getActionDefinitionsBuilder(
std::initializer_list<unsigned> Opcodes) {
unsigned Representative = *Opcodes.begin();
+ assert(Opcodes.begin() != Opcodes.end() &&
+ Opcodes.begin() + 1 != Opcodes.end() &&
+ "Initializer list must have at least two opcodes");
+
for (auto I = Opcodes.begin() + 1, E = Opcodes.end(); I != E; ++I)
aliasActionDefinitions(Representative, *I);
OpenPOWER on IntegriCloud