diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-09 00:08:36 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-09 00:08:36 +0000 |
| commit | 98ca9434cfa9807cc57527f0b602e89f6c2ef77a (patch) | |
| tree | e48ec7bc55105c3e362f9e11d1586c0e1976c555 /lib/CodeGen/CGBlocks.cpp | |
| parent | 9dd934d2b26065a48b10eae2c6fd9a60365f2f0f (diff) | |
| download | clang-98ca9434cfa9807cc57527f0b602e89f6c2ef77a.tar.gz clang-98ca9434cfa9807cc57527f0b602e89f6c2ef77a.tar.bz2 clang-98ca9434cfa9807cc57527f0b602e89f6c2ef77a.tar.xz | |
Use auto to avoid duplicating the type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
| -rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 165f7eac2a..941410a741 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -246,7 +246,7 @@ static bool isSafeForCXXConstantCapture(QualType type) { // Only records can be unsafe. if (!recordType) return true; - const CXXRecordDecl *record = cast<CXXRecordDecl>(recordType->getDecl()); + const auto *record = cast<CXXRecordDecl>(recordType->getDecl()); // Maintain semantics for classes with non-trivial dtors or copy ctors. if (!record->hasTrivialDestructor()) return false; @@ -1093,7 +1093,7 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, // to be local to this function as well, in case they're directly // referenced in a block. for (DeclMapTy::const_iterator i = ldm.begin(), e = ldm.end(); i != e; ++i) { - const VarDecl *var = dyn_cast<VarDecl>(i->first); + const auto *var = dyn_cast<VarDecl>(i->first); if (var && !var->hasLocalStorage()) LocalDeclMap[var] = i->second; } @@ -1396,7 +1396,7 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) { // storeStrong doesn't over-release) and then call storeStrong. // This is a workaround to not having an initStrong call. if (CGM.getCodeGenOpts().OptimizationLevel == 0) { - llvm::PointerType *ty = cast<llvm::PointerType>(srcValue->getType()); + auto *ty = cast<llvm::PointerType>(srcValue->getType()); llvm::Value *null = llvm::ConstantPointerNull::get(ty); Builder.CreateStore(null, dstField); EmitARCStoreStrongCall(dstField, srcValue, true); @@ -2231,7 +2231,7 @@ static void configureBlocksRuntimeObject(CodeGenModule &CGM, llvm::Constant *C) { if (!CGM.getLangOpts().BlocksRuntimeOptional) return; - llvm::GlobalValue *GV = cast<llvm::GlobalValue>(C->stripPointerCasts()); + auto *GV = cast<llvm::GlobalValue>(C->stripPointerCasts()); if (GV->isDeclaration() && GV->hasExternalLinkage()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); } |
