diff options
author | Devang Patel <dpatel@apple.com> | 2007-10-30 20:59:40 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-10-30 20:59:40 +0000 |
commit | e9b8c0a38549692f1b8f688c05c35442fc620865 (patch) | |
tree | 177348ef361afb9ae423494cdf6acc63c7461f4d /CodeGen/CodeGenModule.cpp | |
parent | fb1051be453b29904077476d4d1bb804e42ecabb (diff) |
Fix 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r-- | CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp index 00c262167c..b5f4c8d1ff 100644 --- a/CodeGen/CodeGenModule.cpp +++ b/CodeGen/CodeGenModule.cpp @@ -83,15 +83,18 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { std::vector<llvm::Constant*> ArrayElts; const llvm::PointerType *APType = cast<llvm::PointerType>(GV->getType()); - const llvm::ArrayType *AType = cast<llvm::ArrayType>(APType->getElementType()); + const llvm::ArrayType *AType = + cast<llvm::ArrayType>(APType->getElementType()); // Copy initializer elements. unsigned i = 0; for (i = 0; i < NumInitElements; ++i) { assert (ILE->getInit(i)->getType()->isIntegerType() && "Only IntegerType global array initializers are supported"); - llvm::APSInt Value(static_cast<uint32_t>( - getContext().getTypeSize(ILE->getInit(i)->getType(), SourceLocation()))); + llvm::APSInt + Value(static_cast<uint32_t> + (getContext().getTypeSize(ILE->getInit(i)->getType(), + SourceLocation()))); if (ILE->getInit(i)->isIntegerConstantExpr(Value, Context)) { llvm::Constant *C = llvm::ConstantInt::get(Value); ArrayElts.push_back(C); @@ -100,8 +103,9 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { // Initialize remaining array elements. unsigned NumArrayElements = AType->getNumElements(); + const llvm::Type *AElemTy = AType->getElementType(); for (; i < NumArrayElements; ++i) - ArrayElts.push_back(llvm::Constant::getNullValue(AType->getElementType())); + ArrayElts.push_back(llvm::Constant::getNullValue(AElemTy)); Init = llvm::ConstantArray::get(AType, ArrayElts); } else |