]> granicus.if.org Git - clang/commitdiff
Silence some warnings produced by Clang, and add a missing header
authorDouglas Gregor <dgregor@apple.com>
Tue, 17 Nov 2009 06:14:37 +0000 (06:14 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 17 Nov 2009 06:14:37 +0000 (06:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/AnalysisContext.h
lib/Frontend/AnalysisConsumer.cpp
lib/Index/ResolveLocation.cpp
lib/Sema/JumpDiagnostics.cpp
lib/Sema/ParseAST.cpp
lib/Sema/SemaDeclCXX.cpp

index 66e850a91444d7d64383541c26187061d0c79c03..9b58f745f0a57afa6b251c3df73ba4c605785c71 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H
 #define LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H
 
+#include "clang/AST/Stmt.h"
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/DenseMap.h"
index b0799af3bf519e84ea0c933e4bfd11dbd17e2c2d..ede3d474c848510d8d36c0eb630e1c96c9a2017f 100644 (file)
@@ -44,11 +44,6 @@ static ExplodedNode::Auditor* CreateUbiViz();
 // Basic type definitions.
 //===----------------------------------------------------------------------===//
 
-namespace {
-  class AnalysisConsumer;
-  typedef void (*CodeAction)(AnalysisConsumer &C, AnalysisManager &M, Decl *D);
-} // end anonymous namespace
-
 //===----------------------------------------------------------------------===//
 // Special PathDiagnosticClients.
 //===----------------------------------------------------------------------===//
@@ -68,6 +63,10 @@ CreatePlistHTMLDiagnosticClient(const std::string& prefix,
 namespace {
 
  class VISIBILITY_HIDDEN AnalysisConsumer : public ASTConsumer {
+ public:
+  typedef void (*CodeAction)(AnalysisConsumer &C, AnalysisManager &M, Decl *D);
+   
+ private:
   typedef std::vector<CodeAction> Actions;
   Actions FunctionActions;
   Actions ObjCMethodActions;
@@ -189,8 +188,9 @@ public:
 } // end anonymous namespace
 
 namespace llvm {
-  template <> struct FoldingSetTrait<CodeAction> {
-    static inline void Profile(CodeAction X, FoldingSetNodeID& ID) {
+  template <> struct FoldingSetTrait<AnalysisConsumer::CodeAction> {
+    static inline void Profile(AnalysisConsumer::CodeAction X, 
+                               FoldingSetNodeID& ID) {
       ID.AddPointer(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(X)));
     }
   };
index 73b584b5205d1662d70d095ce0d52939f2157851..35a44ca166a54717acae596077a456b41bf52782 100644 (file)
@@ -484,7 +484,7 @@ ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,
   assert(ContainsLocation(DInfo) &&
          "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())
     if (ContainsLocation(TL))
       return TypeLocResolver(Ctx, Loc, D).Visit(TL);
index a8e31d2cfa2b8af2c2f4af6e9de7e198fbcaebf3..2b37e9df2c0e6550fb288fa25d78e1fec3e7485b 100644 (file)
@@ -325,5 +325,5 @@ void JumpScopeChecker::CheckJump(Stmt *From, Stmt *To,
 }
 
 void Sema::DiagnoseInvalidJumps(Stmt *Body) {
-  JumpScopeChecker(Body, *this);
+  (void)JumpScopeChecker(Body, *this);
 }
index 18ab092102cb4b039883419f66f2da422a1d9cc3..dc0daae4dcfc872c618bea0c1194f6b9602991ec 100644 (file)
@@ -72,7 +72,7 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer,
       Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>());
   };
   // Check for any pending objective-c implementation decl.
-  while (ADecl = P.RetreivePendingObjCImpDecl())
+  while ((ADecl = P.RetreivePendingObjCImpDecl()))
     Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>());
 
   // process any TopLevelDecls generated by #pragma weak
index 698d81e30f3d9cedf499a19aba6b1b8a1bc5ae25..4f04bd2604f7b652ac81241af0c5700f2ba431ae 100644 (file)
@@ -1936,7 +1936,7 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
   }
 
   if (RD->isAbstract())
-    AbstractClassUsageDiagnoser(*this, RD);
+    (void)AbstractClassUsageDiagnoser(*this, RD);
 
   if (!RD->isDependentType() && !RD->isInvalidDecl())
     AddImplicitlyDeclaredMembersToClass(RD);