[llvm-commits] [llvm-gcc-4.2] r72211 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp
Jay Foad
jay.foad at gmail.com
Thu May 21 02:55:35 PDT 2009
Author: foad
Date: Thu May 21 04:55:34 2009
New Revision: 72211
URL: http://llvm.org/viewvc/llvm-project?rev=72211&view=rev
Log:
Use v.data() instead of &v[0] when SmallVector v might be empty.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=72211&r1=72210&r2=72211&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu May 21 04:55:34 2009
@@ -677,7 +677,7 @@
assert(RetVals.size() == 1 && "Non-aggregate return has multiple values!");
Builder.CreateRet(RetVals[0]);
} else
- Builder.CreateAggregateRet(&RetVals[0], RetVals.size());
+ Builder.CreateAggregateRet(RetVals.data(), RetVals.size());
// Emit pending exception handling code.
EmitLandingPads();
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=72211&r1=72210&r2=72211&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Thu May 21 04:55:34 2009
@@ -425,7 +425,7 @@
}
llvm::DIArray EltTypeArray =
- DebugFactory.GetOrCreateArray(&EltTys[0], EltTys.size());
+ DebugFactory.GetOrCreateArray(EltTys.data(), EltTys.size());
return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type,
findRegion(type), "",
@@ -497,7 +497,7 @@
}
llvm::DIArray SubscriptArray =
- DebugFactory.GetOrCreateArray(&Subscripts[0], Subscripts.size());
+ DebugFactory.GetOrCreateArray(Subscripts.data(), Subscripts.size());
expanded_location Loc = GetNodeLocation(type);
return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_array_type,
findRegion(type), "",
@@ -523,7 +523,7 @@
}
llvm::DIArray EltArray =
- DebugFactory.GetOrCreateArray(&Elements[0], Elements.size());
+ DebugFactory.GetOrCreateArray(Elements.data(), Elements.size());
expanded_location Loc = { NULL, 0 };
if (TYPE_SIZE(type))
@@ -680,7 +680,7 @@
}
llvm::DIArray Elements =
- DebugFactory.GetOrCreateArray(&EltTys[0], EltTys.size());
+ DebugFactory.GetOrCreateArray(EltTys.data(), EltTys.size());
llvm::DIType RealDecl =
DebugFactory.CreateCompositeType(Tag, findRegion(type),
More information about the llvm-commits
mailing list