Re: [PATCH] D12834: add gcc abi_tag support
foutrelis added a comment. In http://reviews.llvm.org/D12834#314136, @elizafox wrote: > In http://reviews.llvm.org/D12834#311890, @foutrelis wrote: > > > We have received a few reports of clang crashes after applying the abi_tag > > support patch to our llvm/clang package in Arch Linux. > > > Why would you put a patch clearly marked as "needs review" into a > distribution?!?!?!?! We waited 6 months before switching to the new ABI in libstdc++. Ideally, we would have waited until the patch was reviewed and merged but did not want to wait much longer. I also (wrongly) considered the patch to be relative stable. > In any case, the recursion source seems obvious to me, but I don't know how > to add patches to this reviewboard item. If the correction is obvious as well and not very complex, would you mind sharing it? Repository: rL LLVM http://reviews.llvm.org/D12834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15737: [clang-tidy] Preserve comments and preprocessor directives when simplifying boolean expressions
LegalizeAdulthood updated this revision to Diff 43647. LegalizeAdulthood marked 6 inline comments as done. LegalizeAdulthood added a comment. Update from review comments http://reviews.llvm.org/D15737 Files: clang-tidy/readability/SimplifyBooleanExprCheck.cpp clang-tidy/readability/SimplifyBooleanExprCheck.h test/clang-tidy/readability-simplify-bool-expr.cpp Index: test/clang-tidy/readability-simplify-bool-expr.cpp === --- test/clang-tidy/readability-simplify-bool-expr.cpp +++ test/clang-tidy/readability-simplify-bool-expr.cpp @@ -871,3 +871,27 @@ } // CHECK-MESSAGES: :[[@LINE-5]]:12: warning: {{.*}} in conditional return // CHECK-FIXES: return p4 != nullptr;{{$}} + +bool comments_in_the_middle(bool b) { + if (b) { +return true; + } else { +// something wicked this way comes +return false; + } +} +// CHECK-MESSAGES: :[[@LINE-6]]:12: warning: {{.*}} in conditional return +// CHECK-FIXES: {{^}} if (b) { +// CHECK-FIXES: // something wicked this way comes{{$}} + +bool preprocessor_in_the_middle(bool b) { + if (b) { +return true; + } else { +#define SOMETHING_WICKED false +return false; + } +} +// CHECK-MESSAGES: :[[@LINE-6]]:12: warning: {{.*}} in conditional return +// CHECK-FIXES: {{^}} if (b) { +// CHECK-FIXES: {{^}}#define SOMETHING_WICKED false Index: clang-tidy/readability/SimplifyBooleanExprCheck.h === --- clang-tidy/readability/SimplifyBooleanExprCheck.h +++ clang-tidy/readability/SimplifyBooleanExprCheck.h @@ -154,6 +154,10 @@ const ast_matchers::MatchFinder::MatchResult &Result, const CompoundStmt *Compound, bool Negated = false); + void issueDiag(const ast_matchers::MatchFinder::MatchResult &Result, + SourceLocation Loc, StringRef Description, + SourceRange ReplacementRange, StringRef Replacement); + const bool ChainedConditionalReturn; const bool ChainedConditionalAssignment; }; Index: clang-tidy/readability/SimplifyBooleanExprCheck.cpp === --- clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -107,8 +107,12 @@ } std::pair OperatorNames[] = { -{OO_EqualEqual, "=="}, {OO_ExclaimEqual, "!="}, {OO_Less, "<"}, -{OO_GreaterEqual, ">="}, {OO_Greater, ">"}, {OO_LessEqual, "<="}}; +{OO_EqualEqual, "=="}, +{OO_ExclaimEqual, "!="}, +{OO_Less, "<"}, +{OO_GreaterEqual, ">="}, +{OO_Greater, ">"}, +{OO_LessEqual, "<="}}; StringRef getOperatorName(OverloadedOperatorKind OpKind) { for (auto Name : OperatorNames) { @@ -201,8 +205,7 @@ } if (!NegatedOperator.empty() && LHS && RHS) { return (asBool((getText(Result, *LHS) + " " + NegatedOperator + " " + - getText(Result, *RHS)) - .str(), + getText(Result, *RHS)).str(), NeedsStaticCast)); } @@ -324,11 +327,10 @@ void SimplifyBooleanExprCheck::matchBoolCondition(MatchFinder *Finder, bool Value, StringRef BooleanId) { - Finder->addMatcher( - ifStmt(isExpansionInMainFile(), - hasCondition(cxxBoolLiteral(equals(Value)).bind(BooleanId))) - .bind(IfStmtId), - this); + Finder->addMatcher(ifStmt(isExpansionInMainFile(), +hasCondition(cxxBoolLiteral(equals(Value)) + .bind(BooleanId))).bind(IfStmtId), + this); } void SimplifyBooleanExprCheck::matchTernaryResult(MatchFinder *Finder, @@ -347,15 +349,13 @@ if (ChainedConditionalReturn) { Finder->addMatcher(ifStmt(isExpansionInMainFile(), hasThen(returnsBool(Value, ThenLiteralId)), - hasElse(returnsBool(!Value))) - .bind(Id), + hasElse(returnsBool(!Value))).bind(Id), this); } else { Finder->addMatcher(ifStmt(isExpansionInMainFile(), unless(hasParent(ifStmt())), hasThen(returnsBool(Value, ThenLiteralId)), - hasElse(returnsBool(!Value))) - .bind(Id), + hasElse(returnsBool(!Value))).bind(Id), this); } } @@ -382,8 +382,7 @@ } else { Finder->addMatcher(ifStmt(isExpansionInMainFile(), unless(hasParent(ifStmt())), hasThen(Then), - hasElse(Else)) - .bind(Id), + hasElse(Else)).bind(Id), this); } } @@ -396,8 +395,7 @@
r256457 - Prune the feature "tls". No one is using it since TLS is enabled for Cygwin.
Author: chapuni Date: Sun Dec 27 00:14:33 2015 New Revision: 256457 URL: http://llvm.org/viewvc/llvm-project?rev=256457&view=rev Log: Prune the feature "tls". No one is using it since TLS is enabled for Cygwin. Modified: cfe/trunk/test/lit.cfg Modified: cfe/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=256457&r1=256456&r2=256457&view=diff == --- cfe/trunk/test/lit.cfg (original) +++ cfe/trunk/test/lit.cfg Sun Dec 27 00:14:33 2015 @@ -422,10 +422,6 @@ if not re.match(r'.*-(cygwin)$', config. if platform.system() not in ['Windows']: config.available_features.add('can-remove-opened-file') -# Not set for targeting tls-incapable targets. -if not re.match(r'.*-cygwin$', config.target_triple): -config.available_features.add('tls') - # Returns set of available features, registered-target(s) and asserts. def get_llvm_config_props(): set_of_features = set() ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r256461 - For FreeBSD on mips, pass -G options to the linker
Author: dim Date: Sun Dec 27 00:47:09 2015 New Revision: 256461 URL: http://llvm.org/viewvc/llvm-project?rev=256461&view=rev Log: For FreeBSD on mips, pass -G options to the linker Summary: On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to the linker. See also: https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-G-2007 This has been adapted from https://reviews.freebsd.org/D1190, with an added test case. Reviewers: theraven, atanasyan, emaste Subscribers: brooks, tomatabacu, cfe-commits, seanbruno, emaste Differential Revision: http://reviews.llvm.org/D9114 Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/freebsd.c Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=256461&r1=256460&r2=256461&view=diff == --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Sun Dec 27 00:47:09 2015 @@ -7885,6 +7885,17 @@ void freebsd::Linker::ConstructJob(Compi CmdArgs.push_back("elf32ppc_fbsd"); } + if (Arg *A = Args.getLastArg(options::OPT_G)) { +if (ToolChain.getArch() == llvm::Triple::mips || + ToolChain.getArch() == llvm::Triple::mipsel || + ToolChain.getArch() == llvm::Triple::mips64 || + ToolChain.getArch() == llvm::Triple::mips64el) { + StringRef v = A->getValue(); + CmdArgs.push_back(Args.MakeArgString("-G" + v)); + A->claim(); +} + } + if (Output.isFilename()) { CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); Modified: cfe/trunk/test/Driver/freebsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd.c?rev=256461&r1=256460&r2=256461&view=diff == --- cfe/trunk/test/Driver/freebsd.c (original) +++ cfe/trunk/test/Driver/freebsd.c Sun Dec 27 00:47:09 2015 @@ -136,3 +136,8 @@ // RUN: | FileCheck --check-prefix=CHECK-SPARC-CPU %s // CHECK-SPARC-CPU: cc1{{.*}}" "-target-cpu" "ultrasparc" // CHECK-SPARC-CPU: as{{.*}}" "-Av9 + +// Check that -G flags are passed to the linker for mips +// RUN: %clang -target mips-unknown-freebsd %s -### -G0 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MIPS-G %s +// CHECK-MIPS-G: ld{{.*}}" "-G0" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r256463 - ArrayRef-ize TemplateParameterList. NFC
Author: majnemer Date: Sun Dec 27 01:16:27 2015 New Revision: 256463 URL: http://llvm.org/viewvc/llvm-project?rev=256463&view=rev Log: ArrayRef-ize TemplateParameterList. NFC Modified: cfe/trunk/include/clang/AST/DeclTemplate.h cfe/trunk/lib/AST/ASTContext.cpp cfe/trunk/lib/AST/ASTImporter.cpp cfe/trunk/lib/AST/DeclTemplate.cpp cfe/trunk/lib/Sema/SemaLambda.cpp cfe/trunk/lib/Sema/SemaTemplate.cpp cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp cfe/trunk/lib/Serialization/ASTReader.cpp Modified: cfe/trunk/include/clang/AST/DeclTemplate.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=256463&r1=256462&r2=256463&view=diff == --- cfe/trunk/include/clang/AST/DeclTemplate.h (original) +++ cfe/trunk/include/clang/AST/DeclTemplate.h Sun Dec 27 01:16:27 2015 @@ -68,15 +68,13 @@ protected: } TemplateParameterList(SourceLocation TemplateLoc, SourceLocation LAngleLoc, -NamedDecl **Params, unsigned NumParams, -SourceLocation RAngleLoc); +ArrayRef Params, SourceLocation RAngleLoc); public: static TemplateParameterList *Create(const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, - NamedDecl **Params, - unsigned NumParams, + ArrayRef Params, SourceLocation RAngleLoc); /// \brief Iterates through the template parameters in this list. @@ -155,9 +153,9 @@ template class FixedSizeTempl public: FixedSizeTemplateParameterListStorage(SourceLocation TemplateLoc, SourceLocation LAngleLoc, -NamedDecl **Params, +ArrayRef Params, SourceLocation RAngleLoc) - : List(TemplateLoc, LAngleLoc, Params, N, RAngleLoc) { + : List(TemplateLoc, LAngleLoc, Params, RAngleLoc) { // Because we're doing an evil layout hack above, have some // asserts, just to double-check everything is laid out like // expected. Modified: cfe/trunk/lib/AST/ASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=256463&r1=256462&r2=256463&view=diff == --- cfe/trunk/lib/AST/ASTContext.cpp (original) +++ cfe/trunk/lib/AST/ASTContext.cpp Sun Dec 27 01:16:27 2015 @@ -660,8 +660,7 @@ ASTContext::getCanonicalTemplateTemplate nullptr, TemplateParameterList::Create(*this, SourceLocation(), SourceLocation(), - CanonParams.data(), - CanonParams.size(), + CanonParams, SourceLocation())); // Get the new insert position for the node we care about. Modified: cfe/trunk/lib/AST/ASTImporter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=256463&r1=256462&r2=256463&view=diff == --- cfe/trunk/lib/AST/ASTImporter.cpp (original) +++ cfe/trunk/lib/AST/ASTImporter.cpp Sun Dec 27 01:16:27 2015 @@ -2144,7 +2144,7 @@ TemplateParameterList *ASTNodeImporter:: return TemplateParameterList::Create(Importer.getToContext(), Importer.Import(Params->getTemplateLoc()), Importer.Import(Params->getLAngleLoc()), - ToParams.data(), ToParams.size(), + ToParams, Importer.Import(Params->getRAngleLoc())); } Modified: cfe/trunk/lib/AST/DeclTemplate.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclTemplate.cpp?rev=256463&r1=256462&r2=256463&view=diff == --- cfe/trunk/lib/AST/DeclTemplate.cpp (original) +++ cfe/trunk/lib/AST/DeclTemplate.cpp Sun Dec 27 01:16:27 2015 @@ -30,10 +30,10 @@ using namespace clang; TemplateParameterList::TemplateParameterList(SourceLocation TemplateLoc, SourceLocation LAngleLoc, - NamedDecl **Params, unsigned NumParams, + ArrayRef Params,