From 1636de94069d492185da2dd36859d4a1962a2eed Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 7 Sep 2007 04:06:50 +0000 Subject: Add lengthof and endof templates that hide a lot of sizeof computations. Patch by Sterling Stein! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41758 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Mangler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/VMCore/Mangler.cpp') diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp index 353732f..52e3d0d 100644 --- a/lib/VMCore/Mangler.cpp +++ b/lib/VMCore/Mangler.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/Mangler.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" using namespace llvm; @@ -185,9 +186,7 @@ void Mangler::InsertName(GlobalValue *GV, Mangler::Mangler(Module &M, const char *prefix) : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false), Count(0), TypeCounter(0) { - std::fill(AcceptableChars, - AcceptableChars+sizeof(AcceptableChars)/sizeof(AcceptableChars[0]), - 0); + std::fill(AcceptableChars, array_endof(AcceptableChars), 0); // Letters and numbers are acceptable. for (unsigned char X = 'a'; X <= 'z'; ++X) -- cgit v1.1