[PATCH] D86000: Add an unsigned shift base sanitizer

2020-08-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. What's next, a sanitizer that input to signed right-shift is always non-negative? :) FWIW "fixing" these "bugs" via `(x & ~(~1U << (32-shamt))) << shamt` is going to be fine, i've already taught instcombine to drop such pointless masking before left-shift in PR42563

[PATCH] D85612: [Sema] Use proper integral cast for an enumerate with a fixed bool type

2020-08-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, thank you for the fix! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85612/new/ https://reviews.llvm.org/D85612 ___

[PATCH] D81272: [clang-tidy] New check `bugprone-redundant-branch-condition`

2020-08-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. In D81272#2218246 , @whisperity wrote: > In D81272#2218175 , @aaron.ballman > wrote: > >> While I agree with your observation about data and

[clang-tools-extra] 3450533 - Add support for C++20 concepts and decltype to modernize-use-trailing-return-type.

2020-08-15 Thread Aaron Ballman via cfe-commits
Author: Bernhard Manfred Gruber Date: 2020-08-15T10:40:22-04:00 New Revision: 345053390ac17dd4a2e759de9e0e24c2605035db URL: https://github.com/llvm/llvm-project/commit/345053390ac17dd4a2e759de9e0e24c2605035db DIFF:

[PATCH] D80514: [clang-tidy] modernize-use-trailing-return-type support for C++20 concepts and decltype

2020-08-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. I've commit on your behalf in 345053390ac17dd4a2e759de9e0e24c2605035db , thank you for the patch! Comment at:

[PATCH] D86020: [MemCpyOptimizer] Optimize passing byref function arguments down the stack

2020-08-15 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko created this revision. atrosinenko added reviewers: arsenm, jdoerfert, rjmccall, rampitec. Herald added subscribers: cfe-commits, hiraditya. Herald added projects: clang, LLVM. atrosinenko requested review of this revision. Herald added a subscriber: wdng. When a byref function

[PATCH] D86020: [MemCpyOptimizer] Optimize passing byref function arguments down the stack

2020-08-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. If this optimization is valid, it's valid regardless of byref. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86020/new/ https://reviews.llvm.org/D86020 ___ cfe-commits mailing

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi added a comment. In D85981#2218583 , @vsapsai wrote: > It's good to imagine these attack vectors. But I think the module cache being a relatively fault-tolerant and compiler-controlled system mitigates a lot of the damage you could cause by a

[PATCH] D86020: [MemCpyOptimizer] Optimize passing byref function arguments down the stack

2020-08-15 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. This needs an LLVM IR test. Comment at: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp:1332 + if (CB->isByValArgument(i) || CB->paramHasAttr(i, Attribute::ByRef)) +MadeChange |= processByValOrByRefArgument(*CB, i); }

[PATCH] D85998: Add clang-cl "vctoolsdir" option to specify the location of the msvc toolchain

2020-08-15 Thread Zachary Henkel via Phabricator via cfe-commits
zahen added a comment. Once accepted, someone else will need to submit on my behalf. Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:74 + if (Arg *A = Args.getLastArg(options::OPT__SLASH_vctoolsdir)) { +Path = A->getValue(); +VSLayout =

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi updated this revision to Diff 285873. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85981/new/ https://reviews.llvm.org/D85981 Files: clang/include/clang/Serialization/ModuleManager.h clang/lib/Serialization/ModuleManager.cpp

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. vrnithinkumar requested review of this

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi updated this revision to Diff 285868. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85981/new/ https://reviews.llvm.org/D85981 Files: clang/include/clang/Serialization/ModuleManager.h clang/lib/Serialization/ModuleManager.cpp Index:

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:411 + if (NotNullState) { +auto NonNullVal = C.getSValBuilder().makeTruthVal(true); +NotNullState = Since the inner pointer value can be

[PATCH] D85752: [Analyzer] Store the pointed/referenced type for dynamic casts

2020-08-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/StaticAnalyzer/Core/DynamicType.cpp:73 +Ty = STTPTy->getReplacementType(); + if (Ty->isPointerType()) +Ty = Ty->getPointeeType();

[PATCH] D85728: [Analyzer] Support for the new variadic isa<> and isa_and_not_null<> in CastValueChecker

2020-08-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:289 + for (QualType CastToTy: CastToTyVec) { +if (CastFromTy->isPointerType()) + CastToTy = C.getASTContext().getPointerType(CastToTy); whisperity wrote: >

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400 + ProgramStateRef NotNullState, NullState; + std::tie(NotNullState, NullState) = State->assume(CallExprVal.getValue()); + NoQ wrote: > It's

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: clang/include/clang/Serialization/ModuleManager.h:62 - /// All loaded modules, indexed by name. - llvm::DenseMap Modules; + /// All loaded modules, indexed by file name. + llvm::StringMap Modules; Is it literally

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400 + ProgramStateRef NotNullState, NullState; + std::tie(NotNullState, NullState) = State->assume(CallExprVal.getValue()); + vrnithinkumar wrote: > NoQ

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi updated this revision to Diff 285875. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85981/new/ https://reviews.llvm.org/D85981 Files: clang/include/clang/Serialization/ModuleManager.h clang/lib/Serialization/ModuleManager.cpp Index:

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi added a subscriber: rsmith. CodaFi added a comment. Okay, I'm done throwing revisions at the bots. This windows-only failure is bizarre. @rsmith Do you have any insight into what's going wrong here? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77925: Revert "[TLI] Per-function fveclib for math library used for vectorization"

2020-08-15 Thread Wenlei He via Phabricator via cfe-commits
wenlei added a comment. In D77925#2016326 , @tejohnson wrote: > In D77925#2016299 , @wenlei wrote: > >> @mehdi_amini @tejohnson When can we re-land this (with tweaks)? I'm under >> the impression that a test case

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400 + ProgramStateRef NotNullState, NullState; + std::tie(NotNullState, NullState) = State->assume(CallExprVal.getValue()); + It's always `UnknownVal`

[PATCH] D86029: [analyzer] Add modeling for unque_ptr::get()

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. vrnithinkumar requested review of this

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi updated this revision to Diff 285874. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85981/new/ https://reviews.llvm.org/D85981 Files: clang/include/clang/Serialization/ModuleManager.h clang/lib/Serialization/ASTWriter.cpp

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: clang/include/clang/Serialization/ModuleManager.h:62 - /// All loaded modules, indexed by name. - llvm::DenseMap Modules; + /// All loaded modules, indexed by file name. + llvm::StringMap Modules; aprantl wrote: >

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:147 -if (!move::isMovedFrom(State, ThisR)) { - // TODO: Model this case as well. At least, avoid invalidation of - // globals. - return false; +if

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:682 anyEvaluated = true; +Dst.clear(); Dst.insert(checkDst); vrnithinkumar wrote: > > runCheckersForEvalCall() already has its own builder, you

[PATCH] D86029: [analyzer] Add modeling for unque_ptr::get()

2020-08-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Excellent, thanks! Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:362-363 + const auto *InnerPointVal = State->get(ThisRegion); + if (!InnerPointVal) +

[PATCH] D85981: [clang][Modules] Use File Names Instead of inodes As Loaded Module Keys

2020-08-15 Thread Robert Widmann via Phabricator via cfe-commits
CodaFi added inline comments. Comment at: clang/include/clang/Serialization/ModuleManager.h:62 - /// All loaded modules, indexed by name. - llvm::DenseMap Modules; + /// All loaded modules, indexed by file name. + llvm::StringMap Modules; aprantl wrote: >

[PATCH] D77925: Revert "[TLI] Per-function fveclib for math library used for vectorization"

2020-08-15 Thread Wenlei He via Phabricator via cfe-commits
wenlei added a comment. In D77925#2220169 , @mehdi_amini wrote: > I rather have a non closed list of veclib: if you just have a map keyed by > string instead of an enum it should just work out? The veclib type is also tied to the accepted values for

[PATCH] D77925: Revert "[TLI] Per-function fveclib for math library used for vectorization"

2020-08-15 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added a comment. I rather have a non closed list of veclib: if you just have a map keyed by string instead of an enum it should just work out? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77925/new/ https://reviews.llvm.org/D77925