[Lldb-commits] [lldb] [clang] [openmp] [polly] [flang] [mlir] [compiler-rt] [llvm] [lld] [VPlan] Compute scalable VF in preheader for induction increment. (PR #74762)

2023-12-09 Thread Florian Hahn via lldb-commits

https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/74762
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang] [openmp] [polly] [flang] [mlir] [compiler-rt] [llvm] [lld] [VPlan] Compute scalable VF in preheader for induction increment. (PR #74762)

2023-12-09 Thread Florian Hahn via lldb-commits


@@ -340,8 +340,14 @@ Value *VPInstruction::generateInstruction(VPTransformState 
&State,
   auto *Phi = State.get(getOperand(0), 0);
   // The loop step is equal to the vectorization factor (num of SIMD
   // elements) times the unroll factor (num of SIMD instructions).
-  Value *Step =
-  createStepForVF(Builder, Phi->getType(), State.VF, State.UF);
+  Value *Step;
+  {
+BasicBlock *VectorPH = State.CFG.getPreheaderBBFor(this);
+IRBuilder<> PHBuilder(VectorPH->getTerminator());
+// Step is loop-invariant, calls to vscale will be placed in the
+// preheader.
+Step = createStepForVF(PHBuilder, Phi->getType(), State.VF, State.UF);
+  }

fhahn wrote:

The cow has been remove in 
https://github.com/llvm/llvm-project/commit/a5891fa4d2b76cf9dec96da9ded59fc4937d3342

https://github.com/llvm/llvm-project/pull/74762
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [lldb] [clang] [lld] [clang-tools-extra] [ADT] Rename SmallString::{starts, ends}with to {starts, ends}_with (PR #74916)

2023-12-09 Thread Fangrui Song via lldb-commits

https://github.com/MaskRay approved this pull request.


https://github.com/llvm/llvm-project/pull/74916
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [llvm] [lld] [lldb] [ADT] Rename SmallString::{starts, ends}with to {starts, ends}_with (PR #74916)

2023-12-09 Thread Kazu Hirata via lldb-commits

https://github.com/kazutakahirata closed 
https://github.com/llvm/llvm-project/pull/74916
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] cc4ecfd - [ADT] Rename SmallString::{starts, ends}with to {starts, ends}_with (#74916)

2023-12-09 Thread via lldb-commits

Author: Kazu Hirata
Date: 2023-12-09T14:28:45-08:00
New Revision: cc4ecfd68b79a44f101fe9924d088a83477797c0

URL: 
https://github.com/llvm/llvm-project/commit/cc4ecfd68b79a44f101fe9924d088a83477797c0
DIFF: 
https://github.com/llvm/llvm-project/commit/cc4ecfd68b79a44f101fe9924d088a83477797c0.diff

LOG: [ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)

This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20.  Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.

Added: 


Modified: 
clang-tools-extra/clang-doc/Mapper.cpp
clang-tools-extra/modularize/ModuleAssistant.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/Basic/Module.cpp
clang/lib/CrossTU/CrossTranslationUnit.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/Darwin.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Sema/SemaCodeComplete.cpp
lld/COFF/PDB.cpp
lld/MachO/InputFiles.cpp
lldb/source/Commands/CommandCompletions.cpp
llvm/include/llvm/ADT/SmallString.h
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/Support/Windows/Path.inc
llvm/tools/dsymutil/DebugMap.cpp
llvm/tools/llvm-cov/CodeCoverage.cpp
llvm/tools/llvm-cov/CoverageReport.cpp
llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
llvm/tools/llvm-ml/llvm-ml.cpp
llvm/unittests/Support/Path.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-doc/Mapper.cpp 
b/clang-tools-extra/clang-doc/Mapper.cpp
index 5264417748a12b..bb8b7952980ac6 100644
--- a/clang-tools-extra/clang-doc/Mapper.cpp
+++ b/clang-tools-extra/clang-doc/Mapper.cpp
@@ -103,7 +103,7 @@ llvm::SmallString<128> MapASTVisitor::getFile(const 
NamedDecl *D,
   .getPresumedLoc(D->getBeginLoc())
   .getFilename());
   IsFileInRootDir = false;
-  if (RootDir.empty() || !File.startswith(RootDir))
+  if (RootDir.empty() || !File.starts_with(RootDir))
 return File;
   IsFileInRootDir = true;
   llvm::SmallString<128> Prefix(RootDir);

diff  --git a/clang-tools-extra/modularize/ModuleAssistant.cpp 
b/clang-tools-extra/modularize/ModuleAssistant.cpp
index 0d4c09987eb1cf..5c11ffdb8589d5 100644
--- a/clang-tools-extra/modularize/ModuleAssistant.cpp
+++ b/clang-tools-extra/modularize/ModuleAssistant.cpp
@@ -175,7 +175,7 @@ static bool addModuleDescription(Module *RootModule,
   llvm::SmallString<256> NativePath, NativePrefix;
   llvm::sys::path::native(HeaderFilePath, NativePath);
   llvm::sys::path::native(HeaderPrefix, NativePrefix);
-  if (NativePath.startswith(NativePrefix))
+  if (NativePath.starts_with(NativePrefix))
 FilePath = std::string(NativePath.substr(NativePrefix.size() + 1));
   else
 FilePath = std::string(HeaderFilePath);

diff  --git a/clang/lib/AST/MicrosoftMangle.cpp 
b/clang/lib/AST/MicrosoftMangle.cpp
index 50ab6ea59be9d0..c59a66e103a6e3 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -3809,14 +3809,14 @@ void 
MicrosoftMangleContextImpl::mangleCXXRTTICompleteObjectLocator(
   llvm::raw_svector_ostream Stream(VFTableMangling);
   mangleCXXVFTable(Derived, BasePath, Stream);
 
-  if (VFTableMangling.startswith("??@")) {
-assert(VFTableMangling.endswith("@"));
+  if (VFTableMangling.starts_with("??@")) {
+assert(VFTableMangling.ends_with("@"));
 Out << VFTableMangling << "??_R4@";
 return;
   }
 
-  assert(VFTableMangling.startswith("??_7") ||
- VFTableMangling.startswith("??_S"));
+  assert(VFTableMangling.starts_with("??_7") ||
+ VFTableMangling.starts_with("??_S"));
 
   Out << "??_R4" << VFTableMangling.str().drop_front(4);
 }

diff  --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index e4ac1abf12a7f8..7523e509a47108 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -89,7 +89,7 @@ static bool isPlatformEnvironment(const TargetInfo &Target, 
StringRef Feature) {
   // where both are valid examples of the same platform+environment but in the
   // variant (2) the simulator is hardcoded as part of the platform name. Both
   // forms above should match for "iossimulator" requirement.
-  if (Target.getTriple().isOSDarwin() && PlatformEnv.endswith("simulator"))
+  if (Target.getTriple().isOSDarwin() && PlatformEnv.ends_with("simulator"))
 return PlatformEnv == Feature || CmpPlatformEnv(PlatformEnv, Feature);
 
   return PlatformEnv == Feature;

diff  --git a/clang/lib/CrossTU/CrossTranslationUnit.cpp 
b/clang/lib/CrossTU/CrossTranslationUnit.cpp
index 540c22d078654c..94c10e50d7d064 100644
--- a/clang/lib/CrossTU/CrossTranslationUnit.cpp
+++ b/clang/lib/CrossTU/CrossTranslationUnit.cpp
@@ -551,7 +551,7 @@ CrossTranslationUnitContext::ASTLoader::load(StringRef 
Identifier) {
   // Normalize by remov

[Lldb-commits] [lldb] [lldb-dap] Implement command directives (PR #74808)

2023-12-09 Thread Walter Erquinigo via lldb-commits

walter-erquinigo wrote:

@clayborg , I actually insist on aborting on failure for this feature. You 
mention:

> It would be nice if the RunLLDBCommands function could take an extra bool 
> &fatal_error that clients could check after running when needed to decide 
> what to do if this is set to true due to any ! prefixed commands failing.

That would imply that some commands would have a specific behavior upon a 
failed ! command, and other commands would have a different behavior. That 
makes this feature a bit hard to use by actual users, as it wouldn't have a 
consistent behavior, unlike ? commands. 

What I wanted to achieve with ! was to have a way for users to tell the 
lldb-dap: hey, this command is critical for my flow, abort if it fails. Having 
a mild behavior instead of aborting kind of defeats the purpose of this feature.

https://github.com/llvm/llvm-project/pull/74808
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits