Avoid naming variable after type to fix GCC 5.3 build
authorReid Kleckner <rnk@google.com>
Fri, 6 Dec 2019 19:24:25 +0000 (11:24 -0800)
committerReid Kleckner <rnk@google.com>
Fri, 6 Dec 2019 19:25:28 +0000 (11:25 -0800)
GCC says:
.../llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp:195:12:
error: ‘InfoType’ is not a class, namespace, or enumeration
       case InfoType::EndOfList:
                   ^

Presumably, GCC thinks InfoType is a variable here. Work around it by
using the name IT as is done above.

llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp

index 26aab06..6731a8b 100644 (file)
@@ -183,7 +183,7 @@ llvm::Expected<LookupResult> FunctionInfo::lookup(DataExtractor &Data,
     if (!Data.isValidOffsetForDataOfSize(Offset, 8))
       return createStringError(std::errc::io_error,
                                "FunctionInfo data is truncated");
-    const uint32_t InfoType = Data.getU32(&Offset);
+    const uint32_t IT = Data.getU32(&Offset);
     const uint32_t InfoLength = Data.getU32(&Offset);
     const StringRef InfoBytes = Data.getData().substr(Offset, InfoLength);
     if (InfoLength != InfoBytes.size())
@@ -191,7 +191,7 @@ llvm::Expected<LookupResult> FunctionInfo::lookup(DataExtractor &Data,
                                "FunctionInfo data is truncated");
     DataExtractor InfoData(InfoBytes, Data.isLittleEndian(),
                            Data.getAddressSize());
-    switch (InfoType) {
+    switch (IT) {
       case InfoType::EndOfList:
         Done = true;
         break;