Small amount of code clean-up: Don't use ".size()" when not necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2009-09-09 21:06:24 +00:00
parent 65c060064d
commit b4049fe8cb

View File

@@ -576,7 +576,7 @@ void DwarfException::EmitExceptionTable() {
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize; unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
unsigned TypeOffset = sizeof(int8_t) + // Call site format unsigned TypeOffset = sizeof(int8_t) + // Call site format
MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
SizeSites + SizeActions + SizeTypes; SizeSites + SizeActions + SizeTypes;
@@ -851,16 +851,18 @@ void DwarfException::EmitExceptionTable() {
void DwarfException::EndModule() { void DwarfException::EndModule() {
if (MAI->getExceptionHandlingType() != ExceptionHandling::Dwarf) if (MAI->getExceptionHandlingType() != ExceptionHandling::Dwarf)
return; return;
if (TimePassesIsEnabled) if (TimePassesIsEnabled)
ExceptionTimer->startTimer(); ExceptionTimer->startTimer();
if (shouldEmitMovesModule || shouldEmitTableModule) { if (shouldEmitMovesModule || shouldEmitTableModule) {
const std::vector<Function *> Personalities = MMI->getPersonalities(); const std::vector<Function *> Personalities = MMI->getPersonalities();
for (unsigned i = 0; i < Personalities.size(); ++i)
for (unsigned i = 0, e = Personalities.size(); i < e; ++i)
EmitCIE(Personalities[i], i); EmitCIE(Personalities[i], i);
for (std::vector<FunctionEHFrameInfo>::iterator I = EHFrames.begin(), for (std::vector<FunctionEHFrameInfo>::iterator
E = EHFrames.end(); I != E; ++I) I = EHFrames.begin(), E = EHFrames.end(); I != E; ++I)
EmitFDE(*I); EmitFDE(*I);
} }
@@ -882,7 +884,7 @@ void DwarfException::BeginFunction(MachineFunction *MF) {
MMI->TidyLandingPads(); MMI->TidyLandingPads();
// If any landing pads survive, we need an EH table. // If any landing pads survive, we need an EH table.
if (MMI->getLandingPads().size()) if (!MMI->getLandingPads().empty())
shouldEmitTable = true; shouldEmitTable = true;
// See if we need frame move info. // See if we need frame move info.