[globalisel][tablegen] Fix an issue with lambdas when compiling with older GCC's

It seems that G++ 4.8 doesn't accept the 'enum A' in code of the form:
  enum A { ... };
  const auto &F = []() -> enum A { ... };
However, it does accept:
  typedef enum { ... } A;
  const auto &F = []() -> A { ... };



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Sanders 2017-07-20 10:25:00 +00:00
parent b16c6ff827
commit 35ce55c79f

View File

@ -29,8 +29,8 @@ bool InstructionSelector::executeMatchTable(
uint64_t CurrentIdx = 0;
SmallVector<uint64_t, 8> OnFailResumeAt;
enum RejectAction { RejectAndGiveUp, RejectAndResume };
auto handleReject = [&]() -> enum RejectAction {
typedef enum { RejectAndGiveUp, RejectAndResume } RejectAction;
auto handleReject = [&]() -> RejectAction {
DEBUG(dbgs() << CurrentIdx << ": Rejected\n");
if (OnFailResumeAt.empty())
return RejectAndGiveUp;