summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2011-03-12 11:17:06 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2011-03-12 11:17:06 +0000
commitf2a79d94e47719b3a3a0e85ede7d65a52a8e9104 (patch)
tree82101a3d41e6d2767f4339cd5e0f2a0785f3e95a /clang/lib/Sema
parent5e152ce3feac1e5861bc1028c8f266cb9c8af696 (diff)
downloadbcm5719-llvm-f2a79d94e47719b3a3a0e85ede7d65a52a8e9104.tar.gz
bcm5719-llvm-f2a79d94e47719b3a3a0e85ede7d65a52a8e9104.zip
Forgotten part of previous commit.
llvm-svn: 127536
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp8
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp6
-rw-r--r--clang/lib/Sema/SemaExceptionSpec.cpp8
-rw-r--r--clang/lib/Sema/SemaExpr.cpp4
-rw-r--r--clang/lib/Sema/SemaType.cpp4
-rw-r--r--clang/lib/Sema/TreeTransform.h8
6 files changed, 21 insertions, 17 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 388552d1f99..825d1afa0be 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -149,14 +149,14 @@ DeclaratorChunk DeclaratorChunk::getFunction(const ParsedAttributes &attrs,
SourceRange *ExceptionRanges,
unsigned NumExceptions,
Expr *NoexceptExpr,
- SourceLocation LPLoc,
- SourceLocation RPLoc,
+ SourceLocation LocalRangeBegin,
+ SourceLocation LocalRangeEnd,
Declarator &TheDeclarator,
ParsedType TrailingReturnType) {
DeclaratorChunk I;
I.Kind = Function;
- I.Loc = LPLoc;
- I.EndLoc = RPLoc;
+ I.Loc = LocalRangeBegin;
+ I.EndLoc = LocalRangeEnd;
I.Fun.AttrList = attrs.getList();
I.Fun.hasPrototype = hasProto;
I.Fun.isVariadic = isVariadic;
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a72c75b337f..2bce585dd2b 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -7440,10 +7440,14 @@ bool Sema::CheckOverridingFunctionReturnType(const CXXMethodDecl *New,
///
/// \param InitRange the source range that covers the "0" initializer.
bool Sema::CheckPureMethod(CXXMethodDecl *Method, SourceRange InitRange) {
+ SourceLocation EndLoc = InitRange.getEnd();
+ if (EndLoc.isValid())
+ Method->setRangeEnd(EndLoc);
+
if (Method->isVirtual() || Method->getParent()->isDependentContext()) {
Method->setPure();
return false;
- }
+ }
if (!Method->isInvalidDecl())
Diag(Method->getLocation(), diag::err_non_virtual_pure)
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp
index 75ae8c215ab..dce4c6e2204 100644
--- a/clang/lib/Sema/SemaExceptionSpec.cpp
+++ b/clang/lib/Sema/SemaExceptionSpec.cpp
@@ -194,14 +194,14 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) {
OS << ")";
OS.flush();
- SourceLocation AfterParenLoc;
+ SourceLocation FixItLoc;
if (TypeSourceInfo *TSInfo = New->getTypeSourceInfo()) {
TypeLoc TL = TSInfo->getTypeLoc().IgnoreParens();
if (const FunctionTypeLoc *FTLoc = dyn_cast<FunctionTypeLoc>(&TL))
- AfterParenLoc = PP.getLocForEndOfToken(FTLoc->getRParenLoc());
+ FixItLoc = PP.getLocForEndOfToken(FTLoc->getLocalRangeEnd());
}
- if (AfterParenLoc.isInvalid())
+ if (FixItLoc.isInvalid())
Diag(New->getLocation(), diag::warn_missing_exception_specification)
<< New << OS.str();
else {
@@ -209,7 +209,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) {
// late-specified return types.
Diag(New->getLocation(), diag::warn_missing_exception_specification)
<< New << OS.str()
- << FixItHint::CreateInsertion(AfterParenLoc, " " + OS.str().str());
+ << FixItHint::CreateInsertion(FixItLoc, " " + OS.str().str());
}
if (!Old->getLocation().isInvalid())
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 546d2e7e388..d0528b1bc32 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -8866,8 +8866,8 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
// Check whether that explicit signature was synthesized by
// GetTypeForDeclarator. If so, don't save that as part of the
// written signature.
- if (ExplicitSignature.getLParenLoc() ==
- ExplicitSignature.getRParenLoc()) {
+ if (ExplicitSignature.getLocalRangeBegin() ==
+ ExplicitSignature.getLocalRangeEnd()) {
// This would be much cheaper if we stored TypeLocs instead of
// TypeSourceInfos.
TypeLoc Result = ExplicitSignature.getResultLoc();
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 2292735b50b..62bf8e63ae8 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -2466,8 +2466,8 @@ namespace {
}
void VisitFunctionTypeLoc(FunctionTypeLoc TL) {
assert(Chunk.Kind == DeclaratorChunk::Function);
- TL.setLParenLoc(Chunk.Loc);
- TL.setRParenLoc(Chunk.EndLoc);
+ TL.setLocalRangeBegin(Chunk.Loc);
+ TL.setLocalRangeEnd(Chunk.EndLoc);
TL.setTrailingReturn(!!Chunk.Fun.TrailingReturnType);
const DeclaratorChunk::FunctionTypeInfo &FTI = Chunk.Fun;
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index f6c83d8c6fb..bd28991e4bb 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -3880,8 +3880,8 @@ TreeTransform<Derived>::TransformFunctionProtoType(TypeLocBuilder &TLB,
}
FunctionProtoTypeLoc NewTL = TLB.push<FunctionProtoTypeLoc>(Result);
- NewTL.setLParenLoc(TL.getLParenLoc());
- NewTL.setRParenLoc(TL.getRParenLoc());
+ NewTL.setLocalRangeBegin(TL.getLocalRangeBegin());
+ NewTL.setLocalRangeEnd(TL.getLocalRangeEnd());
NewTL.setTrailingReturn(TL.getTrailingReturn());
for (unsigned i = 0, e = NewTL.getNumArgs(); i != e; ++i)
NewTL.setArg(i, ParamDecls[i]);
@@ -3904,8 +3904,8 @@ QualType TreeTransform<Derived>::TransformFunctionNoProtoType(
Result = getDerived().RebuildFunctionNoProtoType(ResultType);
FunctionNoProtoTypeLoc NewTL = TLB.push<FunctionNoProtoTypeLoc>(Result);
- NewTL.setLParenLoc(TL.getLParenLoc());
- NewTL.setRParenLoc(TL.getRParenLoc());
+ NewTL.setLocalRangeBegin(TL.getLocalRangeBegin());
+ NewTL.setLocalRangeEnd(TL.getLocalRangeEnd());
NewTL.setTrailingReturn(false);
return Result;
OpenPOWER on IntegriCloud