summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-03-09 18:35:03 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-03-09 18:35:03 +0000
commit96a0014f9b963d8a987f1cccd48808a47f9c6331 (patch)
tree648ade07f20cf96e38d8b66e21859f2794a8f579 /lib/Sema/SemaType.cpp
parent3d4144f32ea4c24aaf48cbff4f476c1446ba2641 (diff)
[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size(). I already killed the hot paths so this doesn't seem to impact performance on my tests-of-the-day, but it is a much more sensible (and shorter) pattern. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index d7c54f7d0b..505cc8f769 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -548,7 +548,7 @@ static void maybeSynthesizeBlockSignature(TypeProcessingState &state,
// faking up the function chunk is still the right thing to do.
// Otherwise, we need to fake up a function declarator.
- SourceLocation loc = declarator.getSourceRange().getBegin();
+ SourceLocation loc = declarator.getLocStart();
// ...and *prepend* it to the declarator.
declarator.AddInnermostTypeInfo(DeclaratorChunk::getFunction(
@@ -584,7 +584,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) {
const DeclSpec &DS = declarator.getDeclSpec();
SourceLocation DeclLoc = declarator.getIdentifierLoc();
if (DeclLoc.isInvalid())
- DeclLoc = DS.getSourceRange().getBegin();
+ DeclLoc = DS.getLocStart();
ASTContext &Context = S.Context;
@@ -662,7 +662,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) {
if (DS.isEmpty()) {
S.Diag(DeclLoc, diag::ext_missing_declspec)
<< DS.getSourceRange()
- << FixItHint::CreateInsertion(DS.getSourceRange().getBegin(), "int");
+ << FixItHint::CreateInsertion(DS.getLocStart(), "int");
}
} else if (!DS.hasTypeSpecifier()) {
// C99 and C++ require a type specifier. For example, C99 6.7.2p2 says:
@@ -2492,7 +2492,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_static) &&
!IsTypedefName &&
D.getContext() != Declarator::TemplateTypeArgContext) {
- SourceLocation Loc = D.getSourceRange().getBegin();
+ SourceLocation Loc = D.getLocStart();
SourceRange RemovalRange;
unsigned I;
if (D.isFunctionDeclarator(I)) {
@@ -4282,7 +4282,7 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T,
<< RD->isStruct() << RD->getNumVBases();
for (CXXRecordDecl::base_class_const_iterator I = RD->vbases_begin(),
E = RD->vbases_end(); I != E; ++I)
- Diag(I->getSourceRange().getBegin(),
+ Diag(I->getLocStart(),
diag::note_constexpr_virtual_base_here) << I->getSourceRange();
} else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() &&
!RD->hasTrivialDefaultConstructor()) {
@@ -4291,7 +4291,7 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T,
for (CXXRecordDecl::base_class_const_iterator I = RD->bases_begin(),
E = RD->bases_end(); I != E; ++I) {
if (!I->getType()->isLiteralType()) {
- Diag(I->getSourceRange().getBegin(),
+ Diag(I->getLocStart(),
diag::note_non_literal_base_class)
<< RD << I->getType() << I->getSourceRange();
return true;