mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 18:33:22 +00:00
Some compilers are picky about accessing the first element of a std::vector if
there's nothing in the vector. Pacify them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1010941954
commit
d5b207baab
@ -103,10 +103,13 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
SUnit *NewSUnit(SDNode *N) {
|
SUnit *NewSUnit(SDNode *N) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const SUnit *Addr = &SUnits[0];
|
const SUnit *Addr = 0;
|
||||||
|
if (SUnits.size() > 0)
|
||||||
|
Addr = &SUnits[0];
|
||||||
#endif
|
#endif
|
||||||
SUnits.push_back(SUnit(N, (unsigned)SUnits.size()));
|
SUnits.push_back(SUnit(N, (unsigned)SUnits.size()));
|
||||||
assert(Addr == &SUnits[0] && "SUnits std::vector reallocated on the fly!");
|
assert((Addr == 0 || Addr == &SUnits[0]) &&
|
||||||
|
"SUnits std::vector reallocated on the fly!");
|
||||||
SUnits.back().OrigNode = &SUnits.back();
|
SUnits.back().OrigNode = &SUnits.back();
|
||||||
return &SUnits.back();
|
return &SUnits.back();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user