diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 5028d5d..2d8389f 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1569,12 +1569,10 @@ void CodeGenFunction::EmitVarAnnotations(const VarDecl *D, llvm::Value *V) { assert(D->hasAttr<AnnotateAttr>() && "no annotate attribute"); // FIXME We create a new bitcast for every annotation because that's what // llvm-gcc was doing. - for (specific_attr_iterator<AnnotateAttr> - ai = D->specific_attr_begin<AnnotateAttr>(), - ae = D->specific_attr_end<AnnotateAttr>(); ai != ae; ++ai) + for (const auto *I : D->specific_attrs<AnnotateAttr>()) EmitAnnotationCall(CGM.getIntrinsic(llvm::Intrinsic::var_annotation), Builder.CreateBitCast(V, CGM.Int8PtrTy, V->getName()), - (*ai)->getAnnotation(), D->getLocation()); + I->getAnnotation(), D->getLocation()); } llvm::Value *CodeGenFunction::EmitFieldAnnotations(const FieldDecl *D, @@ -1584,15 +1582,13 @@ llvm::Value *CodeGenFunction::EmitFieldAnnotations(const FieldDecl *D, llvm::Value *F = CGM.getIntrinsic(llvm::Intrinsic::ptr_annotation, CGM.Int8PtrTy); - for (specific_attr_iterator<AnnotateAttr> - ai = D->specific_attr_begin<AnnotateAttr>(), - ae = D->specific_attr_end<AnnotateAttr>(); ai != ae; ++ai) { + for (const auto *I : D->specific_attrs<AnnotateAttr>()) { // FIXME Always emit the cast inst so we can differentiate between // annotation on the first field of a struct and annotation on the struct // itself. if (VTy != CGM.Int8PtrTy) V = Builder.Insert(new llvm::BitCastInst(V, CGM.Int8PtrTy)); - V = EmitAnnotationCall(F, V, (*ai)->getAnnotation(), D->getLocation()); + V = EmitAnnotationCall(F, V, I->getAnnotation(), D->getLocation()); V = Builder.CreateBitCast(V, VTy); } |