aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer/ValueEnumerator.cpp
diff options
context:
space:
mode:
authorJoe Abbey <jabbey@arxan.com>2012-11-25 15:23:39 +0000
committerJoe Abbey <jabbey@arxan.com>2012-11-25 15:23:39 +0000
commit170a15e98dc6900df1ae40d03c5f0622d792fb45 (patch)
tree6cc9986932a67d55d3bf0c4523e15785d7a725e7 /lib/Bitcode/Writer/ValueEnumerator.cpp
parentf4f14f68f6078ea6681ee27b5bf42719d7db3441 (diff)
downloadexternal_llvm-170a15e98dc6900df1ae40d03c5f0622d792fb45.zip
external_llvm-170a15e98dc6900df1ae40d03c5f0622d792fb45.tar.gz
external_llvm-170a15e98dc6900df1ae40d03c5f0622d792fb45.tar.bz2
Code Custodian:
- Widespread trailing space removal - A dash of OCD spacing to block align enums - joined a line that probably needed 80 cols a while back git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168566 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp
index cf3839d..6c43f43 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -95,7 +95,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
I->getAllMetadataOtherThanDebugLoc(MDs);
for (unsigned i = 0, e = MDs.size(); i != e; ++i)
EnumerateMetadata(MDs[i].second);
-
+
if (!I->getDebugLoc().isUnknown()) {
MDNode *Scope, *IA;
I->getDebugLoc().getScopeAndInlinedAt(Scope, IA, I->getContext());
@@ -363,16 +363,16 @@ void ValueEnumerator::EnumerateType(Type *Ty) {
if (StructType *STy = dyn_cast<StructType>(Ty))
if (!STy->isLiteral())
*TypeID = ~0U;
-
+
// Enumerate all of the subtypes before we enumerate this type. This ensures
// that the type will be enumerated in an order that can be directly built.
for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
I != E; ++I)
EnumerateType(*I);
-
+
// Refresh the TypeID pointer in case the table rehashed.
TypeID = &TypeMap[Ty];
-
+
// Check to see if we got the pointer another way. This can happen when
// enumerating recursive types that hit the base case deeper than they start.
//
@@ -380,10 +380,10 @@ void ValueEnumerator::EnumerateType(Type *Ty) {
// then emit the definition now that all of its contents are available.
if (*TypeID && *TypeID != ~0U)
return;
-
+
// Add this type now that its contents are all happily enumerated.
Types.push_back(Ty);
-
+
*TypeID = Types.size();
}
@@ -391,7 +391,7 @@ void ValueEnumerator::EnumerateType(Type *Ty) {
// walk through it, enumerating the types of the constant.
void ValueEnumerator::EnumerateOperandType(const Value *V) {
EnumerateType(V->getType());
-
+
if (const Constant *C = dyn_cast<Constant>(V)) {
// If this constant is already enumerated, ignore it, we know its type must
// be enumerated.
@@ -401,11 +401,11 @@ void ValueEnumerator::EnumerateOperandType(const Value *V) {
// them.
for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i) {
const Value *Op = C->getOperand(i);
-
+
// Don't enumerate basic blocks here, this happens as operands to
// blockaddress.
if (isa<BasicBlock>(Op)) continue;
-
+
EnumerateOperandType(Op);
}
@@ -482,7 +482,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) {
if (N->isFunctionLocal() && N->getFunction())
FnLocalMDVector.push_back(N);
}
-
+
if (!I->getType()->isVoidTy())
EnumerateValue(I);
}