diff options
| author | Greg Clayton <clayborg@gmail.com> | 2019-09-17 20:31:01 +0000 |
|---|---|---|
| committer | Greg Clayton <clayborg@gmail.com> | 2019-09-17 20:31:01 +0000 |
| commit | f71ececda2038b3ee2e448c8c151e1bea2906ba3 (patch) | |
| tree | c84ce6d90c2c29061d5bdee270de60a1ca968bfa | |
| parent | 6f1f3cfc5ac2f3188370928668b8ca7d3f06d47f (diff) | |
| download | bcm5719-llvm-f71ececda2038b3ee2e448c8c151e1bea2906ba3.tar.gz bcm5719-llvm-f71ececda2038b3ee2e448c8c151e1bea2906ba3.zip | |
Fix buildbots.
MSVC doesn't correctly capture constexpr in lambdas, and other builds warn if you do, others will error out if you do. Avoid lambdas.
llvm-svn: 372179
| -rw-r--r-- | llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp index ba543e02735..421544ee1d4 100644 --- a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp +++ b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp @@ -255,19 +255,7 @@ static void TestFunctionInfoEncodeDecode(llvm::support::endianness ByteOrder, EXPECT_EQ(FI, Decoded.get()); } - -TEST(GSYMTest, TestFunctionInfoEncoding) { - constexpr uint64_t FuncAddr = 0x1000; - constexpr uint64_t FuncSize = 0x100; - constexpr uint32_t FuncName = 1; - constexpr uint32_t FileIdx = 1; - // Make sure that we can encode and decode a FunctionInfo with no line table - // or inline info. - FunctionInfo FI(FuncAddr, FuncSize, FuncName); - TestFunctionInfoEncodeDecode(llvm::support::little, FI); - TestFunctionInfoEncodeDecode(llvm::support::big, FI); - - auto AddLinesLambda = [FuncAddr, FileIdx](FunctionInfo &FI) { +static void AddLines(uint64_t FuncAddr, uint32_t FileIdx, FunctionInfo &FI) { FI.OptLineTable = LineTable(); LineEntry Line0(FuncAddr + 0x000, FileIdx, 10); LineEntry Line1(FuncAddr + 0x010, FileIdx, 11); @@ -275,9 +263,10 @@ TEST(GSYMTest, TestFunctionInfoEncoding) { FI.OptLineTable->push(Line0); FI.OptLineTable->push(Line1); FI.OptLineTable->push(Line2); - }; +} - auto AddInlineLambda = [FuncAddr, FuncSize](FunctionInfo &FI) { + +static void AddInline(uint64_t FuncAddr, uint64_t FuncSize, FunctionInfo &FI) { FI.Inline = InlineInfo(); FI.Inline->Ranges.insert(AddressRange(FuncAddr, FuncAddr + FuncSize)); InlineInfo Inline1; @@ -286,27 +275,38 @@ TEST(GSYMTest, TestFunctionInfoEncoding) { Inline1.CallFile = 1; Inline1.CallLine = 11; FI.Inline->Children.push_back(Inline1); - }; +} + +TEST(GSYMTest, TestFunctionInfoEncoding) { + constexpr uint64_t FuncAddr = 0x1000; + constexpr uint64_t FuncSize = 0x100; + constexpr uint32_t FuncName = 1; + constexpr uint32_t FileIdx = 1; + // Make sure that we can encode and decode a FunctionInfo with no line table + // or inline info. + FunctionInfo FI(FuncAddr, FuncSize, FuncName); + TestFunctionInfoEncodeDecode(llvm::support::little, FI); + TestFunctionInfoEncodeDecode(llvm::support::big, FI); // Make sure that we can encode and decode a FunctionInfo with a line table // and no inline info. FunctionInfo FILines(FuncAddr, FuncSize, FuncName); - AddLinesLambda(FILines); + AddLines(FuncAddr, FileIdx, FILines); TestFunctionInfoEncodeDecode(llvm::support::little, FILines); TestFunctionInfoEncodeDecode(llvm::support::big, FILines); // Make sure that we can encode and decode a FunctionInfo with no line table // and with inline info. FunctionInfo FIInline(FuncAddr, FuncSize, FuncName); - AddInlineLambda(FIInline); + AddInline(FuncAddr, FuncSize, FIInline); TestFunctionInfoEncodeDecode(llvm::support::little, FIInline); TestFunctionInfoEncodeDecode(llvm::support::big, FIInline); // Make sure that we can encode and decode a FunctionInfo with no line table // and with inline info. FunctionInfo FIBoth(FuncAddr, FuncSize, FuncName); - AddLinesLambda(FIBoth); - AddInlineLambda(FIBoth); + AddLines(FuncAddr, FileIdx, FIBoth); + AddInline(FuncAddr, FuncSize, FIBoth); TestFunctionInfoEncodeDecode(llvm::support::little, FIBoth); TestFunctionInfoEncodeDecode(llvm::support::big, FIBoth); } |

