More ArrayRef-ification of methods.

llvm-svn: 151152
This commit is contained in:
Bill Wendling 2012-02-22 09:51:33 +00:00
parent 8ac06afa9b
commit 8eb771d4ca
7 changed files with 10 additions and 11 deletions

View File

@ -44,7 +44,7 @@ namespace clang {
unsigned NumPrevArgs,
SmallVectorImpl<char> &Output,
void *Cookie,
SmallVectorImpl<intptr_t> &QualTypeVals);
ArrayRef<intptr_t> QualTypeVals);
} // end namespace clang
#endif

View File

@ -961,7 +961,7 @@ protected:
///
/// \returns the first/last pair of declarations.
static std::pair<Decl *, Decl *>
BuildDeclChain(const SmallVectorImpl<Decl*> &Decls, bool FieldsAlreadyLoaded);
BuildDeclChain(ArrayRef<Decl*> Decls, bool FieldsAlreadyLoaded);
DeclContext(Decl::Kind K)
: DeclKind(K), ExternalLexicalStorage(false),

View File

@ -289,7 +289,7 @@ private:
unsigned NumPrevArgs,
SmallVectorImpl<char> &Output,
void *Cookie,
SmallVectorImpl<intptr_t> &QualTypeVals);
ArrayRef<intptr_t> QualTypeVals);
void *ArgToStringCookie;
ArgToStringFnTy ArgToStringFn;

View File

@ -154,17 +154,16 @@ static std::string
ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty,
const DiagnosticsEngine::ArgumentValue *PrevArgs,
unsigned NumPrevArgs,
SmallVectorImpl<intptr_t> &QualTypeVals) {
ArrayRef<intptr_t> QualTypeVals) {
// FIXME: Playing with std::string is really slow.
bool ForceAKA = false;
QualType CanTy = Ty.getCanonicalType();
std::string S = Ty.getAsString(Context.getPrintingPolicy());
std::string CanS = CanTy.getAsString(Context.getPrintingPolicy());
for (SmallVectorImpl<intptr_t>::iterator I = QualTypeVals.begin(),
E = QualTypeVals.end(); I != E; ++I) {
for (unsigned I = 0, E = QualTypeVals.size(); I != E; ++I) {
QualType CompareTy =
QualType::getFromOpaquePtr(reinterpret_cast<void*>(*I));
QualType::getFromOpaquePtr(reinterpret_cast<void*>(QualTypeVals[I]));
if (CompareTy == Ty)
continue; // Same types
QualType CompareCanTy = CompareTy.getCanonicalType();
@ -235,7 +234,7 @@ void clang::FormatASTNodeDiagnosticArgument(
unsigned NumPrevArgs,
SmallVectorImpl<char> &Output,
void *Cookie,
SmallVectorImpl<intptr_t> &QualTypeVals) {
ArrayRef<intptr_t> QualTypeVals) {
ASTContext &Context = *static_cast<ASTContext*>(Cookie);
std::string S;

View File

@ -872,7 +872,7 @@ DeclContext::collectAllContexts(llvm::SmallVectorImpl<DeclContext *> &Contexts){
}
std::pair<Decl *, Decl *>
DeclContext::BuildDeclChain(const SmallVectorImpl<Decl*> &Decls,
DeclContext::BuildDeclChain(ArrayRef<Decl*> Decls,
bool FieldsAlreadyLoaded) {
// Build up a chain of declarations via the Decl::NextInContextAndBits field.
Decl *FirstNewDecl = 0;

View File

@ -27,7 +27,7 @@ static void DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
unsigned NumPrevArgs,
SmallVectorImpl<char> &Output,
void *Cookie,
SmallVectorImpl<intptr_t> &QualTypeVals) {
ArrayRef<intptr_t> QualTypeVals) {
const char *Str = "<can't format argument>";
Output.append(Str, Str+strlen(Str));
}

View File

@ -583,7 +583,7 @@ FinishArgumentPackDeduction(Sema &S,
TemplateParameterList *TemplateParams,
bool HasAnyArguments,
SmallVectorImpl<DeducedTemplateArgument> &Deduced,
const SmallVectorImpl<unsigned> &PackIndices,
ArrayRef<unsigned> PackIndices,
SmallVectorImpl<DeducedTemplateArgument> &SavedPacks,
SmallVectorImpl<
SmallVector<DeducedTemplateArgument, 4> > &NewlyDeducedPacks,