diff options
Diffstat (limited to 'clang/lib')
20 files changed, 7 insertions, 32 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 0bda053f35f..35447166dcb 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -1356,7 +1356,6 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, // Suppress the final autorelease in ARC. AutoreleaseResult = false; - SmallVector<CXXCtorInitializer *, 8> IvarInitializers; for (ObjCImplementationDecl::init_const_iterator B = IMP->init_begin(), E = IMP->init_end(); B != E; ++B) { CXXCtorInitializer *IvarInit = (*B); diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index f077fd68cc4..66e5eaf894f 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -70,8 +70,6 @@ const DerivedArgList &Compilation::getArgsForToolChain(const ToolChain *TC, } bool Compilation::CleanupFile(const char *File, bool IssueErrors) const { - std::string P(File); - // FIXME: Why are we trying to remove files that we have not created? For // example we should only try to remove a temporary assembly file if // "clang -cc1" succeed in writing it. Was this a workaround for when diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 8cfaa6c44b1..d61a8e99d9e 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1177,7 +1177,7 @@ void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args, // Construct the actions to perform. ActionList LinkerInputs; - ActionList SplitInputs; + llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases> PL; for (unsigned i = 0, e = Inputs.size(); i != e; ++i) { types::ID InputType = Inputs[i].first; diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8db5cf1bc21..20b8089fc68 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1763,7 +1763,6 @@ std::string CompilerInvocation::getModuleHash() const { const HeaderSearchOptions &hsOpts = getHeaderSearchOpts(); code = hash_combine(code, ppOpts.UsePredefines, ppOpts.DetailedRecord); - std::vector<StringRef> MacroDefs; for (std::vector<std::pair<std::string, bool/*isUndef*/> >::const_iterator I = getPreprocessorOpts().Macros.begin(), IEnd = getPreprocessorOpts().Macros.end(); diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 075fe93d584..49d01f9d372 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -180,7 +180,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, "This action does not have AST file support!"); IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics()); - std::string Error; + ASTUnit *AST = ASTUnit::LoadFromASTFile(InputFile, Diags, CI.getFileSystemOpts()); if (!AST) diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index d755839c0f7..f55c6021789 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -32,7 +32,6 @@ using namespace llvm::opt; static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) { using namespace clang::frontend; - StringRef Action("unknown"); switch (CI.getFrontendOpts().ProgramAction) { case ASTDeclList: return new ASTDeclListAction(); diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 784f69ee68d..881e2252fd4 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5561,7 +5561,6 @@ void Parser::ParseBracketDeclarator(Declarator &D) { MaybeParseCXX11Attributes(attrs); // Remember that we parsed the empty array type. - ExprResult NumElements; D.AddTypeInfo(DeclaratorChunk::getArray(0, false, false, 0, T.getOpenLocation(), T.getCloseLocation()), diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index b2bff51cd95..84487cc973d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -5984,7 +5984,6 @@ checkPointerTypesForAssignment(Sema &S, QualType LHSType, QualType RHSType) { // C99 6.5.16.1p1: This following citation is common to constraints // 3 & 4 (below). ...and the type *pointed to* by the left has all the // qualifiers of the type *pointed to* by the right; - Qualifiers lq; // As a special case, 'non-__weak A *' -> 'non-__weak const *' is okay. if (lhq.getObjCLifetime() != rhq.getObjCLifetime() && diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 59a167a62c5..6ad042991c2 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1225,9 +1225,8 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, if (ArraySize && !ArraySize->isTypeDependent()) { ExprResult ConvertedSize; if (getLangOpts().CPlusPlus1y) { - unsigned IntWidth = Context.getTargetInfo().getIntWidth(); - assert(IntWidth && "Builtin type of size 0?"); - llvm::APSInt Value(IntWidth); + assert(Context.getTargetInfo().getIntWidth() && "Builtin type of size 0?"); + ConvertedSize = PerformImplicitConversion(ArraySize, Context.getSizeType(), AA_Converting); @@ -4457,7 +4456,6 @@ QualType Sema::CXXCheckConditionalOperands(ExprResult &Cond, ExprResult &LHS, // those operands to the type of the other. if (!Context.hasSameType(LTy, RTy) && (LTy->isRecordType() || RTy->isRecordType())) { - ImplicitConversionSequence ICSLeftToRight, ICSRightToLeft; // These return true if a single direction is already ambiguous. QualType L2RType, R2LType; bool HaveL2R, HaveR2L; diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index af74f0d4a3e..e69ea1647f0 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/lib/Sema/SemaPseudoObject.cpp @@ -1011,8 +1011,6 @@ Sema::ObjCSubscriptKind // Look for a conversion to an integral, enumeration type, or // objective-C pointer type. - UnresolvedSet<4> ViableConversions; - UnresolvedSet<4> ExplicitConversions; std::pair<CXXRecordDecl::conversion_iterator, CXXRecordDecl::conversion_iterator> Conversions = cast<CXXRecordDecl>(RecordTy->getDecl())->getVisibleConversionFunctions(); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 9bd8678c876..861d5cf240c 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -499,7 +499,6 @@ void Sema::ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &Val, // We don't diagnose this overflow, because it is implementation-defined // behavior. // FIXME: Introduce a second, default-ignored warning for this case? - llvm::APSInt OldVal(Val); Val.setIsSigned(NewSign); } } @@ -1044,7 +1043,6 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, for (EI = EnumVals.begin(); EI != EIend; EI++){ // Drop unneeded case values - llvm::APSInt CIVal; while (CI != CaseVals.end() && CI->first < EI->first) CI++; diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index e9977d42aa2..63d8d8db26f 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -2652,11 +2652,6 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, } } - // If we're dealing with a member template where the template parameters - // have been instantiated, this provides the original template parameters - // from which the member template's parameters were instantiated. - SmallVector<const NamedDecl *, 4> InstantiatedTemplateParameters; - if (Matched.size() >= 1) { SmallVector<MatchResult, 4>::iterator Best = Matched.begin(); if (Matched.size() == 1) { diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 3c621dafab9..40e020dc076 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -2352,8 +2352,7 @@ bool Sema::InstantiateClassTemplateSpecialization( // If we're dealing with a member template where the template parameters // have been instantiated, this provides the original template parameters // from which the member template's parameters were instantiated. - SmallVector<const NamedDecl *, 4> InstantiatedTemplateParameters; - + if (Matched.size() >= 1) { SmallVectorImpl<MatchResult>::iterator Best = Matched.begin(); if (Matched.size() == 1) { diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index aa7459de272..dd28bfcf7d2 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -2625,7 +2625,6 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, } T = S.BuildReferenceType(T, DeclType.Ref.LValueRef, DeclType.Loc, Name); - Qualifiers Quals; if (DeclType.Ref.HasRestrict) T = S.BuildQualifiedType(T, DeclType.Loc, Qualifiers::Restrict); break; diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 405488c3571..fa5b83d98fb 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -1040,7 +1040,6 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, // Imports if (Chain) { serialization::ModuleManager &Mgr = Chain->getModuleManager(); - SmallVector<char, 128> ModulePaths; Record.clear(); for (ModuleManager::ModuleIterator M = Mgr.begin(), MEnd = Mgr.end(); diff --git a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index f66f8b75ed3..6b8c56f7584 100644 --- a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -733,8 +733,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(const ObjCMethodCall &msg, // Verify that all arguments have Objective-C types. Optional<ExplodedNode*> errorNode; - ProgramStateRef state = C.getState(); - + for (unsigned I = variadicArgsBegin; I != variadicArgsEnd; ++I) { QualType ArgTy = msg.getArgExpr(I)->getType(); if (ArgTy->isObjCObjectPointerType()) diff --git a/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp index 0e1064ef53a..33df6a37bc2 100644 --- a/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp @@ -37,7 +37,6 @@ public: void NoReturnFunctionChecker::checkPostCall(const CallEvent &CE, CheckerContext &C) const { - ProgramStateRef state = C.getState(); bool BuildSinks = false; if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CE.getDecl())) diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 411e2f6aea3..5664e41324e 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -598,7 +598,6 @@ void ExprEngine::ProcessDeleteDtor(const CFGDeleteDtor Dtor, void ExprEngine::ProcessBaseDtor(const CFGBaseDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst) { const LocationContext *LCtx = Pred->getLocationContext(); - ProgramStateRef State = Pred->getState(); const CXXDestructorDecl *CurDtor = cast<CXXDestructorDecl>(LCtx->getDecl()); Loc ThisPtr = getSValBuilder().getCXXThis(CurDtor, diff --git a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp index 6e236681440..0bc510a28d8 100644 --- a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp +++ b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp @@ -175,7 +175,6 @@ ProgramState::invalidateRegionsImpl(ValueList Values, const CallEvent *Call) const { ProgramStateManager &Mgr = getStateManager(); SubEngine* Eng = Mgr.getOwningEngine(); - InvalidatedSymbols ConstIS; InvalidatedSymbols Invalidated; if (!IS) diff --git a/clang/lib/Tooling/JSONCompilationDatabase.cpp b/clang/lib/Tooling/JSONCompilationDatabase.cpp index 1e33b418af4..dad4600798b 100644 --- a/clang/lib/Tooling/JSONCompilationDatabase.cpp +++ b/clang/lib/Tooling/JSONCompilationDatabase.cpp @@ -174,7 +174,7 @@ std::vector<CompileCommand> JSONCompilationDatabase::getCompileCommands(StringRef FilePath) const { SmallString<128> NativeFilePath; llvm::sys::path::native(FilePath, NativeFilePath); - std::vector<StringRef> PossibleMatches; + std::string Error; llvm::raw_string_ostream ES(Error); StringRef Match = MatchTrie.findEquivalent(NativeFilePath.str(), ES); |