move some code around, fix a bug in the reader reading globalinits (which

I just introduced), stub out function reading, purge aggregate values from
the value table before reading functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-04-26 03:27:58 +00:00
parent eb0107af86
commit 198f34ac35
5 changed files with 123 additions and 69 deletions

View File

@@ -140,6 +140,22 @@ void ValueEnumerator::EnumerateType(const Type *Ty) {
EnumerateType(*I);
}
/// PurgeAggregateValues - If there are any aggregate values at the end of the
/// value list, remove them and return the count of the remaining values. If
/// there are none, return -1.
int ValueEnumerator::PurgeAggregateValues() {
// If there are no aggregate values at the end of the list, return -1.
if (Values.empty() || Values.back().first->getType()->isFirstClassType())
return -1;
// Otherwise, remove aggregate values...
while (!Values.empty() && !Values.back().first->getType()->isFirstClassType())
Values.pop_back();
// ... and return the new size.
return Values.size();
}
#if 0