[llvm] r372179 - Fix buildbots.
Greg Clayton via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 13:31:01 PDT 2019
Author: gclayton
Date: Tue Sep 17 13:31:01 2019
New Revision: 372179
URL: http://llvm.org/viewvc/llvm-project?rev=372179&view=rev
Log:
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.
Modified:
llvm/trunk/unittests/DebugInfo/GSYM/GSYMTest.cpp
Modified: llvm/trunk/unittests/DebugInfo/GSYM/GSYMTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/GSYM/GSYMTest.cpp?rev=372179&r1=372178&r2=372179&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/GSYM/GSYMTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/GSYM/GSYMTest.cpp Tue Sep 17 13:31:01 2019
@@ -255,19 +255,7 @@ static void TestFunctionInfoEncodeDecode
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);
}
More information about the llvm-commits
mailing list