[lldb] Fix --source-regexp-function for Swift static functions#12873
[lldb] Fix --source-regexp-function for Swift static functions#12873kastiglione wants to merge 2 commits into
Conversation
|
@swift-ci test |
|
@swift-ci test |
1 similar comment
|
@swift-ci test |
|
@swift-ci test macOS |
|
@swift-ci test windows |
5 similar comments
|
@swift-ci test windows |
|
@swift-ci test windows |
|
@swift-ci test windows |
|
@swift-ci test windows |
|
@swift-ci test windows |
c7458b3 to
8ff00c8
Compare
|
@swift-ci test |
|
depends on #12945 |
|
@swift-ci test |
1 similar comment
|
@swift-ci test |
| MODULENAME?=$(shell basename $(EXE) .out) | ||
| # Compile with -parse-as-library when main.swift contains "@main". | ||
| ifneq "$(shell grep -w '@main' $(VPATH)/main.swift 2>/dev/null)" "" | ||
| ifneq "$(wildcard $(VPATH)/main.swift)" "" |
There was a problem hiding this comment.
Wouldn't it be much more straightforward to grep in $(SWIFT_SOURCES)? Or is that not set here?
There was a problem hiding this comment.
I wrote it as main.swift to follow/enforce convention. Currently all 46 uses of @main are in files named main.swift.
| # Compile with -parse-as-library when main.swift contains "@main". | ||
| ifneq "$(shell grep -w '@main' $(VPATH)/main.swift 2>/dev/null)" "" | ||
| ifneq "$(wildcard $(VPATH)/main.swift)" "" | ||
| ifneq "$(shell git -C $(VPATH) grep --no-index -w '@main' main.swift)" "" |
There was a problem hiding this comment.
I don't think invoking git during the build is a great idea. Some build pipelines copy the sources somewhere else for building.
There was a problem hiding this comment.
Some build pipelines copy the sources somewhere else for building.
Meaning it won't work if the sources aren't part of git? That's a case that --no-index handles:
--no-index
Search files in the current directory that is not managed by Git, or by
ignoring that the current directory is managed by Git. This is rather similar
to running the regular grep(1) utility with its -r option specified, but with
some additional benefits, such as ...
There was a problem hiding this comment.
fwiw since I find git-diff much better than original diff, I use the following alias:
alias diff='git diff --no-index'In my experience git grep --no-index and git diff --no-index are capable replacements for grep and diff respectively.
Fixes the ability to set a source breakpoint with a function filter – where the function is a static Swift function.