Bug 1209330 - Get the clang plugin to compile with clang 3.7 and warnings-as-errors. r=mystor
authorBotond Ballo <botond@mozilla.com>
Mon, 28 Sep 2015 18:52:44 -0400
changeset 265101 6e2fb5bfc8b963837e4ef9a5bb958ddb0ef83b1d
parent 265100 09eb2d17aa32ef1b534ffbe9959acb51d5748a0f
child 265102 4823e6a7023c1fd39f590f38b994e42b95c101e7
push id65844
push userbballo@mozilla.com
push dateWed, 30 Sep 2015 02:36:56 +0000
treeherdermozilla-inbound@6e2fb5bfc8b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1209330
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1209330 - Get the clang plugin to compile with clang 3.7 and warnings-as-errors. r=mystor
build/clang-plugin/clang-plugin.cpp
--- a/build/clang-plugin/clang-plugin.cpp
+++ b/build/clang-plugin/clang-plugin.cpp
@@ -25,24 +25,16 @@ using namespace clang;
 #if CLANG_VERSION_FULL >= 306
 typedef std::unique_ptr<ASTConsumer> ASTConsumerPtr;
 #else
 typedef ASTConsumer *ASTConsumerPtr;
 #endif
 
 namespace {
 
-QualType GetCallReturnType(const CallExpr *expr) {
-#if CLANG_VERSION_FULL >= 307
-  return expr->getCallReturnType(expr->getCalleeDecl()->getASTContext());
-#else
-  return expr->getCallReturnType();
-#endif
-}
-
 using namespace clang::ast_matchers;
 class DiagnosticsMatcher {
 public:
   DiagnosticsMatcher();
 
   ASTConsumerPtr makeASTConsumer() { return astMatcher.newASTConsumer(); }
 
 private:
@@ -498,23 +490,16 @@ const FieldDecl *getClassRefCntMember(co
        field != e; ++field) {
     if (field->getName() == "mRefCnt") {
       return *field;
     }
   }
   return 0;
 }
 
-const FieldDecl *getClassRefCntMember(QualType T) {
-  while (const ArrayType *arrTy = T->getAsArrayTypeUnsafe())
-    T = arrTy->getElementType();
-  CXXRecordDecl *clazz = T->getAsCXXRecordDecl();
-  return clazz ? getClassRefCntMember(clazz) : 0;
-}
-
 const FieldDecl *getBaseRefCntMember(QualType T);
 
 const FieldDecl *getBaseRefCntMember(const CXXRecordDecl *D) {
   const FieldDecl *refCntMember = getClassRefCntMember(D);
   if (refCntMember && isClassRefCounted(D)) {
     return refCntMember;
   }
 
@@ -1312,18 +1297,16 @@ void DiagnosticsMatcher::NonMemMovableCh
       "Cannot instantiate %0 with non-memmovable template argument %1");
   unsigned note1ID = Diag.getDiagnosticIDs()->getCustomDiagID(
       DiagnosticIDs::Note, "instantiation of %0 requested here");
 
   // Get the specialization
   const ClassTemplateSpecializationDecl *specialization =
       Result.Nodes.getNodeAs<ClassTemplateSpecializationDecl>("specialization");
   SourceLocation requestLoc = specialization->getPointOfInstantiation();
-  const CXXRecordDecl *templ =
-      specialization->getSpecializedTemplate()->getTemplatedDecl();
 
   // Report an error for every template argument which is non-memmovable
   const TemplateArgumentList &args =
       specialization->getTemplateInstantiationArgs();
   for (unsigned i = 0; i < args.size(); ++i) {
     QualType argType = args[i].getAsType();
     if (NonMemMovable.hasEffectiveAnnotation(args[i].getAsType())) {
       Diag.Report(specialization->getLocation(), errorID) << specialization