[llvm] r339398 - [WebAssembly] Fix wasm backend compilation on gcc 5.4: variable name cannot match class
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 9 15:35:23 PDT 2018
Author: aheejin
Date: Thu Aug 9 15:35:23 2018
New Revision: 339398
URL: http://llvm.org/viewvc/llvm-project?rev=339398&view=rev
Log:
[WebAssembly] Fix wasm backend compilation on gcc 5.4: variable name cannot match class
Summary:
gcc does not like
const Region *Region;
It wants a different name for the variable.
Is there a better convention for what name to use in such a case?
Reviewers: sbc100, aheejin
Subscribers: aheejin, jgravelle-google, dschuff, llvm-commits
Differential Revision: https://reviews.llvm.org/D50472
Patch by Alon Zakai (kripken)
Modified:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp?rev=339398&r1=339397&r2=339398&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp Thu Aug 9 15:35:23 2018
@@ -212,7 +212,7 @@ struct CompareBlockNumbersBackwards {
/// Bookkeeping for a region to help ensure that we don't mix blocks not
/// dominated by the its header among its blocks.
struct Entry {
- const Region *Region;
+ const Region *TheRegion;
unsigned NumBlocksLeft;
/// List of blocks not dominated by Loop's header that are deferred until
@@ -220,7 +220,7 @@ struct Entry {
std::vector<MachineBasicBlock *> Deferred;
explicit Entry(const class Region *R)
- : Region(R), NumBlocksLeft(R->getNumBlocks()) {}
+ : TheRegion(R), NumBlocksLeft(R->getNumBlocks()) {}
};
} // end anonymous namespace
@@ -274,7 +274,7 @@ static void SortBlocks(MachineFunction &
// the last block in an active region, take it off the list and pick up
// any blocks deferred because the header didn't dominate them.
for (Entry &E : Entries)
- if (E.Region->contains(MBB) && --E.NumBlocksLeft == 0)
+ if (E.TheRegion->contains(MBB) && --E.NumBlocksLeft == 0)
for (auto DeferredBlock : E.Deferred)
Ready.push(DeferredBlock);
while (!Entries.empty() && Entries.back().NumBlocksLeft == 0)
@@ -299,7 +299,7 @@ static void SortBlocks(MachineFunction &
// If X isn't dominated by the top active region header, defer it until
// that region is done.
if (!Entries.empty() &&
- !MDT.dominates(Entries.back().Region->getHeader(), Next)) {
+ !MDT.dominates(Entries.back().TheRegion->getHeader(), Next)) {
Entries.back().Deferred.push_back(Next);
Next = nullptr;
continue;
@@ -329,7 +329,7 @@ static void SortBlocks(MachineFunction &
// If Next isn't dominated by the top active region header, defer it
// until that region is done.
if (!Entries.empty() &&
- !MDT.dominates(Entries.back().Region->getHeader(), Next)) {
+ !MDT.dominates(Entries.back().TheRegion->getHeader(), Next)) {
Entries.back().Deferred.push_back(Next);
continue;
}
More information about the llvm-commits
mailing list