diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-23 01:55:30 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-23 01:55:30 +0000 |
commit | 30499844ead34cae1687c3fb2cb697a695a38db2 (patch) | |
tree | e4ed6d258fb8c12ad953a3352bbdb7275829dac3 /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | |
parent | 53b2698531719c987822f8352844a23ab2d8c9d8 (diff) | |
download | llvm-30499844ead34cae1687c3fb2cb697a695a38db2.zip llvm-30499844ead34cae1687c3fb2cb697a695a38db2.tar.gz llvm-30499844ead34cae1687c3fb2cb697a695a38db2.tar.bz2 |
Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.
Note that this does not yet include CodeGen support.
llvm-svn: 51468
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index 92271ce..21d0dfe 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -21,9 +21,9 @@ #include <algorithm> using namespace llvm; -static bool isFirstClassType(const std::pair<const llvm::Type*, - unsigned int> &P) { - return P.first->isFirstClassType(); +static bool isSingleValueType(const std::pair<const llvm::Type*, + unsigned int> &P) { + return P.first->isSingleValueType(); } static bool isIntegerValue(const std::pair<const Value*, unsigned> &V) { @@ -103,10 +103,10 @@ ValueEnumerator::ValueEnumerator(const Module *M) { // in the table (have low bit-width). std::stable_sort(Types.begin(), Types.end(), CompareByFrequency); - // Partition the Type ID's so that the first-class types occur before the + // Partition the Type ID's so that the single-value types occur before the // aggregate types. This allows the aggregate types to be dropped from the // type table after parsing the global variable initializers. - std::partition(Types.begin(), Types.end(), isFirstClassType); + std::partition(Types.begin(), Types.end(), isSingleValueType); // Now that we rearranged the type table, rebuild TypeMap. for (unsigned i = 0, e = Types.size(); i != e; ++i) @@ -264,11 +264,11 @@ void ValueEnumerator::EnumerateParamAttrs(const PAListPtr &PAL) { /// 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()) + if (Values.empty() || Values.back().first->getType()->isSingleValueType()) return -1; // Otherwise, remove aggregate values... - while (!Values.empty() && !Values.back().first->getType()->isFirstClassType()) + while (!Values.empty() && !Values.back().first->getType()->isSingleValueType()) Values.pop_back(); // ... and return the new size. |