Silence some warnings produced by Clang, and add a missing header

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Gregor 2009-11-17 06:14:37 +00:00
Родитель 48c32a7e7c
Коммит 6490ae5003
6 изменённых файлов: 12 добавлений и 11 удалений

Просмотреть файл

@ -15,6 +15,7 @@
#ifndef LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H #ifndef LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H
#define LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H #define LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H
#include "clang/AST/Stmt.h"
#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMap.h"

Просмотреть файл

@ -44,11 +44,6 @@ static ExplodedNode::Auditor* CreateUbiViz();
// Basic type definitions. // Basic type definitions.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
namespace {
class AnalysisConsumer;
typedef void (*CodeAction)(AnalysisConsumer &C, AnalysisManager &M, Decl *D);
} // end anonymous namespace
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Special PathDiagnosticClients. // Special PathDiagnosticClients.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -68,6 +63,10 @@ CreatePlistHTMLDiagnosticClient(const std::string& prefix,
namespace { namespace {
class VISIBILITY_HIDDEN AnalysisConsumer : public ASTConsumer { class VISIBILITY_HIDDEN AnalysisConsumer : public ASTConsumer {
public:
typedef void (*CodeAction)(AnalysisConsumer &C, AnalysisManager &M, Decl *D);
private:
typedef std::vector<CodeAction> Actions; typedef std::vector<CodeAction> Actions;
Actions FunctionActions; Actions FunctionActions;
Actions ObjCMethodActions; Actions ObjCMethodActions;
@ -189,8 +188,9 @@ public:
} // end anonymous namespace } // end anonymous namespace
namespace llvm { namespace llvm {
template <> struct FoldingSetTrait<CodeAction> { template <> struct FoldingSetTrait<AnalysisConsumer::CodeAction> {
static inline void Profile(CodeAction X, FoldingSetNodeID& ID) { static inline void Profile(AnalysisConsumer::CodeAction X,
FoldingSetNodeID& ID) {
ID.AddPointer(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(X))); ID.AddPointer(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(X)));
} }
}; };

Просмотреть файл

@ -484,7 +484,7 @@ ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,
assert(ContainsLocation(DInfo) && assert(ContainsLocation(DInfo) &&
"Should visit only after verifying that loc is in range"); "Should visit only after verifying that loc is in range");
TypeLocResolver(Ctx, Loc, D); (void)TypeLocResolver(Ctx, Loc, D);
for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc()) for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
if (ContainsLocation(TL)) if (ContainsLocation(TL))
return TypeLocResolver(Ctx, Loc, D).Visit(TL); return TypeLocResolver(Ctx, Loc, D).Visit(TL);

Просмотреть файл

@ -325,5 +325,5 @@ void JumpScopeChecker::CheckJump(Stmt *From, Stmt *To,
} }
void Sema::DiagnoseInvalidJumps(Stmt *Body) { void Sema::DiagnoseInvalidJumps(Stmt *Body) {
JumpScopeChecker(Body, *this); (void)JumpScopeChecker(Body, *this);
} }

Просмотреть файл

@ -72,7 +72,7 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer,
Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>()); Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>());
}; };
// Check for any pending objective-c implementation decl. // Check for any pending objective-c implementation decl.
while (ADecl = P.RetreivePendingObjCImpDecl()) while ((ADecl = P.RetreivePendingObjCImpDecl()))
Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>()); Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>());
// process any TopLevelDecls generated by #pragma weak // process any TopLevelDecls generated by #pragma weak

Просмотреть файл

@ -1936,7 +1936,7 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
} }
if (RD->isAbstract()) if (RD->isAbstract())
AbstractClassUsageDiagnoser(*this, RD); (void)AbstractClassUsageDiagnoser(*this, RD);
if (!RD->isDependentType() && !RD->isInvalidDecl()) if (!RD->isDependentType() && !RD->isInvalidDecl())
AddImplicitlyDeclaredMembersToClass(RD); AddImplicitlyDeclaredMembersToClass(RD);