From 7fc87360e94e97bae91161cda79e3e4b1c108ffe Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Tue, 13 Feb 2018 23:02:44 +0000 Subject: [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 --- llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/CodeGen') 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 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); -- cgit v1.2.3