[cfe-commits] r123719 - in /cfe/trunk: include/clang/Basic/ lib/CodeGen/ lib/Parse/ lib/Rewrite/ lib/Sema/ lib/Serialization/ lib/StaticAnalyzer/ lib/StaticAnalyzer/Checkers/ tools/libclang/
Jeffrey Yasskin
jyasskin at google.com
Mon Jan 17 18:00:17 PST 2011
Author: jyasskin
Date: Mon Jan 17 20:00:16 2011
New Revision: 123719
URL: http://llvm.org/viewvc/llvm-project?rev=123719&view=rev
Log:
Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
-Wint-to-pointer-cast.
Modified:
cfe/trunk/include/clang/Basic/SourceLocation.h
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGExprComplex.cpp
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Parse/ParseTentative.cpp
cfe/trunk/lib/Rewrite/RewriteObjC.cpp
cfe/trunk/lib/Sema/SemaCXXCast.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaTemplate.cpp
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
cfe/trunk/lib/StaticAnalyzer/CXXExprEngine.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXCursor.cpp
Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Mon Jan 17 20:00:16 2011
@@ -130,6 +130,22 @@
return X;
}
+ /// getPtrEncoding - When a SourceLocation itself cannot be used, this returns
+ /// an (opaque) pointer encoding for it. This should only be passed
+ /// to SourceLocation::getFromPtrEncoding, it should not be inspected
+ /// directly.
+ void* getPtrEncoding() const {
+ // Double cast to avoid a warning "cast to pointer from integer of different
+ // size".
+ return (void*)(uintptr_t)getRawEncoding();
+ }
+
+ /// getFromPtrEncoding - Turn a pointer encoding of a SourceLocation object
+ /// into a real SourceLocation.
+ static SourceLocation getFromPtrEncoding(void *Encoding) {
+ return getFromRawEncoding((unsigned)(uintptr_t)Encoding);
+ }
+
void print(llvm::raw_ostream &OS, const SourceManager &SM) const;
void dump(const SourceManager &SM) const;
};
@@ -369,7 +385,7 @@
class PointerLikeTypeTraits<clang::SourceLocation> {
public:
static inline void *getAsVoidPointer(clang::SourceLocation L) {
- return (void*)L.getRawEncoding();
+ return L.getPtrEncoding();
}
static inline clang::SourceLocation getFromVoidPointer(void *P) {
return clang::SourceLocation::getFromRawEncoding((unsigned)(uintptr_t)P);
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Jan 17 20:00:16 2011
@@ -2081,7 +2081,6 @@
const FunctionType *FnType
= cast<FunctionType>(cast<PointerType>(CalleeType)->getPointeeType());
- QualType ResultType = FnType->getResultType();
CallArgList Args;
EmitCallArgs(Args, dyn_cast<FunctionProtoType>(FnType), ArgBeg, ArgEnd);
@@ -2108,4 +2107,3 @@
return MakeAddrLValue(AddV, MPT->getPointeeType());
}
-
Modified: cfe/trunk/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprComplex.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprComplex.cpp Mon Jan 17 20:00:16 2011
@@ -538,7 +538,7 @@
ComplexPairTy &Val) {
TestAndClearIgnoreReal();
TestAndClearIgnoreImag();
- QualType LHSTy = E->getLHS()->getType(), RHSTy = E->getRHS()->getType();
+ QualType LHSTy = E->getLHS()->getType();
BinOpInfo OpInfo;
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Mon Jan 17 20:00:16 2011
@@ -434,7 +434,6 @@
for (unsigned I = 0, E = IvarInitializers.size(); I != E; ++I) {
CXXCtorInitializer *IvarInit = IvarInitializers[I];
FieldDecl *Field = IvarInit->getAnyMember();
- QualType FieldType = Field->getType();
ObjCIvarDecl *Ivar = cast<ObjCIvarDecl>(Field);
LValue LV = EmitLValueForIvar(TypeOfSelfObject(),
LoadObjCSelf(), Ivar, 0);
@@ -860,5 +859,3 @@
}
CGObjCRuntime::~CGObjCRuntime() {}
-
-
Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Mon Jan 17 20:00:16 2011
@@ -349,11 +349,11 @@
bool DerivedToBase =
E->getCastKind() == CK_DerivedToBaseMemberPointer;
- const CXXRecordDecl *BaseDecl, *DerivedDecl;
+ const CXXRecordDecl *DerivedDecl;
if (DerivedToBase)
- DerivedDecl = SrcDecl, BaseDecl = DestDecl;
+ DerivedDecl = SrcDecl;
else
- BaseDecl = SrcDecl, DerivedDecl = DestDecl;
+ DerivedDecl = DestDecl;
llvm::Constant *Adj =
CGF.CGM.GetNonVirtualBaseClassOffset(DerivedDecl,
@@ -1000,7 +1000,6 @@
// The cookie size is always 2 * sizeof(size_t).
CookieSize = 2 * SizeSize;
- CharUnits NumElementsOffset = CookieSize - SizeSize;
// The allocated pointer is the input ptr, minus that amount.
AllocPtr = CGF.Builder.CreateBitCast(Ptr, CharPtrTy);
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Mon Jan 17 20:00:16 2011
@@ -1724,7 +1724,6 @@
}
// Parse the common specifier-qualifiers-list piece.
- SourceLocation DSStart = Tok.getLocation();
ParseSpecifierQualifierList(DS);
// If there are no declarators, this is a free-standing declaration
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Mon Jan 17 20:00:16 2011
@@ -1443,7 +1443,6 @@
return;
}
- SourceLocation DSStart = Tok.getLocation();
// decl-specifier-seq:
// Parse the common declaration-specifiers piece.
ParsingDeclSpec DS(*this, TemplateDiags);
@@ -1931,7 +1930,7 @@
bool &hasAnyExceptionSpec) {
assert(Tok.is(tok::kw_throw) && "expected throw");
- SourceLocation ThrowLoc = ConsumeToken();
+ ConsumeToken();
if (!Tok.is(tok::l_paren)) {
return Diag(Tok, diag::err_expected_lparen_after) << "throw";
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Mon Jan 17 20:00:16 2011
@@ -566,7 +566,6 @@
ParenParseOption ParenExprType =
(isUnaryExpression && !getLang().CPlusPlus)? CompoundLiteral : CastExpr;
ParsedType CastTy;
- SourceLocation LParenLoc = Tok.getLocation();
SourceLocation RParenLoc;
{
@@ -641,7 +640,7 @@
(Actions.getTypeName(II, ILoc, getCurScope()) ||
// Allow the base to be 'super' if in an objc-method.
(&II == Ident_super && getCurScope()->isInObjcMethodScope()))) {
- SourceLocation DotLoc = ConsumeToken();
+ ConsumeToken();
if (Tok.isNot(tok::identifier)) {
Diag(Tok, diag::err_expected_property_name);
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Mon Jan 17 20:00:16 2011
@@ -824,7 +824,7 @@
// '=' assignment-expression
if (isTokenEqualOrMistypedEqualEqual(
diag::err_invalid_equalequal_after_declarator)) {
- SourceLocation EqualLoc = ConsumeToken();
+ ConsumeToken();
ExprResult AssignExpr(ParseAssignmentExpression());
if (!AssignExpr.isInvalid())
Actions.AddInitializerToDecl(DeclOut, AssignExpr.take());
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Mon Jan 17 20:00:16 2011
@@ -150,7 +150,9 @@
SourceLocation nameLoc = ConsumeToken();
if (Tok.is(tok::l_paren) &&
!isKnownToBeTypeSpecifier(GetLookAheadToken(1))) { // we have a category.
- SourceLocation lparenLoc = ConsumeParen();
+ // TODO(dgregor): Use the return value from the next line to provide better
+ // recovery.
+ ConsumeParen();
SourceLocation categoryLoc, rparenLoc;
IdentifierInfo *categoryId = 0;
if (Tok.is(tok::code_completion)) {
@@ -1298,7 +1300,7 @@
if (Tok.is(tok::l_paren)) {
// we have a category implementation.
- SourceLocation lparenLoc = ConsumeParen();
+ ConsumeParen();
SourceLocation categoryLoc, rparenLoc;
IdentifierInfo *categoryId = 0;
@@ -1418,7 +1420,7 @@
Decl *Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) {
assert(Tok.isObjCAtKeyword(tok::objc_synthesize) &&
"ParseObjCPropertyDynamic(): Expected '@synthesize'");
- SourceLocation loc = ConsumeToken(); // consume synthesize
+ ConsumeToken(); // consume synthesize
while (true) {
if (Tok.is(tok::code_completion)) {
@@ -1473,7 +1475,7 @@
Decl *Parser::ParseObjCPropertyDynamic(SourceLocation atLoc) {
assert(Tok.isObjCAtKeyword(tok::objc_dynamic) &&
"ParseObjCPropertyDynamic(): Expected '@dynamic'");
- SourceLocation loc = ConsumeToken(); // consume dynamic
+ ConsumeToken(); // consume dynamic
while (true) {
if (Tok.is(tok::code_completion)) {
Actions.CodeCompleteObjCPropertyDefinition(getCurScope(), ObjCImpDecl);
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Mon Jan 17 20:00:16 2011
@@ -545,12 +545,9 @@
Decl *&DeclResult,
SourceLocation Loc,
bool ConvertToBoolean) {
- bool ParseError = false;
-
SourceLocation LParenLoc = ConsumeParen();
if (getLang().CPlusPlus)
- ParseError = ParseCXXCondition(ExprResult, DeclResult, Loc,
- ConvertToBoolean);
+ ParseCXXCondition(ExprResult, DeclResult, Loc, ConvertToBoolean);
else {
ExprResult = ParseExpression();
DeclResult = 0;
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Mon Jan 17 20:00:16 2011
@@ -531,7 +531,7 @@
<< PP.getSpelling(Tok);
return 0;
}
- SourceLocation ClassLoc = ConsumeToken();
+ ConsumeToken();
// Parse the ellipsis, if given.
SourceLocation EllipsisLoc;
@@ -595,8 +595,6 @@
/// parameter-declaration
Decl *
Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) {
- SourceLocation StartLoc = Tok.getLocation();
-
// Parse the declaration-specifiers (i.e., the type).
// FIXME: The type should probably be restricted in some way... Not all
// declarators (parts of declarators?) are accepted for parameters.
Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Mon Jan 17 20:00:16 2011
@@ -111,10 +111,7 @@
// We need tentative parsing...
TentativeParsingAction PA(*this);
-
TPR = TryParseSimpleDeclaration();
- SourceLocation TentativeParseLoc = Tok.getLocation();
-
PA.Revert();
// In case of an error, let the declaration parsing code handle it.
Modified: cfe/trunk/lib/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteObjC.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteObjC.cpp Mon Jan 17 20:00:16 2011
@@ -1952,7 +1952,6 @@
buf += "}";
ReplaceText(lastCurlyLoc, 1, buf);
}
- bool sawIdTypedCatch = false;
Stmt *lastCatchBody = 0;
for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I) {
ObjCAtCatchStmt *Catch = S->getCatchStmt(I);
@@ -1985,7 +1984,6 @@
if (t == Context->getObjCIdType()) {
buf += "1) { ";
ReplaceText(startLoc, lParenLoc-startBuf+1, buf);
- sawIdTypedCatch = true;
} else if (const ObjCObjectPointerType *Ptr =
t->getAs<ObjCObjectPointerType>()) {
// Should be a pointer to a class.
Modified: cfe/trunk/lib/Sema/SemaCXXCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXCast.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXCast.cpp Mon Jan 17 20:00:16 2011
@@ -601,8 +601,6 @@
// In the CStyle case, the earlier attempt to const_cast should have taken
// care of reverse qualification conversions.
- QualType OrigSrcType = SrcExpr->getType();
-
QualType SrcType = Self.Context.getCanonicalType(SrcExpr->getType());
// C++0x 5.2.9p9: A value of a scoped enumeration type can be explicitly
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Jan 17 20:00:16 2011
@@ -4995,10 +4995,7 @@
// Form the assignment:
// static_cast<Base*>(this)->Base::operator=(static_cast<Base&>(other));
QualType BaseType = Base->getType().getUnqualifiedType();
- CXXRecordDecl *BaseClassDecl = 0;
- if (const RecordType *BaseRecordT = BaseType->getAs<RecordType>())
- BaseClassDecl = cast<CXXRecordDecl>(BaseRecordT->getDecl());
- else {
+ if (!BaseType->isRecordType()) {
Invalid = true;
continue;
}
@@ -6220,8 +6217,6 @@
Invalid = true;
}
- QualType ExDeclType = TInfo->getType();
-
IdentifierInfo *II = D.getIdentifier();
if (NamedDecl *PrevDecl = LookupSingleName(S, II, D.getIdentifierLoc(),
LookupOrdinaryName,
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jan 17 20:00:16 2011
@@ -8531,7 +8531,7 @@
Expr *expr, ParsedType type,
SourceLocation RPLoc) {
TypeSourceInfo *TInfo;
- QualType T = GetTypeFromParser(type, &TInfo);
+ GetTypeFromParser(type, &TInfo);
return BuildVAArgExpr(BuiltinLoc, expr, TInfo, RPLoc);
}
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Mon Jan 17 20:00:16 2011
@@ -718,7 +718,6 @@
if (!TInfo)
TInfo = Context.getTrivialTypeSourceInfo(AllocType);
- SourceRange R = TInfo->getTypeLoc().getSourceRange();
return BuildCXXNew(StartLoc, UseGlobal,
PlacementLParen,
move(PlacementArgs),
Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Mon Jan 17 20:00:16 2011
@@ -6128,4 +6128,3 @@
Out << ']';
return Out.str();
}
-
Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Mon Jan 17 20:00:16 2011
@@ -2019,11 +2019,9 @@
// note that the template argument pack is partially substituted and record
// the explicit template arguments. They'll be used as part of deduction
// for this template parameter pack.
- bool HasPartiallySubstitutedPack = false;
for (unsigned I = 0, N = Builder.size(); I != N; ++I) {
const TemplateArgument &Arg = Builder[I];
if (Arg.getKind() == TemplateArgument::Pack) {
- HasPartiallySubstitutedPack = true;
CurrentInstantiationScope->SetPartiallySubstitutedPack(
TemplateParams->getParam(I),
Arg.pack_begin(),
@@ -2438,7 +2436,6 @@
else {
// - If A is a cv-qualified type, the top level cv-qualifiers of Aâs
// type are ignored for type deduction.
- QualType CanonArgType = S.Context.getCanonicalType(ArgType);
if (ArgType.getCVRQualifiers())
ArgType = ArgType.getUnqualifiedType();
}
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Mon Jan 17 20:00:16 2011
@@ -7126,7 +7126,6 @@
ParmVarDecl *OldParm = (*P);
ParmVarDecl *NewParm = getDerived().TransformFunctionTypeParam(OldParm,
llvm::Optional<unsigned>());
- QualType NewType = NewParm->getType();
Params.push_back(NewParm);
ParamTypes.push_back(NewParm->getType());
}
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Mon Jan 17 20:00:16 2011
@@ -661,7 +661,6 @@
if (Map) {
for (StoredDeclsMap::iterator D = Map->begin(), DEnd = Map->end();
D != DEnd; ++D) {
- DeclarationName Name = D->first;
DeclContext::lookup_result Result = D->second.getLookupResult();
while (Result.first != Result.second) {
Writer.GetDeclRef(*Result.first);
Modified: cfe/trunk/lib/StaticAnalyzer/CXXExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/CXXExprEngine.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/CXXExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/CXXExprEngine.cpp Mon Jan 17 20:00:16 2011
@@ -50,14 +50,8 @@
// Evaluate the argument.
ExplodedNodeSet Tmp;
- bool VisitAsLvalue = FstArgAsLValue;
if (FstArgAsLValue) {
FstArgAsLValue = false;
- } else {
- const unsigned ParamIdx = Item.I - AI;
- VisitAsLvalue = FnType && ParamIdx < FnType->getNumArgs()
- ? FnType->getArgType(ParamIdx)->isReferenceType()
- : false;
}
Visit(*Item.I, Item.N, Tmp);
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp Mon Jan 17 20:00:16 2011
@@ -3168,8 +3168,6 @@
if (Op == BO_Assign) {
// EXPERIMENTAL: "Conjured" symbols.
// FIXME: Handle structs.
- QualType T = RHS->getType();
-
if (RightV.isUnknown() ||!getConstraintManager().canReasonAbout(RightV))
{
unsigned Count = Builder->getCurrentBlockCount();
@@ -3238,7 +3236,6 @@
CLHSTy = getContext().getCanonicalType(CLHSTy);
QualType LTy = getContext().getCanonicalType(LHS->getType());
- QualType RTy = getContext().getCanonicalType(RHS->getType());
// Promote LHS.
V = svalBuilder.evalCast(V, CLHSTy, LTy);
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Mon Jan 17 20:00:16 2011
@@ -1530,22 +1530,22 @@
public:
LabelRefVisit(LabelStmt *LS, SourceLocation labelLoc, CXCursor parent)
: VisitorJob(parent, VisitorJob::LabelRefVisitKind, LS,
- (void*) labelLoc.getRawEncoding()) {}
+ labelLoc.getPtrEncoding()) {}
static bool classof(const VisitorJob *VJ) {
return VJ->getKind() == VisitorJob::LabelRefVisitKind;
}
LabelStmt *get() const { return static_cast<LabelStmt*>(data[0]); }
SourceLocation getLoc() const {
- return SourceLocation::getFromRawEncoding((unsigned)(uintptr_t) data[1]); }
+ return SourceLocation::getFromPtrEncoding(data[1]); }
};
class NestedNameSpecifierVisit : public VisitorJob {
public:
NestedNameSpecifierVisit(NestedNameSpecifier *NS, SourceRange R,
CXCursor parent)
: VisitorJob(parent, VisitorJob::NestedNameSpecifierVisitKind,
- NS, (void*) R.getBegin().getRawEncoding(),
- (void*) R.getEnd().getRawEncoding()) {}
+ NS, R.getBegin().getPtrEncoding(),
+ R.getEnd().getPtrEncoding()) {}
static bool classof(const VisitorJob *VJ) {
return VJ->getKind() == VisitorJob::NestedNameSpecifierVisitKind;
}
@@ -1583,7 +1583,7 @@
public:
MemberRefVisit(FieldDecl *D, SourceLocation L, CXCursor parent)
: VisitorJob(parent, VisitorJob::MemberRefVisitKind, D,
- (void*) L.getRawEncoding()) {}
+ L.getPtrEncoding()) {}
static bool classof(const VisitorJob *VJ) {
return VJ->getKind() == VisitorJob::MemberRefVisitKind;
}
Modified: cfe/trunk/tools/libclang/CXCursor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=123719&r1=123718&r2=123719&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.cpp (original)
+++ cfe/trunk/tools/libclang/CXCursor.cpp Mon Jan 17 20:00:16 2011
@@ -57,7 +57,7 @@
bool FirstInDeclGroup) {
assert(D && TU && "Invalid arguments!");
CXCursor C = { getCursorKindForDecl(D),
- { D, (void*) (FirstInDeclGroup ? 1 : 0), TU }
+ { D, (void*)(intptr_t) (FirstInDeclGroup ? 1 : 0), TU }
};
return C;
}
@@ -560,4 +560,3 @@
return flag;
}
} // end: extern "C"
-
More information about the cfe-commits
mailing list