[clang] [clang-tools-extra] [flang] [lld] [lldb] [llvm] [NFC] Rename Option parsing related files from OptXYZ -> OptionXYZ (PR #110692)

2024-10-04 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

The change itself seems fine but I'm not super convinced that the motivation is 
worth the churn. All these files live under the "Option" library and therefore 
it's (IMHO) clear that Opt is short for Option. 

Is this addressing code review feedback or a real issue where the two got 
confused, or addressing more of a hypothetical concern?

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


[clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-07-31 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

> Thanks @JDevlieghere! Could you add this special case?

I'm happy to help but I wouldn't feel comfortable making such a change without 
being able to reproduce and test it. 
 
> The authoritatively established and supported way to link with `ncurses` on 
> most Linux platforms would be to use `pkg-config --libs ncurses` to the 
> `LDFLAGS` for `ncurses` for the given compile target.

I'm confused, I thought the problem was that we are linking `ncurses` and 
that's not sufficient because it doesn't export all the symbols. Wouldn't the 
fix consist of linking `terminfo`, in addition to `ncurses` on the platform 
you're observing this on? I presume this isn't an issue on all Linux systems as 
we have bots running Ubuntu that do not have this issue. 

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


[clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-07-31 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

What I said was that, to the best of my knowledge, we don't have places in LLDB 
that rely on `terminfo` but not on `ncruses`. I think that statement still 
holds true. The assumption behind it was that `ncurses` provides a superset of 
the functionality provided by `terminfo`. At least on macOS, `ncruses` exports 
`stdscr` and `define_key`. What you're showing, that doesn't appear to be the 
case on your platform. It would be reasonable to special case that and link 
`terminfo` if not all symbols are provided by `ncurses`. 

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


[clang] [lldb] [llvm] [cmake][llvm] Limit the number of Xcode schemes created by default (PR #101243)

2024-07-30 Thread Jonas Devlieghere via cfe-commits

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

LGTM!

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


[clang] [llvm] [cmake][llvm] Limit the number of Xcode schemes created by default (PR #101243)

2024-07-30 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

Nice. An added benefit of doing it this way is that you can always set the 
property for a particular target if you really need the scheme and you can do 
it in the same cmake file that creates the target (i.e. in a subproject). 

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


[clang] [clang-fuzzer-dictionary] Fix build failure with libfuzzer (PR #99871)

2024-07-22 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/99871
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-fuzzer-dictionary] Fix build failure with libfuzzer (PR #99871)

2024-07-22 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] Update Clang extension criteria (PR #96532)

2024-06-24 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] [clang][utils] Remove ClangDataFormat.py for now (PR #96385)

2024-06-22 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] Bump the DWARF version number to 5 on Darwin. (PR #95164)

2024-06-11 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/95164
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Bump the DWARF version number to 5 on Darwin. (PR #95164)

2024-06-11 Thread Jonas Devlieghere via cfe-commits

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

🥳

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


[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-07 Thread Jonas Devlieghere via cfe-commits


@@ -72,7 +72,7 @@ class PrintFunctionsConsumer : public ASTConsumer {
   *sema.LateParsedTemplateMap.find(FD)->second;
   sema.LateTemplateParser(sema.OpaqueParser, LPT);
   llvm::errs() << "late-parsed-decl: \"" << FD->getNameAsString() << 
"\"\n";
-}   
+}

JDevlieghere wrote:

Unrelated whitespace change?

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


[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-07 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-07 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/94208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-05 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

> 1. Windows support

Windows support is definitely lacking which probably means a bunch of tests 
don't run there. We do have [one 
buildbot](https://lab.llvm.org/buildbot/#/builders/219) that runs on Windows so 
I have a hard time believing it's totally broken. The last runs are 
consistently green and based on the number of tests it seems to still cover a 
remarkable subset of the test suite. 

> 2. Build system does not support Multi-config generators. You can grep for 
> https://cmake.org/cmake/help/latest/variable/CMAKE_CFG_INTDIR.html as an 
> example.

This simply isn't true. Xcode is a multi-config build system and we have [a 
bot](https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake-standalone/)
 that ensures that doesn't break. Maybe there's something different about MSVC? 

> 3. Not all tests pass and it's quite unclear when that is not your fault.

I really sympathize with this one. Most of that's boils down to how much we 
have to rely on the OS and other tools (the compiler, the linker, etc) for our 
integration tests. Having more tests written as unit tests or regression tests 
using `lldb-test` will help with that. I think we (the lldb community) can be 
more vigilant on that front in pushing for those tests. 👍

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


[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-05 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

> But lldb sets itself apart in how hard it is to get a project setup going, 
> and how impactful it is.

Can you elaborate on what specifically you find hard? Building should be fairly 
straightforward, besides Python and SWIG, which are required to run the test, 
most of our dependencies are optional. Unlike the compiler, the debugger is (1) 
tied to the system it's running on, and (2) an interactive tool, so maybe 
that's what you're referring to? Either way, if there are concrete ways we can 
make LLDB easier to work on, I'd love to hear your suggestions!

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


[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-04 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

+1 to what Adrian said. Taht certainly does **not** match my expectations. I'm 
not sure why there would be a different policy for LLDB than for any of the 
other monorepo projects.

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


[clang] [llvm] Enable LLDB tests in pre-merge CI (PR #94208)

2024-06-03 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

This is awesome, thank you for working on this!

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


[clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-28 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

`LLDB_CURSES_LIBS` is scoped to lldbCore, which the EditLine unit test isn't 
linking. If its also necessary in Host, then we should hoist it up and link 
both libraries against it.

Anyway, that also means my initial assessment was wrong. I looked for the 
header include but the code in our editline wrapper forward declares 
`setupterm` which explains why I missed it. Maybe we should reconsider? Anyway, 
if I cannot figure this out in the next hour or so, I think we should revert 
this to get our bots green again. 

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


[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-22 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

The LLDB bots are still failing:

https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/4342/
https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/2244/

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


[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)

2024-05-21 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-21 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

No objections in the context of LLDB. We don't use terminfo directly (although 
I think editline does, but that isn't affected by this) and if we want the TUI 
we depend on curses anyway. 


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


[clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-17 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

> It's a `sed s/== None/is None/g` - what is there to review? 10 separate 
> commits/PRs for the same exact `sed` costs more in commit noise (and effort 
> on the part of @e-kwsm) than one solid, patient, review here.

In addition to what @ftynse said above, the `sed` might not be the right thing 
in the first place (e.g. #91858). 

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


[clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-16 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere commented:

This should really be broken up into separate PRs per subproject. One large PR 
like this makes reviewing harder and causes unnecessary churn in the case that 
this gets reverted.

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


[clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-16 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

I don't think Alex is arguing in favor of keeping the old (wrong) behavior, but 
the first file looks like this:

```
foundSpec = False
if [...]
  foundSpec = True
[...]
if foundSpec is False:
```

It's pretty obvious this is a boolean and should use `if not foundSpec`. 

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


[clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] fix(python): fix invalid escape sequences (PR #91856)

2024-05-14 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere requested changes to this pull request.

As per Aiden's suggestion, please split this up into smaller PRs, grouped by 
subproject. 

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


[clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-14 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

> If this is split out from the other larger PR, should there be `clang/` 
> changes in here?

+1, please unstage the `clang` and `openmp` changes. 

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


[clang] [lld] [llvm] Rename -macosx_version_min to -macos_version_min (PR #88810)

2024-04-24 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

Right, my point is that (I think) that doesn't make sense. AFAIK 
`addMinVersionArgs` is called exclusively from the code snippet I pasted, which 
should check the linker version. The version of `ld` in which this changed is 
much newer than the 520 referenced there. 

I'd start by debugging clang and seeing what the claimed version number is. The 
version is either passed in with `-mlinker-version=` or it's set by CMake 
during configuration (look for `Host linker version: 1234.5`). I bet one of 
these is wrong. 

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


[clang] [lld] [llvm] Rename -macosx_version_min to -macos_version_min (PR #88810)

2024-04-24 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/88810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] Rename -macosx_version_min to -macos_version_min (PR #88810)

2024-04-24 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere requested changes to this pull request.

We should be using `-platform-version` for newer versions of the linker. How 
are we ending up in this code path? 

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


[clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libclc] [libcxx] [libcxxabi] [libunwind] [lld] [lldb] [llvm] [mlir] [openmp] [polly] [pstl] Update IDE Folders (PR #89153)

2024-04-22 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

This looks like a nice improvement for folks using those generators. Even 
though most of these changes look straightforward, it would be a lot easier to 
review if this was broken up per subproject. Is there any reason that's not 
possible? 

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


[clang] [lldb] [llvm] [mlir] [lldb][Core] Remove pointless condition (PR #89480)

2024-04-19 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere requested changes to this pull request.

+1 on what Cyndy said. The lldb change itself looks fine. 

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


[clang-tools-extra] [lldb] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-19 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/89140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [lldb] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-19 Thread Jonas Devlieghere via cfe-commits

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

LLDB & VFS change LGTM.

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


[clang] [lldb] [llvm] [lldb][test] Remove LLDB_TEST_USE_VENDOR_PACKAGES (PR #89260)

2024-04-18 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] NFC: Make clang resource headers an interface library (PR #88317)

2024-04-15 Thread Jonas Devlieghere via cfe-commits

JDevlieghere wrote:

Hey @etcwilde, this breaks the Xcode standalone build for lldb: 
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-standalone/121/
 

The failing command in the generated script phase is:

```
cmake -E copy_directory  
/Users/jonas/llvm/xcode-build/Debug/bin/LLDB.framework/Versions/A/Resources/Clang/include
```

It looks like it's missing the source directly. Mind taking a look?

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


[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Jonas Devlieghere via cfe-commits


@@ -673,6 +673,9 @@ option(LLVM_USE_OPROFILE
 option(LLVM_EXTERNALIZE_DEBUGINFO
   "Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
 
+option(LLVM_ENABLE_EXPORTED_SYMBOLS

JDevlieghere wrote:

@delcypher I was referring to the tools in `/llvm-project/llvm/tools`, which 
use `add_llvm_tool_subdirectory` and `add_llvm_tool` but maybe the distinction 
is more murky than I think it is. I'm also fine with `EXECUTABLE` in the name 👍

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


[clang] [llvm] [driver] Make --version show if assertions, etc. are enabled (PR #87585)

2024-04-04 Thread Jonas Devlieghere via cfe-commits

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

Thanks, this LGTM!

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


[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-04 Thread Jonas Devlieghere via cfe-commits


@@ -673,6 +673,9 @@ option(LLVM_USE_OPROFILE
 option(LLVM_EXTERNALIZE_DEBUGINFO
   "Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
 
+option(LLVM_ENABLE_EXPORTED_SYMBOLS

JDevlieghere wrote:

"tools" has a pretty specific meaning for LLVM so I think that will actually 
cause more confusion (i.e. I would expect that option to apply to 
`llvm-dwarfdump`, but not to `clang`). I'm personally fine with the current 
concise name. 

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


[clang] [clang] Upstream visionOS Availability & DarwinSDKInfo APIs (PR #84279)

2024-03-07 Thread Jonas Devlieghere via cfe-commits

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

LGTM

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


[lldb] [clang-tools-extra] [compiler-rt] [llvm] [clang] [flang] [libc] LLDB Debuginfod usage tests (with fixes) (PR #79181)

2024-01-26 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere commented:

I'm wondering if shell test are really the best way to test this. For more 
complex scenarios like are being tested here, we generally prefer [1] API tests 
because they're more expressive and allow you to build more complicated test 
binaries with our Makefile system. Things like stripping a binary and 
generating split DWARF all seems like things that could be done that way, to 
avoid checking in a (yaml-ized) binary. 

Did you consider/evaluate writing API tests for this? 

[1] https://lldb.llvm.org/resources/test.html



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


[lldb] [clang] [flang] [libc] [llvm] [clang-tools-extra] [compiler-rt] LLDB Debuginfod usage tests (with fixes) (PR #79181)

2024-01-26 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/79181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [flang] [clang] [libc] [lldb] [clang-tools-extra] [llvm] LLDB Debuginfod usage tests (with fixes) (PR #79181)

2024-01-26 Thread Jonas Devlieghere via cfe-commits


@@ -0,0 +1,65 @@
+# Tests for basic Debuginfod functionality
+
+Because the Debuginfod protocol is a simple HTTP path-based system, one can
+mimic a Debuginfod server by setting up a directory structure to reflect the
+protocol properly. That's how all these tests operate. We override the default
+`DEBUGINFOD_URLS` property with a `file://` URL and populate it with the symbol
+files we need for testing.
+
+## What's being tested
+
+- For assumption validation, the `*-no-locator` tests verify that lldb works as
+  the test expects when files that Debuginfod should provide (`.dwp` files,
+  `.gnu.debuglink`'ed files, etc...) are _already_ there.
+- The `*-negative` tests validate that symbols _aren't_ found without
+  Debuginfod, to ensure they haven't been cached from previous runs (in the
+  hopes of preventing false positive testing).
+- The `*-positive*` tests check that the Debuginfod symbol locator is providing
+  the expected symbols when the debugger doesn't already have them available.
+
+### Symbol file variations tested
+
+There are 5 variations of symbol data where Debuginfod provides value:
+
+1. The `strip` build variation is a binary built with debug information (`-g`),
+   but stripped for deployment. The Debuginfod service can then host the
+   unstripped binary (as either `executable` or `debuginfo`).
+2. The `okdstrip` build variation is a binary build with `-g`, stripped for
+   deployment, where the Debuginfod service is hosting the output of
+   `objcopy --only-keep-debug` (which should also be linked to the stripped 
file
+   using `--add-gnu-debuglink`). Again, the file could be hosted as either
+   `executable` or `debuginfo`.
+3. The `split` build variation is a binary built with `-gsplit-dwarf` that
+   produces `.dwo` which are subsequently linked together (using `llvm-dwp`)
+   into a single `.dwp` file. The Debuginfod service hosts the `.dwp` file as
+   `debuginfo`.
+4. The `split-strip` build variation is a binary built with `-gsplit-dwarf`,
+   then stripped in the same manner as variation #1. For this variation,
+   Debuginfod hosts the unstripped binary as `executable` and the `.dwp` file 
as
+   `debuginfo`.
+5. The `split-okdstrip` build variation is the combination of variations 2 and
+   3, where Debuginfod hosts the `.gnu.debuglink`'ed file as `executable` and
+   the `.dwp` as `debuginfo`.
+
+### Lack of clarity/messy capabilities from Debuginfod
+
+The [debuginfod protocol](https://sourceware.org/elfutils/Debuginfod.html) is
+underspecified for some variations of symbol file deployment. The protocol
+itself is quite simple: query an HTTP server with the path
+`buildid/{.note.gnu.build-id hash}/debuginfo` or
+`buildid/{.note.gnu.build-id hash}/executable` to acquire "symbol data" or "the
+executable". Where there is lack of clarity, I prefer requesting `debuginfo`
+first, then falling back to `executable` (Scenarios #1 & #2). For Scenario #5,
+I've chosen to expect the stripped (i.e. not full) executable, which contains a
+number of sections necessary to correctly symbolicate will be hosted from the
+`executable` API. Depending upon how Debuginfod hosting services choose to
+support `.dwp` paired with stripped files, these assumptions may need to be
+revisited.
+
+I've also chosen to simply treat the `.dwp` file as `debuginfo` and the
+"only-keep-debug" stripped binary as `executable`. This scenario doesn't appear
+to work at all in GDB. Supporting it how I did seems more straight forward than
+trying to extend the protocol. The protocol _does_ support querying for section
+contents by name for a given build ID, but adding support for that in LLDB
+looks...well beyond my current capability (and LLVM's Debuginfod library 
doesn't
+support it at this writing, anyway).

JDevlieghere wrote:

Most of this document is written in a passive voice. Let's do the same for this 
section or use "we" (i.e. the developers) instead of "I". 

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


[clang] [clang] Upstream XROS support in Clang (PR #78392)

2024-01-17 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/78392
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [clang-tools-extra] [flang] [llvm] [lldb] [mlir] [clang] [lld] [libcxx] [DWARFLinker][NFC] Decrease DWARFLinker dependence on DwarfStreamer. (PR #77932)

2024-01-17 Thread Jonas Devlieghere via cfe-commits


@@ -30,6 +30,20 @@ using namespace llvm;
 using namespace dwarf_linker;
 using namespace dwarf_linker::classic;
 
+Expected> DwarfStreamer::createStreamer(
+const Triple &TheTriple, DWARFLinkerBase::OutputFileType FileType,
+raw_pwrite_stream &OutFile, DWARFLinkerBase::TranslatorFuncTy Translator,
+DWARFLinkerBase::MessageHandlerTy Warning) {
+  DwarfStreamer *Streamer =
+  new DwarfStreamer(FileType, OutFile, Translator, Warning);
+  if (Error Err = Streamer->init(TheTriple, "__DWARF")) {
+delete Streamer;
+return std::move(Err);
+  }
+
+  return std::unique_ptr(Streamer);

JDevlieghere wrote:

Can we use `make_unique` above and avoid the naked `delete`? 

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


[clang] [flang] [lldb] [lld] [libcxx] [mlir] [compiler-rt] [clang-tools-extra] [llvm] [DWARFLinker][NFC] Decrease DWARFLinker dependence on DwarfStreamer. (PR #77932)

2024-01-17 Thread Jonas Devlieghere via cfe-commits

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

Before this patch, the DWARFLinker was the one responsible for creating the 
streamer, which meant that both the classic and parallel implementation needed 
to conform to the same interface. After this patch, the concrete 
implementations instantiate their own streamer, which means that the classic 
linker can support the Swift sections while the parallel implementation can 
ignore them for now. 

Makes sense to me. LGTM! 

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


[flang] [llvm] [compiler-rt] [lldb] [clang] [libcxx] [mlir] [lld] [clang-tools-extra] [DWARFLinker][NFC] Decrease DWARFLinker dependence on DwarfStreamer. (PR #77932)

2024-01-17 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/77932
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Upstream XROS support in Clang (PR #78392)

2024-01-17 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/78392

>From 52ff81ffbce596fd89b296e7f4199be13f9402ff Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Tue, 16 Jan 2024 20:36:47 -0800
Subject: [PATCH 1/2] [clang] Upstream XROS support in Clang

Upstream XROS support in the clang frontend and driver.
---
 clang/lib/Basic/Targets/OSTargets.h   |  6 +-
 clang/lib/CodeGen/CGObjC.cpp  |  5 ++
 clang/lib/Driver/Driver.cpp   |  1 +
 clang/lib/Driver/ToolChains/Arch/AArch64.cpp  |  5 ++
 clang/lib/Driver/ToolChains/Arch/ARM.cpp  |  5 +-
 clang/lib/Driver/ToolChains/Darwin.cpp| 56 ++-
 clang/lib/Driver/ToolChains/Darwin.h  | 14 -
 .../Checkers/CheckSecuritySyntaxOnly.cpp  |  2 +
 clang/test/Driver/xros-driver.c   | 41 ++
 clang/test/Frontend/xros-version.c|  3 +
 10 files changed, 131 insertions(+), 7 deletions(-)
 create mode 100644 clang/test/Driver/xros-driver.c
 create mode 100644 clang/test/Frontend/xros-version.c

diff --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index 342af4bbc42b7b..4366c1149e4053 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -74,7 +74,8 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 this->TLSSupported = !Triple.isOSVersionLT(3);
 } else if (Triple.isDriverKit()) {
   // No TLS on DriverKit.
-}
+} else if (Triple.isXROS())
+  this->TLSSupported = true;
 
 this->MCountName = "\01mcount";
   }
@@ -109,6 +110,9 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 case llvm::Triple::WatchOS: // Earliest supporting version is 5.0.0.
   MinVersion = llvm::VersionTuple(5U);
   break;
+case llvm::Triple::XROS:
+  MinVersion = llvm::VersionTuple(0);
+  break;
 default:
   // Conservatively return 8 bytes if OS is unknown.
   return 64;
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index acc85165a470be..03fc0ec7ff54e1 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -3941,6 +3941,8 @@ static unsigned getBaseMachOPlatformID(const llvm::Triple 
&TT) {
 return llvm::MachO::PLATFORM_TVOS;
   case llvm::Triple::WatchOS:
 return llvm::MachO::PLATFORM_WATCHOS;
+  case llvm::Triple::XROS:
+return llvm::MachO::PLATFORM_XROS;
   case llvm::Triple::DriverKit:
 return llvm::MachO::PLATFORM_DRIVERKIT;
   default:
@@ -4024,6 +4026,9 @@ static bool isFoundationNeededForDarwinAvailabilityCheck(
   case llvm::Triple::MacOSX:
 FoundationDroppedInVersion = VersionTuple(/*Major=*/10, /*Minor=*/15);
 break;
+  case llvm::Triple::XROS:
+// XROS doesn't need Foundation.
+return false;
   case llvm::Triple::DriverKit:
 // DriverKit doesn't need Foundation.
 return false;
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1889ea28079df1..35d563b9a87fac 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6213,6 +6213,7 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 case llvm::Triple::IOS:
 case llvm::Triple::TvOS:
 case llvm::Triple::WatchOS:
+case llvm::Triple::XROS:
 case llvm::Triple::DriverKit:
   TC = std::make_unique(*this, Target, Args);
   break;
diff --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp 
b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 85f053dc8b6eab..0cf96bb5c9cb02 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -53,6 +53,11 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
 return "apple-m1";
   }
 
+  if (Triple.isXROS()) {
+// The xrOS simulator runs on M1 as well, it should have been covered 
above.
+assert(!Triple.isSimulatorEnvironment() && "xrossim should be mac-like");
+return "apple-a12";
+  }
   // arm64e requires v8.3a and only runs on apple-a12 and later CPUs.
   if (Triple.isArm64e())
 return "apple-a12";
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp 
b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
index 25470db2b6cebd..e6ee2f88a84edf 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -367,6 +367,7 @@ arm::FloatABI arm::getDefaultFloatABI(const llvm::Triple 
&Triple) {
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS:
   case llvm::Triple::DriverKit:
+  case llvm::Triple::XROS:
 // Darwin defaults to "softfp" for v6 and v7.
 if (Triple.isWatchABI())
   return FloatABI::Hard;
@@ -836,8 +837,8 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver 
&D,
 if (A->getOption().matches(options::OPT_mlong_calls))
   Features.push_back("+long-calls");
   } else if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6)) &&
- !Triple.isWatchOS

[clang] [clang] Upstream XROS support in Clang (PR #78392)

2024-01-17 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/78392

>From d7c431e0fbc0ad006b9d37a4e3a43c61ce1f50b7 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Tue, 16 Jan 2024 20:36:47 -0800
Subject: [PATCH] [clang] Upstream XROS support in Clang

Upstream XROS support in the clang frontend and driver.
---
 clang/lib/Basic/Targets/OSTargets.h   |  6 +-
 clang/lib/CodeGen/CGObjC.cpp  |  5 ++
 clang/lib/Driver/Driver.cpp   |  1 +
 clang/lib/Driver/ToolChains/Arch/AArch64.cpp  |  5 ++
 clang/lib/Driver/ToolChains/Arch/ARM.cpp  |  5 +-
 clang/lib/Driver/ToolChains/Darwin.cpp| 56 ++-
 clang/lib/Driver/ToolChains/Darwin.h  | 14 -
 .../Checkers/CheckSecuritySyntaxOnly.cpp  |  2 +
 clang/test/Driver/xros-driver.c   | 41 ++
 clang/test/Frontend/xros-version.c|  3 +
 10 files changed, 131 insertions(+), 7 deletions(-)
 create mode 100644 clang/test/Driver/xros-driver.c
 create mode 100644 clang/test/Frontend/xros-version.c

diff --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index 342af4bbc42b7bc..4366c1149e40530 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -74,7 +74,8 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 this->TLSSupported = !Triple.isOSVersionLT(3);
 } else if (Triple.isDriverKit()) {
   // No TLS on DriverKit.
-}
+} else if (Triple.isXROS())
+  this->TLSSupported = true;
 
 this->MCountName = "\01mcount";
   }
@@ -109,6 +110,9 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 case llvm::Triple::WatchOS: // Earliest supporting version is 5.0.0.
   MinVersion = llvm::VersionTuple(5U);
   break;
+case llvm::Triple::XROS:
+  MinVersion = llvm::VersionTuple(0);
+  break;
 default:
   // Conservatively return 8 bytes if OS is unknown.
   return 64;
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index acc85165a470be7..03fc0ec7ff54e1c 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -3941,6 +3941,8 @@ static unsigned getBaseMachOPlatformID(const llvm::Triple 
&TT) {
 return llvm::MachO::PLATFORM_TVOS;
   case llvm::Triple::WatchOS:
 return llvm::MachO::PLATFORM_WATCHOS;
+  case llvm::Triple::XROS:
+return llvm::MachO::PLATFORM_XROS;
   case llvm::Triple::DriverKit:
 return llvm::MachO::PLATFORM_DRIVERKIT;
   default:
@@ -4024,6 +4026,9 @@ static bool isFoundationNeededForDarwinAvailabilityCheck(
   case llvm::Triple::MacOSX:
 FoundationDroppedInVersion = VersionTuple(/*Major=*/10, /*Minor=*/15);
 break;
+  case llvm::Triple::XROS:
+// XROS doesn't need Foundation.
+return false;
   case llvm::Triple::DriverKit:
 // DriverKit doesn't need Foundation.
 return false;
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1889ea28079df10..35d563b9a87fac4 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6213,6 +6213,7 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 case llvm::Triple::IOS:
 case llvm::Triple::TvOS:
 case llvm::Triple::WatchOS:
+case llvm::Triple::XROS:
 case llvm::Triple::DriverKit:
   TC = std::make_unique(*this, Target, Args);
   break;
diff --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp 
b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 85f053dc8b6eab7..0cf96bb5c9cb02b 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -53,6 +53,11 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
 return "apple-m1";
   }
 
+  if (Triple.isXROS()) {
+// The xrOS simulator runs on M1 as well, it should have been covered 
above.
+assert(!Triple.isSimulatorEnvironment() && "xrossim should be mac-like");
+return "apple-a12";
+  }
   // arm64e requires v8.3a and only runs on apple-a12 and later CPUs.
   if (Triple.isArm64e())
 return "apple-a12";
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp 
b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
index 25470db2b6cebd7..e6ee2f88a84edf2 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -367,6 +367,7 @@ arm::FloatABI arm::getDefaultFloatABI(const llvm::Triple 
&Triple) {
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS:
   case llvm::Triple::DriverKit:
+  case llvm::Triple::XROS:
 // Darwin defaults to "softfp" for v6 and v7.
 if (Triple.isWatchABI())
   return FloatABI::Hard;
@@ -836,8 +837,8 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver 
&D,
 if (A->getOption().matches(options::OPT_mlong_calls))
   Features.push_back("+long-calls");
   } else if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6)) &&
- !Triple.isW

[lldb] [clang] [clang] Upstream XROS support in Clang (PR #78392)

2024-01-17 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/78392

>From 6f6d93b6cc413d54dbdec05f30ede00ffdb4 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Wed, 10 Jan 2024 17:35:47 -0800
Subject: [PATCH 1/2] [lldb] Upstream xros support in lldb

Upstream support for debugging xros applications through LLDB.
---
 lldb/include/lldb/Utility/XcodeSDK.h  |   2 +
 .../Host/macosx/objcxx/HostInfoMacOSX.mm  |   3 +
 .../DynamicLoaderDarwinKernel.cpp |   1 +
 .../MacOSX-DYLD/DynamicLoaderMacOS.cpp|   1 +
 .../MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp   |   1 +
 .../Instruction/ARM/EmulateInstructionARM.cpp |   1 +
 .../ObjectFile/Mach-O/ObjectFileMachO.cpp |  11 +-
 .../Plugins/Platform/MacOSX/CMakeLists.txt|   1 +
 .../MacOSX/PlatformAppleSimulator.cpp |  37 +
 .../Platform/MacOSX/PlatformDarwin.cpp|  17 +-
 .../Platform/MacOSX/PlatformMacOSX.cpp|   3 +
 .../Platform/MacOSX/PlatformRemoteAppleXR.cpp | 157 ++
 .../Platform/MacOSX/PlatformRemoteAppleXR.h   |  38 +
 ...PlatformiOSSimulatorCoreSimulatorSupport.h |   3 +-
 .../Process/MacOSX-Kernel/ProcessKDP.cpp  |   1 +
 .../GDBRemoteCommunicationClient.cpp  |   3 +-
 .../MacOSX/SystemRuntimeMacOSX.cpp|   1 +
 lldb/source/Utility/XcodeSDK.cpp  |  23 +++
 .../debugserver/source/MacOSX/MachProcess.mm  |  12 ++
 lldb/tools/debugserver/source/RNBRemote.cpp   |  11 +-
 lldb/unittests/Utility/XcodeSDKTest.cpp   |  22 +++
 21 files changed, 340 insertions(+), 9 deletions(-)
 create mode 100644 
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleXR.cpp
 create mode 100644 lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleXR.h

diff --git a/lldb/include/lldb/Utility/XcodeSDK.h 
b/lldb/include/lldb/Utility/XcodeSDK.h
index f8528995d549c9..673ea578ffce85 100644
--- a/lldb/include/lldb/Utility/XcodeSDK.h
+++ b/lldb/include/lldb/Utility/XcodeSDK.h
@@ -34,6 +34,8 @@ class XcodeSDK {
 AppleTVOS,
 WatchSimulator,
 watchOS,
+XRSimulator,
+XROS,
 bridgeOS,
 Linux,
 unknown = -1
diff --git a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm 
b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
index 110a01732b2473..f96e2cf80c5fac 100644
--- a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
+++ b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
@@ -276,6 +276,9 @@ static void ParseOSVersion(llvm::VersionTuple &version, 
NSString *Key) {
 #elif defined(TARGET_OS_WATCHOS) && TARGET_OS_WATCHOS == 1
 arch_32.GetTriple().setOS(llvm::Triple::WatchOS);
 arch_64.GetTriple().setOS(llvm::Triple::WatchOS);
+#elif defined(TARGET_OS_XR) && TARGET_OS_XR == 1
+arch_32.GetTriple().setOS(llvm::Triple::XROS);
+arch_64.GetTriple().setOS(llvm::Triple::XROS);
 #elif defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1
 arch_32.GetTriple().setOS(llvm::Triple::MacOSX);
 arch_64.GetTriple().setOS(llvm::Triple::MacOSX);
diff --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 7df917d03ceeda..4128ac1cdf1bba 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -166,6 +166,7 @@ DynamicLoader 
*DynamicLoaderDarwinKernel::CreateInstance(Process *process,
 case llvm::Triple::IOS:
 case llvm::Triple::TvOS:
 case llvm::Triple::WatchOS:
+case llvm::Triple::XROS:
 // NEED_BRIDGEOS_TRIPLE case llvm::Triple::BridgeOS:
   if (triple_ref.getVendor() != llvm::Triple::Apple) {
 return nullptr;
diff --git 
a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp 
b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
index 4451d8c7689a28..261592558095b4 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
@@ -55,6 +55,7 @@ DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process 
*process,
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS:
   case llvm::Triple::WatchOS:
+  case llvm::Triple::XROS:
   // NEED_BRIDGEOS_TRIPLE case llvm::Triple::BridgeOS:
 create = triple_ref.getVendor() == llvm::Triple::Apple;
 break;
diff --git 
a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp 
b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 0bd465aba2d8a2..7e589b0d7af2c7 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -75,6 +75,7 @@ DynamicLoader 
*DynamicLoaderMacOSXDYLD::CreateInstance(Process *process,
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS:
   case

[clang] [clang] Upstream XROS support in Clang (PR #78392)

2024-01-16 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/78392

Upstream XROS support in the clang frontend and driver.

>From 1e65420f87eed1f7f4380496f96eef2560a15cb0 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Tue, 16 Jan 2024 20:36:47 -0800
Subject: [PATCH] [clang] Upstream XROS support in Clang

Upstream XROS support in the clang frontend and driver.
---
 clang/lib/Basic/Targets/OSTargets.h   |  6 ++-
 clang/lib/CodeGen/CGObjC.cpp  |  5 ++
 clang/lib/Driver/Driver.cpp   |  1 +
 clang/lib/Driver/ToolChains/Arch/AArch64.cpp  |  5 ++
 clang/lib/Driver/ToolChains/Arch/ARM.cpp  |  5 +-
 clang/lib/Driver/ToolChains/Darwin.cpp| 49 +--
 clang/lib/Driver/ToolChains/Darwin.h  | 14 +-
 .../Checkers/CheckSecuritySyntaxOnly.cpp  |  2 +
 clang/test/Driver/xros-driver.c   | 41 
 clang/test/Frontend/xros-version.c|  3 ++
 10 files changed, 124 insertions(+), 7 deletions(-)
 create mode 100644 clang/test/Driver/xros-driver.c
 create mode 100644 clang/test/Frontend/xros-version.c

diff --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index 342af4bbc42b7bc..4366c1149e40530 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -74,7 +74,8 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 this->TLSSupported = !Triple.isOSVersionLT(3);
 } else if (Triple.isDriverKit()) {
   // No TLS on DriverKit.
-}
+} else if (Triple.isXROS())
+  this->TLSSupported = true;
 
 this->MCountName = "\01mcount";
   }
@@ -109,6 +110,9 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 case llvm::Triple::WatchOS: // Earliest supporting version is 5.0.0.
   MinVersion = llvm::VersionTuple(5U);
   break;
+case llvm::Triple::XROS:
+  MinVersion = llvm::VersionTuple(0);
+  break;
 default:
   // Conservatively return 8 bytes if OS is unknown.
   return 64;
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index acc85165a470be7..03fc0ec7ff54e1c 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -3941,6 +3941,8 @@ static unsigned getBaseMachOPlatformID(const llvm::Triple 
&TT) {
 return llvm::MachO::PLATFORM_TVOS;
   case llvm::Triple::WatchOS:
 return llvm::MachO::PLATFORM_WATCHOS;
+  case llvm::Triple::XROS:
+return llvm::MachO::PLATFORM_XROS;
   case llvm::Triple::DriverKit:
 return llvm::MachO::PLATFORM_DRIVERKIT;
   default:
@@ -4024,6 +4026,9 @@ static bool isFoundationNeededForDarwinAvailabilityCheck(
   case llvm::Triple::MacOSX:
 FoundationDroppedInVersion = VersionTuple(/*Major=*/10, /*Minor=*/15);
 break;
+  case llvm::Triple::XROS:
+// XROS doesn't need Foundation.
+return false;
   case llvm::Triple::DriverKit:
 // DriverKit doesn't need Foundation.
 return false;
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1889ea28079df10..35d563b9a87fac4 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6213,6 +6213,7 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 case llvm::Triple::IOS:
 case llvm::Triple::TvOS:
 case llvm::Triple::WatchOS:
+case llvm::Triple::XROS:
 case llvm::Triple::DriverKit:
   TC = std::make_unique(*this, Target, Args);
   break;
diff --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp 
b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 912df79417ae21e..e73ffcfa4e343af 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -53,6 +53,11 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
 return "apple-m1";
   }
 
+  if (Triple.isXROS()) {
+// The xrOS simulator runs on M1 as well, it should have been covered 
above.
+assert(!Triple.isSimulatorEnvironment() && "xrossim should be mac-like");
+return "apple-a12";
+  }
   // arm64e requires v8.3a and only runs on apple-a12 and later CPUs.
   if (Triple.isArm64e())
 return "apple-a12";
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp 
b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
index 25470db2b6cebd7..e6ee2f88a84edf2 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -367,6 +367,7 @@ arm::FloatABI arm::getDefaultFloatABI(const llvm::Triple 
&Triple) {
   case llvm::Triple::IOS:
   case llvm::Triple::TvOS:
   case llvm::Triple::DriverKit:
+  case llvm::Triple::XROS:
 // Darwin defaults to "softfp" for v6 and v7.
 if (Triple.isWatchABI())
   return FloatABI::Hard;
@@ -836,8 +837,8 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver 
&D,
 if (A->getOption().matches(options::OPT_mlong_calls))
   Features.push_back("+long-calls");
   } else if (KernelOrKext && (!Triple.is

[llvm] [clang-tools-extra] [lldb] [clang] [lldb][test] Apply @expectedFailureAll/@skipIf early for debug_info tests (PR #73067)

2024-01-08 Thread Jonas Devlieghere via cfe-commits

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


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


[clang] [lldb] [clang-tools-extra] [compiler-rt] [mlir] [llvm] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere requested changes to this pull request.


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


[lldb] [compiler-rt] [llvm] [mlir] [clang-tools-extra] [clang] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Jonas Devlieghere via cfe-commits


@@ -108,13 +108,9 @@ else()
   linux/HostInfoLinux.cpp
   linux/LibcGlue.cpp
   linux/Support.cpp
+  android/HostInfoAndroid.cpp
+  android/LibcGlue.cpp
   )
-if (CMAKE_SYSTEM_NAME MATCHES "Android")

JDevlieghere wrote:

While Android might be Linux, the inverse isn't true. Amongst other things, 
this change would result in all Linux hosts reporting that they support Android 
triples. 

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


[clang] [mlir] [llvm] [compiler-rt] [lldb] [clang-tools-extra] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [LLVM][DWARF] Add support for monolithic types in .debug_names (PR #70512)

2023-10-27 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/70512

>From 1c6a604df93b833c3bb9c7d34f4f27415592dbe5 Mon Sep 17 00:00:00 2001
From: Alexander Yermolovich 
Date: Thu, 5 Oct 2023 12:39:02 -0700
Subject: [PATCH] [LLVM][DWARF] Add support for monolithic types in
 .debug_names

Enable Type Units with DWARF5 accelerator tables for monolithic DWARF.
Implementation relies on linker to tombstone offset in LocalTU list to -1 when
it deduplciates type units using COMDAT.
---
 llvm/include/llvm/CodeGen/AccelTable.h|  64 +--
 llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp| 173 --
 .../lib/CodeGen/AsmPrinter/DwarfCompileUnit.h |   2 +-
 llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp|  37 +++-
 llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h  |  12 +-
 llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp |   4 +
 llvm/lib/CodeGen/AsmPrinter/DwarfFile.h   |  20 ++
 llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp |   6 +
 llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h   |  15 ++
 llvm/lib/DWARFLinker/DWARFStreamer.cpp|  18 +-
 .../DWARFLinkerParallel/DWARFEmitterImpl.cpp  |  13 +-
 .../test/DebugInfo/X86/accel-tables-dwarf5.ll |   1 -
 .../test/DebugInfo/X86/debug-names-dwarf64.ll |   8 +-
 .../X86/debug-names-types-monolithic.ll   | 163 +
 .../DebugInfo/X86/debug-names-types-split.ll  |  57 ++
 .../ARM/dwarf5-dwarf4-combination-macho.test  |  14 +-
 16 files changed, 503 insertions(+), 104 deletions(-)
 create mode 100644 llvm/test/DebugInfo/X86/debug-names-types-monolithic.ll
 create mode 100644 llvm/test/DebugInfo/X86/debug-names-types-split.ll

diff --git a/llvm/include/llvm/CodeGen/AccelTable.h 
b/llvm/include/llvm/CodeGen/AccelTable.h
index d4e21b2ac8e7ebc..d948b7d82b85979 100644
--- a/llvm/include/llvm/CodeGen/AccelTable.h
+++ b/llvm/include/llvm/CodeGen/AccelTable.h
@@ -16,7 +16,6 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
-#include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/CodeGen/DIE.h"
@@ -104,10 +103,13 @@
 namespace llvm {
 
 class AsmPrinter;
-class DwarfCompileUnit;
+class DwarfUnit;
 class DwarfDebug;
+class DwarfTypeUnit;
 class MCSymbol;
 class raw_ostream;
+struct TypeUnitMetaInfo;
+using TUVectorTy = SmallVector;
 
 /// Interface which the different types of accelerator table data have to
 /// conform. It serves as a base class for different values of the template
@@ -197,6 +199,9 @@ template  class AccelTable : public 
AccelTableBase {
 
   template 
   void addName(DwarfStringPoolEntryRef Name, Types &&... Args);
+  void clear() { Entries.clear(); }
+  void addEntries(AccelTable &Table);
+  const StringEntries getEntries() const { return Entries; }
 };
 
 template 
@@ -250,11 +255,21 @@ class AppleAccelTableData : public AccelTableData {
 /// emitDWARF5AccelTable function.
 class DWARF5AccelTableData : public AccelTableData {
 public:
+  struct AttributeEncoding {
+dwarf::Index Index;
+dwarf::Form Form;
+  };
   static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
 
-  DWARF5AccelTableData(const DIE &Die, const DwarfCompileUnit &CU);
-  DWARF5AccelTableData(uint64_t DieOffset, unsigned DieTag, unsigned CUIndex)
-  : OffsetVal(DieOffset), DieTag(DieTag), UnitID(CUIndex) {}
+  DWARF5AccelTableData(const DIE &Die, const DwarfUnit &CU,
+   const bool IsTU = false);
+  DWARF5AccelTableData(const uint64_t DieOffset, const unsigned DieTag,
+   const unsigned Index, const bool IsTU = false)
+  : OffsetVal(DieOffset) {
+Data.DieTag = DieTag;
+Data.UnitID = Index;
+Data.IsTU = IsTU;
+  }
 
 #ifndef NDEBUG
   void print(raw_ostream &OS) const override;
@@ -265,18 +280,25 @@ class DWARF5AccelTableData : public AccelTableData {
"Accessing DIE Offset before normalizing.");
 return std::get(OffsetVal);
   }
-  unsigned getDieTag() const { return DieTag; }
-  unsigned getUnitID() const { return UnitID; }
+  unsigned getDieTag() const { return Data.DieTag; }
+  unsigned getUnitID() const { return Data.UnitID; }
+  bool isTU() const { return Data.IsTU; }
   void normalizeDIEToOffset() {
 assert(std::holds_alternative(OffsetVal) &&
"Accessing offset after normalizing.");
 OffsetVal = std::get(OffsetVal)->getOffset();
   }
+  bool isNormalized() const {
+return std::holds_alternative(OffsetVal);
+  }
 
 protected:
   std::variant OffsetVal;
-  unsigned DieTag;
-  unsigned UnitID;
+  struct MetaData {
+uint32_t DieTag : 16;
+uint32_t UnitID : 15;
+uint32_t IsTU : 1;
+  } Data;
 
   uint64_t order() const override { return getDieOffset(); }
 };
@@ -288,7 +310,19 @@ class DWARF5AccelTable : public 
AccelTable {
   void convertDieToOffset() {
 for (auto &Entry : Entries) {
   for (AccelTableData *Value : Entry.second.Values) {
-static_cast(Value)->norma

[clang] [llvm] Use XMACROS for MachO platforms. (PR #69262)

2023-10-16 Thread Jonas Devlieghere via cfe-commits

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

I like how this centralizes everything in a single place and the def file 
format seems like a natural fit for the platforms. 

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


[clang] [Documentation] Replace recommonmark by myst-parser (PR #65664)

2023-09-08 Thread Jonas Devlieghere via cfe-commits

https://github.com/JDevlieghere review_requested 
https://github.com/llvm/llvm-project/pull/65664
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] fc60bf2 - [DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms

2023-06-14 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2023-06-14T15:28:33-07:00
New Revision: fc60bf2de11149d2c027d63e7ad5a98afa6fab80

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

LOG: [DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms

On Apple platforms, we generate .apple_names, .apple_types,
.apple_namespaces and .apple_objc Apple accelerator tables for DWARF 4
and earlier. For DWARF 5 we should generate .debug_names, but instead we
get no accelerator tables at all.

In the backend we are correctly determining that we should be emitting
.debug_names instead of .apple_names. However, when we get to the point
of emitting the section, if the CU debug name table kind is not
"default", the accelerator table emission is skipped.

This patch sets the DebugNameTableKind to Apple in the frontend when
target an Apple target. That way we know that the CU was compiled with
the intent of emitting accelerator tables. For DWARF 4 and earlier, that
means Apple accelerator tables. For DWARF 5 and later, that means .debug
names.

Differential revision: https://reviews.llvm.org/D118754

Added: 
llvm/test/DebugInfo/Inputs/name-table-kind-apple-4.ll
llvm/test/DebugInfo/Inputs/name-table-kind-apple-5.ll
llvm/test/DebugInfo/accel-tables-apple.ll

Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGen/debug-info-names.c
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/IR/DebugInfoMetadata.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index edef27bdf377c..2fd2227720a2a 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -637,17 +637,21 @@ void CGDebugInfo::CreateCompileUnit() {
   SDK = *It;
   }
 
+  llvm::DICompileUnit::DebugNameTableKind NameTableKind =
+  static_cast(
+  CGOpts.DebugNameTable);
+  if (CGM.getTarget().getTriple().isNVPTX())
+NameTableKind = llvm::DICompileUnit::DebugNameTableKind::None;
+  else if (CGM.getTarget().getTriple().getVendor() == llvm::Triple::Apple)
+NameTableKind = llvm::DICompileUnit::DebugNameTableKind::Apple;
+
   // Create new compile unit.
   TheCU = DBuilder.createCompileUnit(
   LangTag, CUFile, CGOpts.EmitVersionIdentMetadata ? Producer : "",
   LO.Optimize || CGOpts.PrepareForLTO || CGOpts.PrepareForThinLTO,
   CGOpts.DwarfDebugFlags, RuntimeVers, CGOpts.SplitDwarfFile, EmissionKind,
   DwoId, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling,
-  CGM.getTarget().getTriple().isNVPTX()
-  ? llvm::DICompileUnit::DebugNameTableKind::None
-  : static_cast(
-CGOpts.DebugNameTable),
-  CGOpts.DebugRangesBaseAddress, remapDIPath(Sysroot), SDK);
+  NameTableKind, CGOpts.DebugRangesBaseAddress, remapDIPath(Sysroot), SDK);
 }
 
 llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {

diff  --git a/clang/test/CodeGen/debug-info-names.c 
b/clang/test/CodeGen/debug-info-names.c
index 841387d50fd44..a807fb8c06696 100644
--- a/clang/test/CodeGen/debug-info-names.c
+++ b/clang/test/CodeGen/debug-info-names.c
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - -gpubnames | 
FileCheck --check-prefix=DEFAULT %s
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - -ggnu-pubnames 
| FileCheck --check-prefix=GNU %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10.0 -emit-llvm 
-debug-info-kind=limited %s -o - | FileCheck --check-prefix=APPLE %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - -gpubnames | FileCheck --check-prefix=DEFAULT 
%s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - -ggnu-pubnames | FileCheck --check-prefix=GNU 
%s
 
 // CHECK: !DICompileUnit({{.*}}, nameTableKind: None
 // DEFAULT-NOT: !DICompileUnit({{.*}}, nameTableKind:
 // GNU: !DICompileUnit({{.*}}, nameTableKind: GNU
+// APPLE: !DICompileUnit({{.*}}, nameTableKind: Apple
 
 void f1(void) {
 }

diff  --git a/llvm/include/llvm/IR/DebugInfoMetadata.h 
b/llvm/include/llvm/IR/DebugInfoMetadata.h
index defd1d5c2a1ea..6561224052097 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -1377,7 +1377,8 @@ class DICompileUnit : public DIScope {
 Default = 0,
 GNU = 1,
 None = 2,
-LastDebugNameTableKind = None
+Apple = 3,
+LastDebugNameTableKind = Apple
   };
 
   

[clang] 04c0161 - Revert "[DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms"

2023-06-14 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2023-06-14T14:16:16-07:00
New Revision: 04c0161c027676119fdc617f5b883dbda97c8549

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

LOG: Revert "[DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple 
platforms"

This reverts commit e0d57295bf6a3c04f2901d9c70f529d570f48b65 because the
accel-tables-apple.ll test is failing on a few buildbots.

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGen/debug-info-names.c
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/IR/DebugInfoMetadata.cpp

Removed: 
llvm/test/DebugInfo/Inputs/name-table-kind-apple-4.ll
llvm/test/DebugInfo/Inputs/name-table-kind-apple-5.ll
llvm/test/DebugInfo/accel-tables-apple.ll



diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 2fd2227720a2a..edef27bdf377c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -637,21 +637,17 @@ void CGDebugInfo::CreateCompileUnit() {
   SDK = *It;
   }
 
-  llvm::DICompileUnit::DebugNameTableKind NameTableKind =
-  static_cast(
-  CGOpts.DebugNameTable);
-  if (CGM.getTarget().getTriple().isNVPTX())
-NameTableKind = llvm::DICompileUnit::DebugNameTableKind::None;
-  else if (CGM.getTarget().getTriple().getVendor() == llvm::Triple::Apple)
-NameTableKind = llvm::DICompileUnit::DebugNameTableKind::Apple;
-
   // Create new compile unit.
   TheCU = DBuilder.createCompileUnit(
   LangTag, CUFile, CGOpts.EmitVersionIdentMetadata ? Producer : "",
   LO.Optimize || CGOpts.PrepareForLTO || CGOpts.PrepareForThinLTO,
   CGOpts.DwarfDebugFlags, RuntimeVers, CGOpts.SplitDwarfFile, EmissionKind,
   DwoId, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling,
-  NameTableKind, CGOpts.DebugRangesBaseAddress, remapDIPath(Sysroot), SDK);
+  CGM.getTarget().getTriple().isNVPTX()
+  ? llvm::DICompileUnit::DebugNameTableKind::None
+  : static_cast(
+CGOpts.DebugNameTable),
+  CGOpts.DebugRangesBaseAddress, remapDIPath(Sysroot), SDK);
 }
 
 llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {

diff  --git a/clang/test/CodeGen/debug-info-names.c 
b/clang/test/CodeGen/debug-info-names.c
index a807fb8c06696..841387d50fd44 100644
--- a/clang/test/CodeGen/debug-info-names.c
+++ b/clang/test/CodeGen/debug-info-names.c
@@ -1,12 +1,10 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10.0 -emit-llvm 
-debug-info-kind=limited %s -o - | FileCheck --check-prefix=APPLE %s
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - -gpubnames | FileCheck --check-prefix=DEFAULT 
%s
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - -ggnu-pubnames | FileCheck --check-prefix=GNU 
%s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - -gpubnames | 
FileCheck --check-prefix=DEFAULT %s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - -ggnu-pubnames 
| FileCheck --check-prefix=GNU %s
 
 // CHECK: !DICompileUnit({{.*}}, nameTableKind: None
 // DEFAULT-NOT: !DICompileUnit({{.*}}, nameTableKind:
 // GNU: !DICompileUnit({{.*}}, nameTableKind: GNU
-// APPLE: !DICompileUnit({{.*}}, nameTableKind: Apple
 
 void f1(void) {
 }

diff  --git a/llvm/include/llvm/IR/DebugInfoMetadata.h 
b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 6561224052097..defd1d5c2a1ea 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -1377,8 +1377,7 @@ class DICompileUnit : public DIScope {
 Default = 0,
 GNU = 1,
 None = 2,
-Apple = 3,
-LastDebugNameTableKind = Apple
+LastDebugNameTableKind = None
   };
 
   static std::optional getEmissionKind(StringRef Str);

diff  --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 7568fd43e1d08..23a7b4481110c 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -944,8 +944,7 @@ lltok::Kind LLLexer::LexIdentifier() {
 return lltok::EmissionKind;
   }
 
-  if (Keyword == "GNU" || Keyword == "Apple" || Keyword == "None" ||
-  Keyword == "Default") {
+  if (Keyword == "GNU" || Keyword == "None" || Keyword == "Default") {
 StrVal.assign(Keyword.begin(), Keyword.end());
 return lltok::NameTableKind;
   }

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AccelTable

[clang] e0d5729 - [DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms

2023-06-14 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2023-06-14T13:03:31-07:00
New Revision: e0d57295bf6a3c04f2901d9c70f529d570f48b65

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

LOG: [DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms

On Apple platforms, we generate .apple_names, .apple_types,
.apple_namespaces and .apple_objc Apple accelerator tables for DWARF 4
and earlier. For DWARF 5 we should generate .debug_names, but instead we
get no accelerator tables at all.

In the backend we are correctly determining that we should be emitting
.debug_names instead of .apple_names. However, when we get to the point
of emitting the section, if the CU debug name table kind is not
"default", the accelerator table emission is skipped.

This patch sets the DebugNameTableKind to Apple in the frontend when
target an Apple target. That way we know that the CU was compiled with
the intent of emitting accelerator tables. For DWARF 4 and earlier, that
means Apple accelerator tables. For DWARF 5 and later, that means .debug
names.

Differential revision: https://reviews.llvm.org/D118754

Added: 
llvm/test/DebugInfo/Inputs/name-table-kind-apple-4.ll
llvm/test/DebugInfo/Inputs/name-table-kind-apple-5.ll
llvm/test/DebugInfo/accel-tables-apple.ll

Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGen/debug-info-names.c
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/IR/DebugInfoMetadata.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index edef27bdf377c..2fd2227720a2a 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -637,17 +637,21 @@ void CGDebugInfo::CreateCompileUnit() {
   SDK = *It;
   }
 
+  llvm::DICompileUnit::DebugNameTableKind NameTableKind =
+  static_cast(
+  CGOpts.DebugNameTable);
+  if (CGM.getTarget().getTriple().isNVPTX())
+NameTableKind = llvm::DICompileUnit::DebugNameTableKind::None;
+  else if (CGM.getTarget().getTriple().getVendor() == llvm::Triple::Apple)
+NameTableKind = llvm::DICompileUnit::DebugNameTableKind::Apple;
+
   // Create new compile unit.
   TheCU = DBuilder.createCompileUnit(
   LangTag, CUFile, CGOpts.EmitVersionIdentMetadata ? Producer : "",
   LO.Optimize || CGOpts.PrepareForLTO || CGOpts.PrepareForThinLTO,
   CGOpts.DwarfDebugFlags, RuntimeVers, CGOpts.SplitDwarfFile, EmissionKind,
   DwoId, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling,
-  CGM.getTarget().getTriple().isNVPTX()
-  ? llvm::DICompileUnit::DebugNameTableKind::None
-  : static_cast(
-CGOpts.DebugNameTable),
-  CGOpts.DebugRangesBaseAddress, remapDIPath(Sysroot), SDK);
+  NameTableKind, CGOpts.DebugRangesBaseAddress, remapDIPath(Sysroot), SDK);
 }
 
 llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {

diff  --git a/clang/test/CodeGen/debug-info-names.c 
b/clang/test/CodeGen/debug-info-names.c
index 841387d50fd44..a807fb8c06696 100644
--- a/clang/test/CodeGen/debug-info-names.c
+++ b/clang/test/CodeGen/debug-info-names.c
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - -gpubnames | 
FileCheck --check-prefix=DEFAULT %s
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - -ggnu-pubnames 
| FileCheck --check-prefix=GNU %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10.0 -emit-llvm 
-debug-info-kind=limited %s -o - | FileCheck --check-prefix=APPLE %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - -gpubnames | FileCheck --check-prefix=DEFAULT 
%s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -emit-llvm 
-debug-info-kind=limited %s -o - -ggnu-pubnames | FileCheck --check-prefix=GNU 
%s
 
 // CHECK: !DICompileUnit({{.*}}, nameTableKind: None
 // DEFAULT-NOT: !DICompileUnit({{.*}}, nameTableKind:
 // GNU: !DICompileUnit({{.*}}, nameTableKind: GNU
+// APPLE: !DICompileUnit({{.*}}, nameTableKind: Apple
 
 void f1(void) {
 }

diff  --git a/llvm/include/llvm/IR/DebugInfoMetadata.h 
b/llvm/include/llvm/IR/DebugInfoMetadata.h
index defd1d5c2a1ea..6561224052097 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -1377,7 +1377,8 @@ class DICompileUnit : public DIScope {
 Default = 0,
 GNU = 1,
 None = 2,
-LastDebugNameTableKind = None
+Apple = 3,
+LastDebugNameTableKind = Apple
   };
 
   

[clang] 97b9130 - [clang] Disable assertion that can "easily happen"

2022-10-19 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2022-10-19T15:08:56-07:00
New Revision: 97b91307b00e958bc1d511c93a8a6bef510485ac

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

LOG: [clang] Disable assertion that can "easily happen"

Disable the assertion for getting a module ID for non-local,
non-imported module. According to the FIXME this can "easily happen" and
indeed, we're hitting this assertion regularly. Disable it until it can
be properly investigated.

rdar://99352728

Differential revision: https://reviews.llvm.org/D136290

Added: 


Modified: 
clang/lib/Serialization/ASTWriter.cpp

Removed: 




diff  --git a/clang/lib/Serialization/ASTWriter.cpp 
b/clang/lib/Serialization/ASTWriter.cpp
index 6bfbf0b57f5b8..4dcc5ee0a1c86 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -2669,12 +2669,12 @@ unsigned ASTWriter::getLocalOrImportedSubmoduleID(const 
Module *Mod) {
 }
 
 unsigned ASTWriter::getSubmoduleID(Module *Mod) {
+  unsigned ID = getLocalOrImportedSubmoduleID(Mod);
   // FIXME: This can easily happen, if we have a reference to a submodule that
   // did not result in us loading a module file for that submodule. For
   // instance, a cross-top-level-module 'conflict' declaration will hit this.
-  unsigned ID = getLocalOrImportedSubmoduleID(Mod);
-  assert((ID || !Mod) &&
- "asked for module ID for non-local, non-imported module");
+  // assert((ID || !Mod) &&
+  //"asked for module ID for non-local, non-imported module");
   return ID;
 }
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] a262f4d - Revert "[Clang] Add a warning on invalid UTF-8 in comments."

2022-07-12 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2022-07-12T15:22:29-07:00
New Revision: a262f4dbd78fc68609d230f3e9c5ca2b1d1d9437

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

LOG: Revert "[Clang] Add a warning on invalid UTF-8 in comments."

This reverts commit cc309721d20c8e544ae7a10a66735ccf4981a11c because it
breaks the following tests on GreenDragon:

  TestDataFormatterObjCCF.py
  TestDataFormatterObjCExpr.py
  TestDataFormatterObjCKVO.py
  TestDataFormatterObjCNSBundle.py
  TestDataFormatterObjCNSData.py
  TestDataFormatterObjCNSError.py
  TestDataFormatterObjCNSNumber.py
  TestDataFormatterObjCNSURL.py
  TestDataFormatterObjCPlain.py
  TestDataFormatterObjNSException.py

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/45288/

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/lib/Lex/Lexer.cpp
clang/test/SemaCXX/static-assert.cpp
llvm/include/llvm/Support/ConvertUTF.h
llvm/lib/Support/ConvertUTF.cpp

Removed: 
clang/test/Lexer/comment-invalid-utf8.c
clang/test/Lexer/comment-utf8.c



diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index f8977d5ac720b..e09a4a7c91b78 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -284,11 +284,9 @@ Improvements to Clang's diagnostics
   unevaluated operands of a ``typeid`` expression, as they are now
   modeled correctly in the CFG. This fixes
   `Issue 21668 `_.
-- ``-Wself-assign``, ``-Wself-assign-overloaded`` and ``-Wself-move`` will
+- ``-Wself-assign``, ``-Wself-assign-overloaded`` and ``-Wself-move`` will 
   suggest a fix if the decl being assigned is a parameter that shadows a data
   member of the contained class.
-- Added ``-Winvalid-utf8`` which diagnoses invalid UTF-8 code unit sequences in
-  comments.
 
 Non-comprehensive list of changes in this release
 -
@@ -615,7 +613,7 @@ AST Matchers
 
 - Added ``forEachTemplateArgument`` matcher which creates a match every
   time a ``templateArgument`` matches the matcher supplied to it.
-
+  
 - Added ``objcStringLiteral`` matcher which matches ObjectiveC String
   literal expressions.
 

diff  --git a/clang/include/clang/Basic/DiagnosticLexKinds.td 
b/clang/include/clang/Basic/DiagnosticLexKinds.td
index 38ee022e5f04c..ac86076140c58 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -113,8 +113,6 @@ def warn_four_char_character_literal : Warning<
 // Unicode and UCNs
 def err_invalid_utf8 : Error<
   "source file is not valid UTF-8">;
-def warn_invalid_utf8_in_comment : Extension<
-  "invalid UTF-8 in comment">, InGroup>;
 def err_character_not_allowed : Error<
   "unexpected character ">;
 def err_character_not_allowed_identifier : Error<

diff  --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 221ec2721fe00..6820057642bea 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -2392,37 +2392,13 @@ bool Lexer::SkipLineComment(Token &Result, const char 
*CurPtr,
   //
   // This loop terminates with CurPtr pointing at the newline (or end of 
buffer)
   // character that ends the line comment.
-
-  // C++23 [lex.phases] p1
-  // Diagnose invalid UTF-8 if the corresponding warning is enabled, emitting a
-  // diagnostic only once per entire ill-formed subsequence to avoid
-  // emiting to many diagnostics (see http://unicode.org/review/pr-121.html).
-  bool UnicodeDecodingAlreadyDiagnosed = false;
-
   char C;
   while (true) {
 C = *CurPtr;
 // Skip over characters in the fast loop.
-while (isASCII(C) && C != 0 &&   // Potentially EOF.
-   C != '\n' && C != '\r') { // Newline or DOS-style newline.
+while (C != 0 &&// Potentially EOF.
+   C != '\n' && C != '\r')  // Newline or DOS-style newline.
   C = *++CurPtr;
-  UnicodeDecodingAlreadyDiagnosed = false;
-}
-
-if (!isASCII(C)) {
-  unsigned Length = llvm::getUTF8SequenceSize(
-  (const llvm::UTF8 *)CurPtr, (const llvm::UTF8 *)BufferEnd);
-  if (Length == 0) {
-if (!UnicodeDecodingAlreadyDiagnosed && !isLexingRawMode())
-  Diag(CurPtr, diag::warn_invalid_utf8_in_comment);
-UnicodeDecodingAlreadyDiagnosed = true;
-++CurPtr;
-  } else {
-UnicodeDecodingAlreadyDiagnosed = false;
-CurPtr += Length;
-  }
-  continue;
-}
 
 const char *NextLine = CurPtr;
 if (C != 0) {
@@ -2689,12 +2665,6 @@ bool Lexer::SkipBlockComment(Token &Result, const char 
*CurPtr,
   if (C == '/')
 C = *CurPtr++;
 
-  // C++23 [lex.phases] p1
-  // Diagnose invalid UTF-8 if the corresponding warn

[clang] c7fd751 - Revert "[C++20][Modules] Update handling of implicit inlines [P1779R3]"

2022-07-11 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2022-07-11T13:59:41-07:00
New Revision: c7fd7512a5c5b133665bfecbe2e9748c0607286e

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

LOG: Revert "[C++20][Modules] Update handling of implicit inlines [P1779R3]"

This reverts commit ef0fa9f0ef3e as a follow up to b19d3ee7120b which
reverted commit ac507102d258. See https://reviews.llvm.org/D126189 for
more details.

Added: 


Modified: 
clang/lib/AST/TextNodeDumper.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/AST/ast-dump-constant-expr.cpp
clang/test/AST/ast-dump-lambda.cpp

Removed: 
clang/test/CXX/class/class.friend/p7-cxx20.cpp
clang/test/CXX/class/class.mfct/p1-cxx20.cpp



diff  --git a/clang/lib/AST/TextNodeDumper.cpp 
b/clang/lib/AST/TextNodeDumper.cpp
index 22643d4edbecb..79e9fa6ab86fc 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -1720,9 +1720,6 @@ void TextNodeDumper::VisitFunctionDecl(const FunctionDecl 
*D) {
 }
   }
 
-  if (!D->isInlineSpecified() && D->isInlined()) {
-OS << " implicit-inline";
-  }
   // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
   // the Params are set later, it is possible for a dump during debugging to
   // encounter a FunctionDecl that has been created but hasn't been assigned

diff  --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c5005accc6961..927d81826425b 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9405,25 +9405,15 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, 
DeclContext *DC,
 NewFD->setLocalExternDecl();
 
   if (getLangOpts().CPlusPlus) {
-// The rules for implicit inlines changed in C++20 for methods and friends
-// with an in-class definition (when such a definition is not attached to
-// the global module).  User-specified 'inline' overrides this (set when
-// the function decl is created above).
-bool ImplicitInlineCXX20 = !getLangOpts().CPlusPlus20 ||
-   !NewFD->getOwningModule() ||
-   NewFD->getOwningModule()->isGlobalModule();
 bool isInline = D.getDeclSpec().isInlineSpecified();
 bool isVirtual = D.getDeclSpec().isVirtualSpecified();
 bool hasExplicit = D.getDeclSpec().hasExplicitSpecifier();
 isFriend = D.getDeclSpec().isFriendSpecified();
 if (isFriend && !isInline && D.isFunctionDefinition()) {
-  // Pre-C++20 [class.friend]p5
+  // C++ [class.friend]p5
   //   A function can be defined in a friend declaration of a
   //   class . . . . Such a function is implicitly inline.
-  // Post C++20 [class.friend]p7
-  //   Such a function is implicitly an inline function if it is attached
-  //   to the global module.
-  NewFD->setImplicitlyInline(ImplicitInlineCXX20);
+  NewFD->setImplicitlyInline();
 }
 
 // If this is a method defined in an __interface, and is not a constructor
@@ -9706,14 +9696,11 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, 
DeclContext *DC,
 }
 
 if (isa(NewFD) && DC == CurContext &&
-D.isFunctionDefinition() && !isInline) {
-  // Pre C++20 [class.mfct]p2:
+D.isFunctionDefinition()) {
+  // C++ [class.mfct]p2:
   //   A member function may be defined (8.4) in its class definition, in
   //   which case it is an inline member function (7.1.2)
-  // Post C++20 [class.mfct]p1:
-  //   If a member function is attached to the global module and is defined
-  //   in its class definition, it is inline.
-  NewFD->setImplicitlyInline(ImplicitInlineCXX20);
+  NewFD->setImplicitlyInline();
 }
 
 if (SC == SC_Static && isa(NewFD) &&

diff  --git a/clang/test/AST/ast-dump-constant-expr.cpp 
b/clang/test/AST/ast-dump-constant-expr.cpp
index 302f562eadd96..79cdfc639af5b 100644
--- a/clang/test/AST/ast-dump-constant-expr.cpp
+++ b/clang/test/AST/ast-dump-constant-expr.cpp
@@ -58,7 +58,7 @@ struct Test {
 
 // CHECK:Dumping Test:
 // CHECK-NEXT:CXXRecordDecl {{.*}} <{{.*}}ast-dump-constant-expr.cpp:43:1, 
line:57:1> line:43:8 struct Test definition
-// CHECK:|-CXXMethodDecl {{.*}}  line:44:8 test 'void 
()' implicit-inline
+// CHECK:|-CXXMethodDecl {{.*}}  line:44:8 test 'void ()'
 // CHECK-NEXT:| `-CompoundStmt {{.*}} 
 // CHECK-NEXT:|   |-CStyleCastExpr {{.*}}  'void' 
 // CHECK-NEXT:|   | `-ConstantExpr {{.*}}  'int'
@@ -90,4 +90,4 @@ struct Test {
 // CHECK-NEXT:|   `-CallExpr {{.*}}  '__int128'
 // CHECK-NEXT:| `-ImplicitCastExpr {{.*}}  '__int128 (*)()' 

 // CHECK-NEXT:|   `-DeclRefExpr {{.*}}  '__int128 ()' lvalue 
Function {{.*}} 'test_Int128' '__int128 ()'
-// CHECK-NEXT:`-CXXMethodDecl {{.*}}  col:18 consteval 
consteval_method 'vo

[clang] df6fcef - Fix the implicit module build (2/2)

2022-03-14 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2022-03-14T09:43:13-07:00
New Revision: df6fcef2b8330afd08a3c76e6a01cb5ada6b1aa9

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

LOG: Fix the implicit module build (2/2)

This fixes the implicit module build after b1b4b6f36695 broke the LLDB
build: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/42084/

My previous commit didn't have the modulemap change staged.

Added: 


Modified: 
clang/include/clang/module.modulemap

Removed: 




diff  --git a/clang/include/clang/module.modulemap 
b/clang/include/clang/module.modulemap
index 981f32aa25a10..aca4d5ab919a0 100644
--- a/clang/include/clang/module.modulemap
+++ b/clang/include/clang/module.modulemap
@@ -51,6 +51,7 @@ module Clang_Basic {
   textual header "Basic/BuiltinsSVE.def"
   textual header "Basic/BuiltinsSystemZ.def"
   textual header "Basic/BuiltinsVE.def"
+  textual header "Basic/BuiltinsVEVL.gen.def"
   textual header "Basic/BuiltinsWebAssembly.def"
   textual header "Basic/BuiltinsX86.def"
   textual header "Basic/BuiltinsX86_64.def"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] f51d7e4 - Fix the implicit module build

2022-03-14 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2022-03-14T09:24:17-07:00
New Revision: f51d7e4bae9e861e711ad9711599456fc2f1bbca

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

LOG: Fix the implicit module build

This fixes the implicit module build after b1b4b6f36695 broke the LLDB
build: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/42084/

Added: 


Modified: 
clang/include/clang/Basic/BuiltinsVE.def
llvm/include/llvm/CodeGen/MachinePipeliner.h

Removed: 




diff  --git a/clang/include/clang/Basic/BuiltinsVE.def 
b/clang/include/clang/Basic/BuiltinsVE.def
index 1cb5250893819..29b2bd203ef0f 100644
--- a/clang/include/clang/Basic/BuiltinsVE.def
+++ b/clang/include/clang/Basic/BuiltinsVE.def
@@ -11,7 +11,12 @@
 //
 
//===--===//
 
+#if defined(BUILTIN) && !defined(TARGET_BUILTIN)
+#   define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS)
+#endif
+
 // Use generated BUILTIN definitions
 #include "clang/Basic/BuiltinsVEVL.gen.def"
 
 #undef BUILTIN
+#undef TARGET_BUILTIN

diff  --git a/llvm/include/llvm/CodeGen/MachinePipeliner.h 
b/llvm/include/llvm/CodeGen/MachinePipeliner.h
index 7e7fa57d80da6..63024562bd2d3 100644
--- a/llvm/include/llvm/CodeGen/MachinePipeliner.h
+++ b/llvm/include/llvm/CodeGen/MachinePipeliner.h
@@ -40,6 +40,7 @@
 #ifndef LLVM_CODEGEN_MACHINEPIPELINER_H
 #define LLVM_CODEGEN_MACHINEPIPELINER_H
 
+#include "llvm/ADT/SetVector.h"
 #include "llvm/CodeGen/MachineDominators.h"
 #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
 #include "llvm/CodeGen/RegisterClassInfo.h"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 4cb7929 - Revert "[clang][DebugInfo] Allow function-local statics and types to be scoped within a lexical block"

2021-12-06 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2021-12-06T09:34:53-08:00
New Revision: 4cb79294e8df8c91ae15264d1014361815d34a53

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

LOG: Revert "[clang][DebugInfo] Allow function-local statics and types to be 
scoped within a lexical block"

This reverts commit e403f4fdc88322201040f2bee7b328e8a78e2f7f because it
breaks TestSetData.py on GreenDragon:

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/39089/

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/lib/CodeGen/CGDecl.cpp

Removed: 
clang/test/CodeGenCXX/debug-info-lexcial-block.cpp



diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 75eec22e4e4e5..af651e6f44b7c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -227,20 +227,6 @@ llvm::DIScope *CGDebugInfo::getContextDescriptor(const 
Decl *Context,
   return Default;
 }
 
-void CGDebugInfo::recordDeclarationLexicalScope(const Decl &D) {
-  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&
- "D is already mapped to a lexical block scope");
-  if (!LexicalBlockStack.empty())
-LexicalBlockMap.insert({&D, LexicalBlockStack.back()});
-}
-
-llvm::DIScope *CGDebugInfo::getDeclarationLexicalScope(const Decl *D) {
-  auto I = LexicalBlockMap.find(D);
-  if (I != LexicalBlockMap.end())
-return I->second;
-  return getDeclContextDescriptor(cast(D));
-}
-
 PrintingPolicy CGDebugInfo::getPrintingPolicy() const {
   PrintingPolicy PP = CGM.getContext().getPrintingPolicy();
 
@@ -1360,13 +1346,13 @@ llvm::DIType *CGDebugInfo::CreateType(const TypedefType 
*Ty,
   // declared.
   SourceLocation Loc = Ty->getDecl()->getLocation();
 
-  llvm::DIScope *TDContext = getDeclarationLexicalScope(Ty->getDecl());
   uint32_t Align = getDeclAlignIfRequired(Ty->getDecl(), CGM.getContext());
   // Typedefs are derived from some other type.
   llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(Ty->getDecl());
   return DBuilder.createTypedef(Underlying, Ty->getDecl()->getName(),
 getOrCreateFile(Loc), getLineNumber(Loc),
-TDContext, Align, Annotations);
+getDeclContextDescriptor(Ty->getDecl()), Align,
+Annotations);
 }
 
 static unsigned getDwarfCC(CallingConv CC) {
@@ -3265,7 +3251,7 @@ llvm::DIType *CGDebugInfo::CreateEnumType(const EnumType 
*Ty) {
 // entered into the ReplaceMap: finalize() will replace the first
 // FwdDecl with the second and then replace the second with
 // complete type.
-llvm::DIScope *EDContext = getDeclarationLexicalScope(ED);
+llvm::DIScope *EDContext = getDeclContextDescriptor(ED);
 llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
 llvm::TempDIScope TmpContext(DBuilder.createReplaceableCompositeType(
 llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0));
@@ -3308,7 +3294,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const 
EnumType *Ty) {
 
   llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
   unsigned Line = getLineNumber(ED->getLocation());
-  llvm::DIScope *EnumContext = getDeclarationLexicalScope(ED);
+  llvm::DIScope *EnumContext = getDeclContextDescriptor(ED);
   llvm::DIType *ClassTy = getOrCreateType(ED->getIntegerType(), DefUnit);
   return DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit,
 Line, Size, Align, EltArray, ClassTy,
@@ -3611,7 +3597,7 @@ llvm::DICompositeType 
*CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
 Line = getLineNumber(Loc);
   }
 
-  llvm::DIScope *RDContext = getDeclarationLexicalScope(RD);
+  llvm::DIScope *RDContext = getDeclContextDescriptor(RD);
 
   // If we ended up creating the type during the context chain construction,
   // just return that.
@@ -3804,14 +3790,6 @@ void CGDebugInfo::collectVarDeclProps(const VarDecl *VD, 
llvm::DIFile *&Unit,
 TemplateParameters = nullptr;
   }
 
-  // Get context for static locals (that are technically globals) the same way
-  // we do for "local" locals -- by using current lexical block.
-  if (VD->isStaticLocal()) {
-assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack 
empty!");
-VDContext = LexicalBlockStack.back();
-return;
-  }
-
   // Since we emit declarations (DW_AT_members) for static members, place the
   // definition of those static members in the namespace they were declared in
   // in the source code (the lexical decl context).

diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 1350ee6808cc2..a7b72fa5f5a65 100644
--- a/clang/lib/CodeGen/CGDebu

[clang] 6331680 - Re-land "[Driver] Support default libc++ library location on Darwin"

2021-04-21 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2021-04-21T14:22:13-07:00
New Revision: 6331680ad2ad000fdaf7e72f3c1880c7908ffa25

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

LOG: Re-land "[Driver] Support default libc++ library location on Darwin"

This reverts commit 05eeed9691aeb3e0316712195b998e9078cdceb0 and after
fixing the impacted lldb tests in 5d1c43f333c2327be61604dc90ea675f0d1e6913.

  [Driver] Support default libc++ library location on Darwin

  Darwin driver currently uses libc++ headers that are part of Clang
  toolchain when available (by default ../include/c++/v1 relative to
  executable), but it completely ignores the libc++ library itself
  because it doesn't pass the location of libc++ library that's part
  of Clang (by default ../lib relative to the exceutable) to the linker
  always using the system copy of libc++.

  This may lead to subtle issues when the compilation fails because the
  headers that are part of Clang toolchain are incompatible with the
  system library. Either the driver should ignore both headers as well as
  the library, or it should always try to use both when available.

  This patch changes the driver behavior to do the latter which seems more
  reasonable, it makes it easy to test and use custom libc++ build on
  Darwin while still allowing the use of system version. This also matches
  the Clang driver behavior on other systems.

  Differential Revision: https://reviews.llvm.org/D45639

Added: 


Modified: 
clang/lib/Driver/ToolChains/Darwin.cpp
clang/test/Driver/darwin-ld.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Darwin.cpp 
b/clang/lib/Driver/ToolChains/Darwin.cpp
index bc59b6beafc7..06d4f2f4df0b 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -615,6 +615,8 @@ void darwin::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
 
   Args.AddAllArgs(CmdArgs, options::OPT_L);
 
+  getToolChain().AddFilePathLibArgs(Args, CmdArgs);
+
   AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
   // Build the input file for -filelist (list of linker input files) in case we
   // need it later
@@ -802,6 +804,7 @@ MachO::MachO(const Driver &D, const llvm::Triple &Triple, 
const ArgList &Args)
   getProgramPaths().push_back(getDriver().getInstalledDir());
   if (getDriver().getInstalledDir() != getDriver().Dir)
 getProgramPaths().push_back(getDriver().Dir);
+  getFilePaths().push_back(getDriver().Dir + "/../lib");
 }
 
 /// Darwin - Darwin tool chain for i386 and x86_64.

diff  --git a/clang/test/Driver/darwin-ld.c b/clang/test/Driver/darwin-ld.c
index 15e5d100afcb..9fe68f1821c9 100644
--- a/clang/test/Driver/darwin-ld.c
+++ b/clang/test/Driver/darwin-ld.c
@@ -365,3 +365,7 @@
 // RUN: FileCheck -check-prefix=MNO_OUTLINE %s < %t.log
 // MNO_OUTLINE: {{ld(.exe)?"}}
 // MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never"
+
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=INSTALL-DIR %s < %t.log
+// INSTALL-DIR: "-L{{.*}}{{/|}}..{{/|}}lib"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 05eeed9 - Revert "[Driver] Support default libc++ library location on Darwin"

2021-04-20 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2021-04-20T20:42:50-07:00
New Revision: 05eeed9691aeb3e0316712195b998e9078cdceb0

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

LOG: Revert "[Driver] Support default libc++ library location on Darwin"

This reverts the following commits because it breaks
TestAppleSimulatorOSType.py on GreenDragon [1].

caff17e503fe81d69e90dd69b14f5149659f9db4
f5efe0aa048b2bd3363b3a53efe9ae7367244801
ae8b2cab67408a043a4fe964d16e4803553c4ee0

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/31346/

Added: 


Modified: 
clang/lib/Driver/ToolChains/Darwin.cpp
clang/test/Driver/darwin-ld.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Darwin.cpp 
b/clang/lib/Driver/ToolChains/Darwin.cpp
index 06d4f2f4df0bc..bc59b6beafc78 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -615,8 +615,6 @@ void darwin::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
 
   Args.AddAllArgs(CmdArgs, options::OPT_L);
 
-  getToolChain().AddFilePathLibArgs(Args, CmdArgs);
-
   AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
   // Build the input file for -filelist (list of linker input files) in case we
   // need it later
@@ -804,7 +802,6 @@ MachO::MachO(const Driver &D, const llvm::Triple &Triple, 
const ArgList &Args)
   getProgramPaths().push_back(getDriver().getInstalledDir());
   if (getDriver().getInstalledDir() != getDriver().Dir)
 getProgramPaths().push_back(getDriver().Dir);
-  getFilePaths().push_back(getDriver().Dir + "/../lib");
 }
 
 /// Darwin - Darwin tool chain for i386 and x86_64.

diff  --git a/clang/test/Driver/darwin-ld.c b/clang/test/Driver/darwin-ld.c
index 9fe68f1821c96..15e5d100afcbc 100644
--- a/clang/test/Driver/darwin-ld.c
+++ b/clang/test/Driver/darwin-ld.c
@@ -365,7 +365,3 @@
 // RUN: FileCheck -check-prefix=MNO_OUTLINE %s < %t.log
 // MNO_OUTLINE: {{ld(.exe)?"}}
 // MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never"
-
-// RUN: %clang -target x86_64-apple-darwin10 -### %t.o 2> %t.log
-// RUN: FileCheck -check-prefix=INSTALL-DIR %s < %t.log
-// INSTALL-DIR: "-L{{.*}}{{/|}}..{{/|}}lib"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 27a909a - [Apple-stage2] Install FileCheck and yaml2obj in the toolchain

2020-10-20 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-10-20T13:46:44-07:00
New Revision: 27a909a24f99d4de40c4ce6553b9cd420b11c056

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

LOG: [Apple-stage2] Install FileCheck and yaml2obj in the toolchain

rdar://70274446

Differential revision: https://reviews.llvm.org/D89763

Added: 


Modified: 
clang/cmake/caches/Apple-stage2.cmake

Removed: 




diff  --git a/clang/cmake/caches/Apple-stage2.cmake 
b/clang/cmake/caches/Apple-stage2.cmake
index b24ec558c071..ff9c612b9808 100644
--- a/clang/cmake/caches/Apple-stage2.cmake
+++ b/clang/cmake/caches/Apple-stage2.cmake
@@ -58,6 +58,13 @@ set(LLVM_TOOLCHAIN_TOOLS
   llvm-size
   CACHE STRING "")
 
+set(LLVM_BUILD_UTILS ON CACHE BOOL "")
+set(LLVM_INSTALL_UTILS ON CACHE BOOL "")
+set(LLVM_TOOLCHAIN_UTILITIES
+  FileCheck
+  yaml2obj
+  CACHE STRING "")
+
 set(LLVM_DISTRIBUTION_COMPONENTS
   clang
   LTO
@@ -66,6 +73,7 @@ set(LLVM_DISTRIBUTION_COMPONENTS
   cxx-headers
   Remarks
   ${LLVM_TOOLCHAIN_TOOLS}
+  ${LLVM_TOOLCHAIN_UTILITIES}
   CACHE STRING "")
 
 # test args



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 849c605 - PR47792: Include the type of a pointer or reference non-type template

2020-10-11 Thread Jonas Devlieghere via cfe-commits
I've reverted this in ba2dff0159fcd1d2349bc610331914618ca9bc30 because it
also caused a build failure when building a stage 2 clang:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24177/console

FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o
/Users/buildslave/jenkins/workspace/lldb-cmake@2/host-compiler/bin/clang++
-DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/AST
-I/Users/buildslave/jenkins/workspace/lldb-cmake@2/llvm-project/clang/lib/AST
-I/Users/buildslave/jenkins/workspace/lldb-cmake@2/llvm-project/clang/include
-Itools/clang/include -Iinclude
-I/Users/buildslave/jenkins/workspace/lldb-cmake@2/llvm-project/llvm/include
-Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time
-Werror=unguarded-availability-new -fmodules
-fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake@2/lldb-build/module.cache
-fcxx-modules -Xclang -fmodules-local-submodule-visibility -Wall -Wextra
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wmissing-field-initializers -pedantic -Wno-long-long
-Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type
-Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override
-Wstring-conversion -fdiagnostics-color -fno-common -Woverloaded-virtual
-Wno-nested-anon-types -O3 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
-fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o -MF
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o.d -o
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o -c
'/Users/buildslave/jenkins/workspace/lldb-cmake@2/llvm-project/clang/lib/AST/ASTContext.cpp'
In module 'Clang_AST' imported from
/Users/buildslave/jenkins/workspace/lldb-cmake@2/llvm-project/clang/lib/AST/ASTContext.cpp:13:
/Users/buildslave/jenkins/workspace/lldb-cmake@2/llvm-project/clang/include/clang/AST/ExternalASTSource.h:409:20:
error: definition with same mangled name
'_ZN5clang25LazyGenerationalUpdatePtrIPKNS_4DeclEPS1_XadL_ZNS_17ExternalASTSource19CompleteRedeclChainES3_EEE9makeValueERKNS_10ASTContextES4_'
as another definition static ValueType makeValue(const ASTContext &Ctx, T
Value);



On Sun, Oct 11, 2020 at 6:27 PM Hubert Tong via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> The bots don't seem happy building with a Clang that incorporates this
> change:
> ```
> /b/sanitizer-x86_64-linux-bootstrap/build/llvm-project/clang/lib/ASTMatchers/ASTMatchersInternal.cpp:943:5:
> error: redefinition of 'hasAnyName' with a different type: 'const
> VariadicFunction<...>' vs 'const VariadicFunction<...>'
> hasAnyName = {};
> ^
> /b/sanitizer-x86_64-linux-bootstrap/build/llvm-project/clang/include/clang/ASTMatchers/ASTMatchers.h:2771:5:
> note: previous declaration is here
> hasAnyName;
> ^
> ```
> (from
> http://lab.llvm.org:8011/#/builders/99/builds/49/steps/2/logs/build_clang_asan
> )
>
> On Sun, Oct 11, 2020 at 7:00 PM Richard Smith via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>>
>> Author: Richard Smith
>> Date: 2020-10-11T15:59:49-07:00
>> New Revision: 849c60541b630ddf8cabf9179fa771b3f4207ec8
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/849c60541b630ddf8cabf9179fa771b3f4207ec8
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/849c60541b630ddf8cabf9179fa771b3f4207ec8.diff
>>
>> LOG: PR47792: Include the type of a pointer or reference non-type template
>> parameter in its notion of template argument identity.
>>
>> We already did this for all the other kinds of non-type template
>> argument. We're still missing the type from the mangling, so we continue
>> to be able to see collisions at link time; that's an open ABI issue.
>>
>> Added:
>>
>>
>> Modified:
>> clang/lib/AST/ASTContext.cpp
>> clang/lib/AST/TemplateBase.cpp
>> clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
>>
>> Removed:
>>
>>
>>
>>
>> 
>> diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
>> index a82d95461bb9..7c96038629fb 100644
>> --- a/clang/lib/AST/ASTContext.cpp
>> +++ b/clang/lib/AST/ASTContext.cpp
>> @@ -5890,7 +5890,7 @@ ASTContext::getCanonicalTemplateArgument(const
>> TemplateArgument &Arg) const {
>>
>>  case TemplateArgument::Declaration: {
>>auto *D = cast(Arg.getAsDecl()->getCanonicalDecl());
>> -  return TemplateArgument(D, Arg.getParamTypeForDecl());
>> +  return TemplateArgument(D,
>> getCanonicalType(Arg.getParamTypeForDecl()));
>>  }
>>
>>  case TemplateArgument::NullPtr:
>>
>> diff  --git a/clang/lib/AST/TemplateBase.cpp
>> b/clang/lib/AST/TemplateBase.cpp
>> index a9113720fd45..e4303fdb7731 100644
>> --- a/clang/lib/AST/TemplateBase.cpp
>> +++ b/clang/lib/AST/TemplateBase.cpp
>> @@ -244,7 +244,8 @@ void Template

[clang] ba2dff0 - Revert "PR47792: Include the type of a pointer or reference non-type template"

2020-10-11 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-10-11T20:16:46-07:00
New Revision: ba2dff0159fcd1d2349bc610331914618ca9bc30

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

LOG: Revert "PR47792: Include the type of a pointer or reference non-type 
template"

This reverts commit 849c60541b630ddf8cabf9179fa771b3f4207ec8 because it
results in a stage 2 build failure:

llvm-project/clang/include/clang/AST/ExternalASTSource.h:409:20: error:
definition with same mangled name
'_ZN5clang25LazyGenerationalUpdatePtrIPKNS_4DeclEPS1_XadL_ZNS_17ExternalASTSource19CompleteRedeclChainES3_EEE9makeValueERKNS_10ASTContextES4_'
as another definition

  static ValueType makeValue(const ASTContext &Ctx, T Value);

Added: 


Modified: 
clang/lib/AST/ASTContext.cpp
clang/lib/AST/TemplateBase.cpp
clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp

Removed: 




diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 7c96038629fb..a82d95461bb9 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5890,7 +5890,7 @@ ASTContext::getCanonicalTemplateArgument(const 
TemplateArgument &Arg) const {
 
 case TemplateArgument::Declaration: {
   auto *D = cast(Arg.getAsDecl()->getCanonicalDecl());
-  return TemplateArgument(D, getCanonicalType(Arg.getParamTypeForDecl()));
+  return TemplateArgument(D, Arg.getParamTypeForDecl());
 }
 
 case TemplateArgument::NullPtr:

diff  --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index e4303fdb7731..a9113720fd45 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -244,8 +244,7 @@ void TemplateArgument::Profile(llvm::FoldingSetNodeID &ID,
 break;
 
   case Declaration:
-ID.AddPointer(getAsDecl() ? getAsDecl()->getCanonicalDecl() : nullptr);
-getParamTypeForDecl().Profile(ID);
+ID.AddPointer(getAsDecl()? getAsDecl()->getCanonicalDecl() : nullptr);
 break;
 
   case Template:
@@ -295,8 +294,7 @@ bool TemplateArgument::structurallyEquals(const 
TemplateArgument &Other) const {
 return TypeOrValue.V == Other.TypeOrValue.V;
 
   case Declaration:
-return getAsDecl() == Other.getAsDecl() &&
-   getParamTypeForDecl() == Other.getParamTypeForDecl();
+return getAsDecl() == Other.getAsDecl();
 
   case Integral:
 return getIntegralType() == Other.getIntegralType() &&

diff  --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
index 6949a2eaad48..7538de330902 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
@@ -459,23 +459,3 @@ namespace PR46637 {
   X y;
   int n = y.call(); // expected-error {{cannot initialize a variable of type 
'int' with an rvalue of type 'void *'}}
 }
-
-namespace PR47792 {
-  using I = int;
-
-  template int a;
-  const int n = 0;
-  const I n2 = 0;
-  static_assert(&a == &a<0>, "both should have type 'int'");
-  static_assert(&a == &a<0>, "both should have type 'int'");
-
-  // FIXME: We will need to mangle these cases 
diff erently too!
-  int m;
-  const int &r1 = m;
-  int &r2 = m;
-  static_assert(&a != &a, "should have 
diff erent types");
-
-  const I &r3 = m;
-  static_assert(&a == &a, "should have 
diff erent types");
-  static_assert(&a != &a, "should have 
diff erent types");
-}



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 6b742cc - [clang] Replace call to private ctor with ElementCount::getScalable (2/2)

2020-08-19 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-08-19T09:40:46-07:00
New Revision: 6b742cc48d91f35bfa98844d5add3655f33f8326

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

LOG: [clang] Replace call to private ctor with ElementCount::getScalable (2/2)

Update the code for D86120 which made the constructors of `ElementCount`
private. Apparently I missed another instance in the macro just below.

Added: 


Modified: 
clang/lib/AST/ASTContext.cpp

Removed: 




diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 48ed637e737b..a9cab40247df 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3718,7 +3718,7 @@ ASTContext::getBuiltinVectorTypeInfo(const BuiltinType 
*Ty) const {
NUMVECTORS};
 
 #define SVE_ELTTY(ELTTY, ELTS, NUMVECTORS) 
\
-  {ELTTY, llvm::ElementCount(ELTS, true), NUMVECTORS};
+  {ELTTY, llvm::ElementCount::getScalable(ELTS), NUMVECTORS};
 
   switch (Ty->getKind()) {
   default:



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] fc53bd6 - [clang] Replace call to private ctor with ElementCount::getScalable

2020-08-19 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-08-19T09:35:08-07:00
New Revision: fc53bd610ff95d2824617095bcf4976035b4cb9a

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

LOG: [clang] Replace call to private ctor with ElementCount::getScalable

Update the code for D86120 which made the constructors of `ElementCount`
private.

Added: 


Modified: 
clang/lib/AST/ASTContext.cpp

Removed: 




diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index c51629ecfd53..48ed637e737b 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3714,7 +3714,7 @@ QualType ASTContext::getIncompleteArrayType(QualType 
elementType,
 ASTContext::BuiltinVectorTypeInfo
 ASTContext::getBuiltinVectorTypeInfo(const BuiltinType *Ty) const {
 #define SVE_INT_ELTTY(BITS, ELTS, SIGNED, NUMVECTORS)  
\
-  {getIntTypeForBitwidth(BITS, SIGNED), llvm::ElementCount(ELTS, true),
\
+  {getIntTypeForBitwidth(BITS, SIGNED), llvm::ElementCount::getScalable(ELTS), 
\
NUMVECTORS};
 
 #define SVE_ELTTY(ELTTY, ELTS, NUMVECTORS) 
\



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] a1f4e48 - [clang][docs] Add note about using `-flto` with `-g` on macOS

2020-06-30 Thread Jonas Devlieghere via cfe-commits

Author: Philippe Blain
Date: 2020-06-30T09:33:20-07:00
New Revision: a1f4e48c4aca8c7339be2018926baf860a562f13

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

LOG: [clang][docs] Add note about using `-flto` with `-g` on macOS

If -Wl,object_path_lto,.o is not passed at link time
when compiling and linking in separate steps with -flto and -g, the
temporary file used for Link Time Optimization is deleted by the linker,
so the executable is missing debug symbols and can't be easily debugged,
and dsymutil can't be run.

Document this behaviour.

Differential revision: https://reviews.llvm.org/D82733

Added: 


Modified: 
clang/docs/CommandGuide/clang.rst

Removed: 




diff  --git a/clang/docs/CommandGuide/clang.rst 
b/clang/docs/CommandGuide/clang.rst
index de0e0eda9097..5978650c3288 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -474,6 +474,16 @@ Code Generation Options
   optimization. With "thin", :doc:`ThinLTO <../ThinLTO>`
   compilation is invoked instead.
 
+  .. note::
+
+ On Darwin, when using :option:`-flto` along with :option:`-g` and
+ compiling and linking in separate steps, you also need to pass
+ ``-Wl,-object_path_lto,.o`` at the linking step to instruct 
the
+ ld64 linker not to delete the temporary object file generated during Link
+ Time Optimization (this flag is automatically passed to the linker by 
Clang
+ if compilation and linking are done in a single step). This allows 
debugging
+ the executable as well as generating the ``.dSYM`` bundle using 
:manpage:`dsymutil(1)`.
+
 Driver Options
 ~~
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] df53f09 - Revert "PR46209: properly determine whether a copy assignment operator is"

2020-06-04 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-06-04T23:45:36-07:00
New Revision: df53f09056b0f6a91029cae5f1cdc941c21b

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

LOG: Revert "PR46209: properly determine whether a copy assignment operator is"

This reverts commit c57f8a3a20540fcf9fbf98c0a73f381ec32fce2a.

Added: 


Modified: 
clang/include/clang/AST/CXXRecordDeclDefinitionBits.def
clang/include/clang/AST/DeclCXX.h
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/AST/JSONNodeDumper.cpp
clang/lib/AST/TextNodeDumper.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/AST/ast-dump-decl-context-json.cpp
clang/test/AST/ast-dump-decl.cpp
clang/test/AST/ast-dump-expr-json.cpp
clang/test/AST/ast-dump-record-definition-data-json.cpp
clang/test/AST/ast-dump-records-json.cpp
clang/test/AST/ast-dump-records.cpp
clang/test/AST/ast-dump-special-member-functions.cpp
clang/test/AST/ast-dump-template-decls-json.cpp
clang/test/SemaCXX/type-traits.cpp
clang/test/SemaObjCXX/arc-0x.mm
clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Removed: 




diff  --git a/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def 
b/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def
index 33e65f8ebf44..bd4d8247aeca 100644
--- a/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def
+++ b/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def
@@ -140,7 +140,6 @@ FIELD(HasInheritedAssignment, 1, NO_MERGE)
 /// @{
 FIELD(NeedOverloadResolutionForCopyConstructor, 1, NO_MERGE)
 FIELD(NeedOverloadResolutionForMoveConstructor, 1, NO_MERGE)
-FIELD(NeedOverloadResolutionForCopyAssignment, 1, NO_MERGE)
 FIELD(NeedOverloadResolutionForMoveAssignment, 1, NO_MERGE)
 FIELD(NeedOverloadResolutionForDestructor, 1, NO_MERGE)
 /// @}
@@ -150,7 +149,6 @@ FIELD(NeedOverloadResolutionForDestructor, 1, NO_MERGE)
 /// @{
 FIELD(DefaultedCopyConstructorIsDeleted, 1, NO_MERGE)
 FIELD(DefaultedMoveConstructorIsDeleted, 1, NO_MERGE)
-FIELD(DefaultedCopyAssignmentIsDeleted, 1, NO_MERGE)
 FIELD(DefaultedMoveAssignmentIsDeleted, 1, NO_MERGE)
 FIELD(DefaultedDestructorIsDeleted, 1, NO_MERGE)
 /// @}

diff  --git a/clang/include/clang/AST/DeclCXX.h 
b/clang/include/clang/AST/DeclCXX.h
index 2b8d7e879a0a..856717fa0abb 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -712,13 +712,6 @@ class CXXRecordDecl : public RecordDecl {
!data().DefaultedMoveConstructorIsDeleted;
   }
 
-  /// \c true if we know for sure that this class has a single,
-  /// accessible, unambiguous copy assignment operator that is not deleted.
-  bool hasSimpleCopyAssignment() const {
-return !hasUserDeclaredCopyAssignment() &&
-   !data().DefaultedCopyAssignmentIsDeleted;
-  }
-
   /// \c true if we know for sure that this class has a single,
   /// accessible, unambiguous move assignment operator that is not deleted.
   bool hasSimpleMoveAssignment() const {
@@ -879,15 +872,6 @@ class CXXRecordDecl : public RecordDecl {
 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
   }
 
-  /// Set that we attempted to declare an implicit copy assignment
-  /// operator, but overload resolution failed so we deleted it.
-  void setImplicitCopyAssignmentIsDeleted() {
-assert((data().DefaultedCopyAssignmentIsDeleted ||
-needsOverloadResolutionForCopyAssignment()) &&
-   "copy assignment should not be deleted");
-data().DefaultedCopyAssignmentIsDeleted = true;
-  }
-
   /// Determine whether this class needs an implicit copy
   /// assignment operator to be lazily declared.
   bool needsImplicitCopyAssignment() const {
@@ -897,16 +881,7 @@ class CXXRecordDecl : public RecordDecl {
   /// Determine whether we need to eagerly declare a defaulted copy
   /// assignment operator for this class.
   bool needsOverloadResolutionForCopyAssignment() const {
-// C++20 [class.copy.assign]p2:
-//   If the class definition declares a move constructor or move assignment
-//   operator, the implicitly declared copy assignment operator is defined
-//   as deleted.
-// In MSVC mode, sometimes a declared move constructor does not delete an
-// implicit copy assignment, so defer this choice to Sema.
-if (data().UserDeclaredSpecialMembers &
-(SMF_MoveConstructor | SMF_MoveAssignment))
-  return true;
-return data().NeedOverloadResolutionForCopyAssignment;
+return data().HasMutableFields;
   }
 
   /// Determine whether an implicit copy assignment operator for this

diff  --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 8b96e20e374d..a2a712e6b6ca 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -2795,7 

Re: [clang] c13dd74 - Set the captures on a CXXRecordDecl representing a lambda closure type

2020-06-04 Thread Jonas Devlieghere via cfe-commits
Hey Richard,

It appears this broke the lldb bots:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/20549/

It's hitting an assertion in
llvm-project/clang/include/clang/AST/DeclCXX.h:887:

Assertion `(data().DefaultedCopyAssignmentIsDeleted ||
needsOverloadResolutionForCopyAssignment()) && "copy assignment should not
be deleted"' failed.

I've reverted this commit and the subsequent one
(c57f8a3a20540fcf9fbf98c0a73f381ec32fce2a) to turn the bots green again
overnight. Could you please take a look tomorrow?

Thanks,
Jonas



On Thu, Jun 4, 2020 at 7:25 PM Richard Smith via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
> Author: Richard Smith
> Date: 2020-06-04T19:19:01-07:00
> New Revision: c13dd74e311d2ac70dd3ea663d800307d1aa5b6b
>
> URL:
> https://github.com/llvm/llvm-project/commit/c13dd74e311d2ac70dd3ea663d800307d1aa5b6b
> DIFF:
> https://github.com/llvm/llvm-project/commit/c13dd74e311d2ac70dd3ea663d800307d1aa5b6b.diff
>
> LOG: Set the captures on a CXXRecordDecl representing a lambda closure type
> before marking it complete.
>
> No functionality change intended.
>
> Added:
>
>
> Modified:
> clang/include/clang/AST/DeclCXX.h
> clang/include/clang/AST/ExprCXX.h
> clang/lib/AST/ASTImporter.cpp
> clang/lib/AST/DeclCXX.cpp
> clang/lib/AST/ExprCXX.cpp
> clang/lib/Sema/SemaLambda.cpp
>
> Removed:
>
>
>
>
> 
> diff  --git a/clang/include/clang/AST/DeclCXX.h
> b/clang/include/clang/AST/DeclCXX.h
> index 3a400a778e53..856717fa0abb 100644
> --- a/clang/include/clang/AST/DeclCXX.h
> +++ b/clang/include/clang/AST/DeclCXX.h
> @@ -999,6 +999,9 @@ class CXXRecordDecl : public RecordDecl {
>  return
> static_cast(getLambdaData().CaptureDefault);
>}
>
> +  /// Set the captures for this lambda closure type.
> +  void setCaptures(ArrayRef Captures);
> +
>/// For a closure type, retrieve the mapping from captured
>/// variables and \c this to the non-static data members that store the
>/// values or references of the captures.
> @@ -1030,6 +1033,8 @@ class CXXRecordDecl : public RecordDecl {
>: nullptr;
>}
>
> +  unsigned capture_size() const { return getLambdaData().NumCaptures; }
> +
>using conversion_iterator = UnresolvedSetIterator;
>
>conversion_iterator conversion_begin() const {
>
> diff  --git a/clang/include/clang/AST/ExprCXX.h
> b/clang/include/clang/AST/ExprCXX.h
> index 272ad138d14a..56b27d57bd5c 100644
> --- a/clang/include/clang/AST/ExprCXX.h
> +++ b/clang/include/clang/AST/ExprCXX.h
> @@ -1862,10 +1862,9 @@ class LambdaExpr final : public Expr,
>/// Construct a lambda expression.
>LambdaExpr(QualType T, SourceRange IntroducerRange,
>   LambdaCaptureDefault CaptureDefault,
> - SourceLocation CaptureDefaultLoc, ArrayRef
> Captures,
> - bool ExplicitParams, bool ExplicitResultType,
> - ArrayRef CaptureInits, SourceLocation ClosingBrace,
> - bool ContainsUnexpandedParameterPack);
> + SourceLocation CaptureDefaultLoc, bool ExplicitParams,
> + bool ExplicitResultType, ArrayRef CaptureInits,
> + SourceLocation ClosingBrace, bool
> ContainsUnexpandedParameterPack);
>
>/// Construct an empty lambda expression.
>LambdaExpr(EmptyShell Empty, unsigned NumCaptures)
> @@ -1888,9 +1887,9 @@ class LambdaExpr final : public Expr,
>static LambdaExpr *
>Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange
> IntroducerRange,
>   LambdaCaptureDefault CaptureDefault, SourceLocation
> CaptureDefaultLoc,
> - ArrayRef Captures, bool ExplicitParams,
> - bool ExplicitResultType, ArrayRef CaptureInits,
> - SourceLocation ClosingBrace, bool
> ContainsUnexpandedParameterPack);
> + bool ExplicitParams, bool ExplicitResultType,
> + ArrayRef CaptureInits, SourceLocation ClosingBrace,
> + bool ContainsUnexpandedParameterPack);
>
>/// Construct a new lambda expression that will be deserialized from
>/// an external source.
>
> diff  --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
> index 10035162299e..a2a712e6b6ca 100644
> --- a/clang/lib/AST/ASTImporter.cpp
> +++ b/clang/lib/AST/ASTImporter.cpp
> @@ -1890,6 +1890,19 @@ Error ASTNodeImporter::ImportDefinition(
>  // set in CXXRecordDecl::CreateLambda.  We must import the
> contained
>  // decls here and finish the definition.
>  (To->isLambda() && shouldForceImportDeclContext(Kind))) {
> +  if (To->isLambda()) {
> +auto *FromCXXRD = cast(From);
> +SmallVector ToCaptures;
> +ToCaptures.reserve(FromCXXRD->capture_size());
> +for (const auto &FromCapture : FromCXXRD->captures()) {
> +  if (auto ToCaptureOrErr = import(FromCapture))
> +ToCaptures.push_back(*ToCaptureOrErr);
> +

[clang] 70ad03d - Revert "Set the captures on a CXXRecordDecl representing a lambda closure type"

2020-06-04 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-06-04T23:45:36-07:00
New Revision: 70ad03d93818532ef19f149f8ff89bcd8af80163

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

LOG: Revert "Set the captures on a CXXRecordDecl representing a lambda closure 
type"

This reverts commit c13dd74e311d2ac70dd3ea663d800307d1aa5b6b.

Added: 


Modified: 
clang/include/clang/AST/DeclCXX.h
clang/include/clang/AST/ExprCXX.h
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/AST/ExprCXX.cpp
clang/lib/Sema/SemaLambda.cpp

Removed: 




diff  --git a/clang/include/clang/AST/DeclCXX.h 
b/clang/include/clang/AST/DeclCXX.h
index 856717fa0abb..3a400a778e53 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -999,9 +999,6 @@ class CXXRecordDecl : public RecordDecl {
 return static_cast(getLambdaData().CaptureDefault);
   }
 
-  /// Set the captures for this lambda closure type.
-  void setCaptures(ArrayRef Captures);
-
   /// For a closure type, retrieve the mapping from captured
   /// variables and \c this to the non-static data members that store the
   /// values or references of the captures.
@@ -1033,8 +1030,6 @@ class CXXRecordDecl : public RecordDecl {
   : nullptr;
   }
 
-  unsigned capture_size() const { return getLambdaData().NumCaptures; }
-
   using conversion_iterator = UnresolvedSetIterator;
 
   conversion_iterator conversion_begin() const {

diff  --git a/clang/include/clang/AST/ExprCXX.h 
b/clang/include/clang/AST/ExprCXX.h
index 56b27d57bd5c..272ad138d14a 100644
--- a/clang/include/clang/AST/ExprCXX.h
+++ b/clang/include/clang/AST/ExprCXX.h
@@ -1862,9 +1862,10 @@ class LambdaExpr final : public Expr,
   /// Construct a lambda expression.
   LambdaExpr(QualType T, SourceRange IntroducerRange,
  LambdaCaptureDefault CaptureDefault,
- SourceLocation CaptureDefaultLoc, bool ExplicitParams,
- bool ExplicitResultType, ArrayRef CaptureInits,
- SourceLocation ClosingBrace, bool 
ContainsUnexpandedParameterPack);
+ SourceLocation CaptureDefaultLoc, ArrayRef 
Captures,
+ bool ExplicitParams, bool ExplicitResultType,
+ ArrayRef CaptureInits, SourceLocation ClosingBrace,
+ bool ContainsUnexpandedParameterPack);
 
   /// Construct an empty lambda expression.
   LambdaExpr(EmptyShell Empty, unsigned NumCaptures)
@@ -1887,9 +1888,9 @@ class LambdaExpr final : public Expr,
   static LambdaExpr *
   Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange 
IntroducerRange,
  LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc,
- bool ExplicitParams, bool ExplicitResultType,
- ArrayRef CaptureInits, SourceLocation ClosingBrace,
- bool ContainsUnexpandedParameterPack);
+ ArrayRef Captures, bool ExplicitParams,
+ bool ExplicitResultType, ArrayRef CaptureInits,
+ SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack);
 
   /// Construct a new lambda expression that will be deserialized from
   /// an external source.

diff  --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index a2a712e6b6ca..10035162299e 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -1890,19 +1890,6 @@ Error ASTNodeImporter::ImportDefinition(
 // set in CXXRecordDecl::CreateLambda.  We must import the contained
 // decls here and finish the definition.
 (To->isLambda() && shouldForceImportDeclContext(Kind))) {
-  if (To->isLambda()) {
-auto *FromCXXRD = cast(From);
-SmallVector ToCaptures;
-ToCaptures.reserve(FromCXXRD->capture_size());
-for (const auto &FromCapture : FromCXXRD->captures()) {
-  if (auto ToCaptureOrErr = import(FromCapture))
-ToCaptures.push_back(*ToCaptureOrErr);
-  else
-return ToCaptureOrErr.takeError();
-}
-cast(To)->setCaptures(ToCaptures);
-  }
-
   Error Result = ImportDeclContext(From, /*ForceImport=*/true);
   // Finish the definition of the lambda, set isBeingDefined to false.
   if (To->isLambda())
@@ -7601,6 +7588,15 @@ ExpectedStmt ASTNodeImporter::VisitLambdaExpr(LambdaExpr 
*E) {
   if (!ToCallOpOrErr)
 return ToCallOpOrErr.takeError();
 
+  SmallVector ToCaptures;
+  ToCaptures.reserve(E->capture_size());
+  for (const auto &FromCapture : E->captures()) {
+if (auto ToCaptureOrErr = import(FromCapture))
+  ToCaptures.push_back(*ToCaptureOrErr);
+else
+  return ToCaptureOrErr.takeError();
+  }
+
   SmallVector ToCaptureInits(E->capture_size());
   if (Error Err = ImportContainerChecked(E->capture_inits(), ToCaptureInits))
 retu

[clang] a94e08d - [StaticAnalyzer] Fix non-virtual destructor warning

2020-05-26 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-05-26T11:32:02-07:00
New Revision: a94e08d2e840a0e7ce032f59e9344bc49b5a54a1

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

LOG: [StaticAnalyzer] Fix non-virtual destructor warning

Ficed warning: 'clang::ento::ExprEngine' has virtual functions but non-virtual 
destructor [-
Wnon-virtual-dtor]
  ~ExprEngine() = default;

Added: 


Modified: 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h

Removed: 




diff  --git 
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
index a94c847f35ee..b32302cfc337 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
@@ -177,7 +177,7 @@ class ExprEngine {
  SetOfConstDecls *VisitedCalleesIn,
  FunctionSummariesTy *FS, InliningModes HowToInlineIn);
 
-  ~ExprEngine() = default;
+  virtual ~ExprEngine() = default;
 
   /// Returns true if there is still simulation state on the worklist.
   bool ExecuteWorkList(const LocationContext *L, unsigned Steps = 15) {



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 56abcfa - Revert "[analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow CheckerManager to be constructed for non-analysis purposes"

2020-03-23 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-03-23T12:09:24-07:00
New Revision: 56abcfad70ee679ad95ab41d934491ebcaebdf7d

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

LOG: Revert "[analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow 
CheckerManager to be constructed for non-analysis purposes"

Temporarily reverting this patch because it breaks the modules build.

Added: 
clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp

Modified: 
clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h
clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt
clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp

Removed: 
clang/include/clang/StaticAnalyzer/Frontend/AnalyzerHelpFlags.h
clang/lib/StaticAnalyzer/Frontend/AnalyzerHelpFlags.cpp



diff  --git a/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h 
b/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
index 6faf0f2e0afd..4454d7603b27 100644
--- a/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
+++ b/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
@@ -14,11 +14,9 @@
 #define LLVM_CLANG_STATICANALYZER_CORE_CHECKERMANAGER_H
 
 #include "clang/Analysis/ProgramPoint.h"
-#include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"
-#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
@@ -42,6 +40,7 @@ class BugReporter;
 class CallEvent;
 class CheckerBase;
 class CheckerContext;
+class CheckerRegistry;
 class ExplodedGraph;
 class ExplodedNode;
 class ExplodedNodeSet;
@@ -122,42 +121,14 @@ enum class ObjCMessageVisitKind {
 };
 
 class CheckerManager {
-  ASTContext *Context;
+  ASTContext &Context;
   const LangOptions LangOpts;
   AnalyzerOptions &AOptions;
   CheckerNameRef CurrentCheckerName;
-  DiagnosticsEngine &Diags;
-  CheckerRegistry Registry;
 
 public:
-  CheckerManager(
-  ASTContext &Context, AnalyzerOptions &AOptions,
-  ArrayRef plugins,
-  ArrayRef> checkerRegistrationFns)
-  : Context(&Context), LangOpts(Context.getLangOpts()), AOptions(AOptions),
-Diags(Context.getDiagnostics()),
-Registry(plugins, Context.getDiagnostics(), AOptions,
- checkerRegistrationFns) {
-Registry.initializeRegistry(*this);
-Registry.initializeManager(*this);
-finishedCheckerRegistration();
-  }
-
-  /// Constructs a CheckerManager that ignores all non TblGen-generated
-  /// checkers. Useful for unit testing, unless the checker infrastructure
-  /// itself is tested.
   CheckerManager(ASTContext &Context, AnalyzerOptions &AOptions)
-  : CheckerManager(Context, AOptions, {}, {}) {}
-
-  /// Constructs a CheckerManager without requiring an AST. No checker
-  /// registration will take place. Only useful for retrieving the
-  /// CheckerRegistry and print for help flags where the AST is unavalaible.
-  CheckerManager(AnalyzerOptions &AOptions, const LangOptions &LangOpts,
- DiagnosticsEngine &Diags, ArrayRef plugins)
-  : LangOpts(LangOpts), AOptions(AOptions), Diags(Diags),
-Registry(plugins, Diags, AOptions) {
-Registry.initializeRegistry(*this);
-  }
+  : Context(Context), LangOpts(Context.getLangOpts()), AOptions(AOptions) 
{}
 
   ~CheckerManager();
 
@@ -170,12 +141,7 @@ class CheckerManager {
 
   const LangOptions &getLangOpts() const { return LangOpts; }
   AnalyzerOptions &getAnalyzerOptions() const { return AOptions; }
-  const CheckerRegistry &getCheckerRegistry() const { return Registry; }
-  DiagnosticsEngine &getDiagnostics() const { return Diags; }
-  ASTContext &getASTContext() const {
-assert(Context);
-return *Context;
-  }
+  ASTContext &getASTContext() const { return Context; }
 
   /// Emits an error through a DiagnosticsEngine about an invalid user supplied
   /// checker option value.

diff  --git a/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h 
b/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
index bcc29a60ad70..2d24e6a9586b 100644
--- a/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
+++ b/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h

[clang-tools-extra] 45e2c6d - [clang-tools-extra/clang-tidy] Mark modernize-make-shared as offering fixes

2020-03-05 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-03-05T21:45:20-08:00
New Revision: 45e2c6d956141618683d31a683d762aaf0e7168d

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

LOG: [clang-tools-extra/clang-tidy] Mark modernize-make-shared as offering fixes

The list incorrectly states that modernize-make-shared does not offer
fixes, which is incorrect. Just like modernize-make-unique it does.

Added: 


Modified: 
clang-tools-extra/docs/clang-tidy/checks/list.rst

Removed: 




diff  --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst 
b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index 3b9d12ec56ad..05741385615a 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -207,7 +207,7 @@ Clang-Tidy Checks
`modernize-deprecated-headers `_, "Yes"
`modernize-deprecated-ios-base-aliases 
`_, "Yes"
`modernize-loop-convert `_, "Yes"
-   `modernize-make-shared `_,
+   `modernize-make-shared `_, "Yes"
`modernize-make-unique `_, "Yes"
`modernize-pass-by-value `_, "Yes"
`modernize-raw-string-literal `_, "Yes"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 509e21a - [clang] Replace SmallStr.str().str() with std::string conversion operator.

2020-01-29 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-01-29T21:27:46-08:00
New Revision: 509e21a1b9debc7fcbfb3eaf56a5dcf57de55e0e

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

LOG: [clang] Replace SmallStr.str().str() with std::string conversion operator.

Use the std::string conversion operator introduced in
d7049213d0fcda691c9e79f9b41e357198d99738.

Added: 


Modified: 
clang/lib/AST/Expr.cpp
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/lib/CrossTU/CrossTranslationUnit.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Lex/HeaderSearch.cpp
clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
clang/tools/clang-refactor/TestSupport.cpp
clang/unittests/Driver/SanitizerArgsTest.cpp
clang/unittests/Frontend/FrontendActionTest.cpp

Removed: 




diff  --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index a0d11ee9982f..51d29aef3267 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -856,7 +856,7 @@ std::string PredefinedExpr::ComputeName(IdentKind IK, const 
Decl *CurrentDecl) {
 
 Out << Proto;
 
-return Name.str().str();
+return std::string(Name);
   }
   if (const CapturedDecl *CD = dyn_cast(CurrentDecl)) {
 for (const DeclContext *DC = CD->getParent(); DC; DC = DC->getParent())
@@ -887,7 +887,7 @@ std::string PredefinedExpr::ComputeName(IdentKind IK, const 
Decl *CurrentDecl) {
 MD->getSelector().print(Out);
 Out <<  ']';
 
-return Name.str().str();
+return std::string(Name);
   }
   if (isa(CurrentDecl) && IK == PrettyFunction) {
 // __PRETTY_FUNCTION__ -> "top level", the others produce an empty string.

diff  --git a/clang/lib/CodeGen/CoverageMappingGen.cpp 
b/clang/lib/CodeGen/CoverageMappingGen.cpp
index bdecff39c88f..ee85694f043a 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -1282,7 +1282,7 @@ std::string normalizeFilename(StringRef Filename) {
   llvm::SmallString<256> Path(Filename);
   llvm::sys::fs::make_absolute(Path);
   llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
-  return Path.str().str();
+  return std::string(Path);
 }
 
 } // end anonymous namespace

diff  --git a/clang/lib/CrossTU/CrossTranslationUnit.cpp 
b/clang/lib/CrossTU/CrossTranslationUnit.cpp
index f182f5c2cb4d..d138985c57fd 100644
--- a/clang/lib/CrossTU/CrossTranslationUnit.cpp
+++ b/clang/lib/CrossTU/CrossTranslationUnit.cpp
@@ -149,7 +149,7 @@ parseCrossTUIndex(StringRef IndexPath, StringRef 
CrossTUDir) {
   StringRef FileName = LineRef.substr(Pos + 1);
   SmallString<256> FilePath = CrossTUDir;
   llvm::sys::path::append(FilePath, FileName);
-  Result[LookupName] = FilePath.str().str();
+  Result[LookupName] = std::string(FilePath);
 } else
   return llvm::make_error(
   index_error_code::invalid_index_format, IndexPath.str(), LineNo);

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 0813146406ad..6db791ab8333 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -4650,7 +4650,7 @@ std::string Driver::GetFilePath(StringRef Name, const 
ToolChain &TC) const {
   SmallString<128> P(Dir[0] == '=' ? SysRoot + Dir.substr(1) : Dir);
   llvm::sys::path::append(P, Name);
   if (llvm::sys::fs::exists(Twine(P)))
-return P.str().str();
+return std::string(P);
 }
 return None;
   };

diff  --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index ff9272ec3e1a..73c02d7f6e6d 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -159,7 +159,7 @@ std::string 
HeaderSearch::getPrebuiltModuleFileName(StringRef ModuleName,
 llvm::sys::fs::make_absolute(Result);
 llvm::sys::path::append(Result, ModuleName + ".pcm");
 if (getFileMgr().getFile(Result.str()))
-  return Result.str().str();
+  return std::string(Result);
   }
   return {};
 }

diff  --git a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp 
b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
index fb7758bfbd2a..a415ed32c05a 100644
--- a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
@@ -106,7 +106,7 @@ static std::string fileNameToURI(StringRef Filename) {
 }
   });
 
-  return Ret.str().str();
+  return std::string(Ret);
 }
 
 static json::Object createArtifactLocation(const FileEntry &FE) {

diff  --git a/clang/tools/clang-refactor/TestSupport.cpp 
b/clang/tools/clang-refactor/TestSupport.cpp
index 617a671d1271..02b816d5235c 100644
--- a/clang/tools/clang-refactor/TestSupport.cpp
+++ b/clang/tools/clang-refactor/TestSupport.cpp
@@ -190,7 +190,7 @@ bool TestRefactoringResultConsumer::handleAllResults() {
   const PartialDiagnosticAt &Diag = 

[clang] 43a1c80 - Fix another implicit conversion in the directory watcher

2020-01-28 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-01-28T15:28:22-08:00
New Revision: 43a1c80508d17fa42c78b690d426105eaa84c539

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

LOG: Fix another implicit conversion in the directory watcher

Added: 


Modified: 
clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp

Removed: 




diff  --git a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp 
b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
index 88bab18169a8..2cae847e7657 100644
--- a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
+++ b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
@@ -221,7 +221,7 @@ llvm::Expected> 
clang::DirectoryWatcher::creat
 
   // We need to copy the data so the lifetime is ok after a const copy is made
   // for the block.
-  const std::string CopiedPath = Path;
+  const std::string CopiedPath = Path.str();
 
   auto InitWork = ^{
 // We need to start watching the directory before we start scanning in 
order



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 00d834e - Fix more implicit conversions

2020-01-28 Thread Jonas Devlieghere via cfe-commits

Author: Jonas Devlieghere
Date: 2020-01-28T15:19:27-08:00
New Revision: 00d834e08719c994f12b216c7eb17bbc0c976714

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

LOG: Fix more implicit conversions

Added: 


Modified: 
clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
llvm/tools/dsymutil/SymbolMap.cpp

Removed: 




diff  --git a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp 
b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
index 7a60369a4da0..88bab18169a8 100644
--- a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
+++ b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
@@ -173,7 +173,7 @@ FSEventStreamRef createFSEventStream(
   if (::realpath(P.begin(), Buffer) != nullptr)
 RealPath = Buffer;
   else
-RealPath = Path;
+RealPath = Path.str();
 }
 
 FSEventStreamContext Context;

diff  --git a/llvm/tools/dsymutil/SymbolMap.cpp 
b/llvm/tools/dsymutil/SymbolMap.cpp
index 7ee078cd9f93..6a13efdf8e95 100644
--- a/llvm/tools/dsymutil/SymbolMap.cpp
+++ b/llvm/tools/dsymutil/SymbolMap.cpp
@@ -96,7 +96,7 @@ SymbolMapTranslator SymbolMapLoader::Load(StringRef InputFile,
   StringRef UUID(CFStringGetCStringPtr(OldUUID, 
kCFStringEncodingUTF8));
   SmallString<256> BCSymbolMapPath(SymbolMapPath);
   sys::path::append(BCSymbolMapPath, UUID.str() + ".bcsymbolmap");
-  SymbolMapPath = BCSymbolMapPath.str();
+  SymbolMapPath = BCSymbolMapPath.str().str();
 }
 CFRelease(plist);
   }



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r372672 - Revert "Support for DWARF-5 C++ language tags."

2019-09-23 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Mon Sep 23 16:49:36 2019
New Revision: 372672

URL: http://llvm.org/viewvc/llvm-project?rev=372672&view=rev
Log:
Revert "Support for DWARF-5 C++ language tags."

This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007.

Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/AST/DeclPrinter.cpp
cfe/trunk/lib/AST/JSONNodeDumper.cpp
cfe/trunk/lib/AST/TextNodeDumper.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaModule.cpp
cfe/trunk/test/Modules/ModuleDebugInfo.cpp

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=372672&r1=372671&r2=372672&view=diff
==
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Mon Sep 23 16:49:36 2019
@@ -42,7 +42,6 @@
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/iterator_range.h"
-#include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
@@ -2942,10 +2941,8 @@ public:
   /// ensure a stable ABI for this, we choose the DW_LANG_ encodings
   /// from the dwarf standard.
   enum LanguageIDs {
-lang_c = llvm::dwarf::DW_LANG_C,
-lang_cxx = llvm::dwarf::DW_LANG_C_plus_plus,
-lang_cxx_11 = llvm::dwarf::DW_LANG_C_plus_plus_11,
-lang_cxx_14 = llvm::dwarf::DW_LANG_C_plus_plus_14
+lang_c = /* DW_LANG_C */ 0x0002,
+lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004
   };
 
 private:

Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=372672&r1=372671&r2=372672&view=diff
==
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Mon Sep 23 16:49:36 2019
@@ -1001,19 +1001,12 @@ void DeclPrinter::VisitCXXRecordDecl(CXX
 
 void DeclPrinter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
   const char *l;
-  switch (D->getLanguage()) {
-  case LinkageSpecDecl::lang_c:
+  if (D->getLanguage() == LinkageSpecDecl::lang_c)
 l = "C";
-break;
-  case LinkageSpecDecl::lang_cxx_14:
-l = "C++14";
-break;
-  case LinkageSpecDecl::lang_cxx_11:
-l = "C++11";
-break;
-  case LinkageSpecDecl::lang_cxx:
+  else {
+assert(D->getLanguage() == LinkageSpecDecl::lang_cxx &&
+   "unknown language in linkage specification");
 l = "C++";
-break;
   }
 
   Out << "extern \"" << l << "\" ";

Modified: cfe/trunk/lib/AST/JSONNodeDumper.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/JSONNodeDumper.cpp?rev=372672&r1=372671&r2=372672&view=diff
==
--- cfe/trunk/lib/AST/JSONNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/JSONNodeDumper.cpp Mon Sep 23 16:49:36 2019
@@ -850,12 +850,6 @@ void JSONNodeDumper::VisitLinkageSpecDec
   switch (LSD->getLanguage()) {
   case LinkageSpecDecl::lang_c: Lang = "C"; break;
   case LinkageSpecDecl::lang_cxx: Lang = "C++"; break;
-  case LinkageSpecDecl::lang_cxx_11:
-Lang = "C++11";
-break;
-  case LinkageSpecDecl::lang_cxx_14:
-Lang = "C++14";
-break;
   }
   JOS.attribute("language", Lang);
   attributeOnlyIfTrue("hasBraces", LSD->hasBraces());

Modified: cfe/trunk/lib/AST/TextNodeDumper.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TextNodeDumper.cpp?rev=372672&r1=372671&r2=372672&view=diff
==
--- cfe/trunk/lib/AST/TextNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/TextNodeDumper.cpp Mon Sep 23 16:49:36 2019
@@ -1766,12 +1766,6 @@ void TextNodeDumper::VisitLinkageSpecDec
   case LinkageSpecDecl::lang_cxx:
 OS << " C++";
 break;
-  case LinkageSpecDecl::lang_cxx_11:
-OS << " C++11";
-break;
-  case LinkageSpecDecl::lang_cxx_14:
-OS << " C++14";
-break;
   }
 }
 

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=372672&r1=372671&r2=372672&view=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Sep 23 16:49:36 2019
@@ -561,10 +561,6 @@ void CGDebugInfo::CreateCompileUnit() {
   if (LO.CPlusPlus) {
 if (LO.ObjC)
   LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
-else if (LO.CPlusPlus14)
-  LangTag = llvm::dwarf::DW_LANG_C_plus_plus_14;
-else if (LO.CPlusPlus11)
-  LangTag = llvm::dwarf::DW_LANG_C_plus_plus_11;
 else
   LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
   } else if (LO.ObjC) {
@@ -882,

r371813 - Revert "For PR17164: split -fno-lax-vector-conversion into three different"

2019-09-12 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Thu Sep 12 22:16:59 2019
New Revision: 371813

URL: http://llvm.org/viewvc/llvm-project?rev=371813&view=rev
Log:
Revert "For PR17164: split -fno-lax-vector-conversion into three different"

This breaks the LLDB build. I tried reaching out to Richard, but haven't
gotten a reply yet.

Modified:
cfe/trunk/include/clang/Basic/LangOptions.def
cfe/trunk/include/clang/Basic/LangOptions.h
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/CodeGen/builtins-systemz-vector.c
cfe/trunk/test/CodeGen/builtins-systemz-vector2.c
cfe/trunk/test/CodeGen/builtins-systemz-vector3.c
cfe/trunk/test/CodeGen/builtins-systemz-zvector-error.c
cfe/trunk/test/CodeGen/builtins-systemz-zvector.c
cfe/trunk/test/CodeGen/builtins-systemz-zvector2-error.c
cfe/trunk/test/CodeGen/builtins-systemz-zvector2.c
cfe/trunk/test/CodeGen/builtins-systemz-zvector3-error.c
cfe/trunk/test/CodeGen/builtins-systemz-zvector3.c
cfe/trunk/test/CodeGen/builtins-wasm.c
cfe/trunk/test/CodeGenCXX/builtins-systemz-zvector.cpp
cfe/trunk/test/Headers/altivec-header.c
cfe/trunk/test/Headers/arm-neon-header.c
cfe/trunk/test/Headers/x86-intrinsics-headers-clean.cpp
cfe/trunk/test/Headers/x86-intrinsics-headers.c
cfe/trunk/test/Headers/x86intrin-2.c
cfe/trunk/test/Headers/x86intrin.c
cfe/trunk/test/Sema/ext_vector_casts.c
cfe/trunk/test/Sema/typedef-retain.c
cfe/trunk/test/Sema/zvector.c
cfe/trunk/test/Sema/zvector2.c
cfe/trunk/test/SemaCXX/altivec.cpp
cfe/trunk/test/SemaCXX/vector-no-lax.cpp
cfe/trunk/test/SemaCXX/vector.cpp

Modified: cfe/trunk/include/clang/Basic/LangOptions.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=371813&r1=371812&r2=371813&view=diff
==
--- cfe/trunk/include/clang/Basic/LangOptions.def (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Sep 12 22:16:59 2019
@@ -119,8 +119,7 @@ LANGOPT(AppleKext , 1, 0, "Apple
 BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support")
 LANGOPT(WritableStrings   , 1, 0, "writable string support")
 LANGOPT(ConstStrings  , 1, 0, "const-qualified string support")
-ENUM_LANGOPT(LaxVectorConversions, LaxVectorConversionKind, 2,
- LaxVectorConversionKind::All, "lax vector conversions")
+LANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions")
 LANGOPT(AltiVec   , 1, 0, "AltiVec-style vector initializers")
 LANGOPT(ZVector   , 1, 0, "System z vector extensions")
 LANGOPT(Exceptions, 1, 0, "exception handling")

Modified: cfe/trunk/include/clang/Basic/LangOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.h?rev=371813&r1=371812&r2=371813&view=diff
==
--- cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.h Thu Sep 12 22:16:59 2019
@@ -184,16 +184,6 @@ public:
 FEA_On
   };
 
-  enum class LaxVectorConversionKind {
-/// Permit no implicit vector bitcasts.
-None,
-/// Permit vector bitcasts between integer vectors with different numbers
-/// of elements but the same total bit-width.
-Integer,
-/// Permit vector bitcasts between all vectors with the same total
-/// bit-width.
-All,
-  };
 
 public:
   /// Set of enabled sanitizers.

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=371813&r1=371812&r2=371813&view=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Sep 12 22:16:59 2019
@@ -1274,10 +1274,7 @@ def fno_fine_grained_bitfield_accesses :
   HelpText<"Use large-integer access for consecutive bitfield runs.">;
 
 def flat__namespace : Flag<["-"], "flat_namespace">;
-def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, 
Group,
-  HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, 
Flags<[CC1Option]>;
-def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, 
Group,
-  Alias, AliasArgs<["integer"]>;
+def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, 
Group;
 def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, 
Group;
 def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group,
   HelpText<"Force linking the clang builtins runtime library">;
@@ -1451,7 +1448,7 @@ def fno_experimental_new_pass_manager :
 def fveclib : Joined<["-"], "fveclib=">, Group, Flags<[CC1Option]>,
 HelpText<"Use the given vector functions library">, 
Values<"

r368954 - [NFC] Update doc comment to fix warning.

2019-08-14 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Wed Aug 14 20:59:30 2019
New Revision: 368954

URL: http://llvm.org/viewvc/llvm-project?rev=368954&view=rev
Log:
[NFC] Update doc comment to fix warning.

This fixes the warning: parameter 'EnableNullFPSuppression' not found in
the function declaration [-Wdocumentation]

Modified:

cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h

Modified: 
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h?rev=368954&r1=368953&r2=368954&view=diff
==
--- 
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h 
(original)
+++ 
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h 
Wed Aug 14 20:59:30 2019
@@ -143,8 +143,6 @@ public:
 
   /// \param V We're searching for the store where \c R received this value.
   /// \param R The region we're tracking.
-  /// \param EnableNullFPSuppression Whether we should employ false positive
-  /// suppression (inlined defensive checks, returned null).
   /// \param TKind May limit the amount of notes added to the bug report.
   /// \param OriginSFC Only adds notes when the last store happened in a
   ///different stackframe to this one. Disregarded if the tracking kind


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r368459 - Fix a build bot failure and multiple warnings instances for range base for loops

2019-08-09 Thread Jonas Devlieghere via cfe-commits
The bot is a little special in that it has modules enabled. Maybe that
explains it? Let me know if that doesn't work and I can try
reproducing locally.

On Fri, Aug 9, 2019 at 12:02 PM Gábor Horváth  wrote:
>
> I reverted but I cannot reproduce this locally on a linux box. Is there any 
> way to get more information from the build bot (like preprocessed files?)?
>
> On Fri, 9 Aug 2019 at 11:38, Gábor Horváth  wrote:
>>
>> Hmm, strange. Looking into it! If I do not manage to find the root cause in 
>> a few minutes I will revert!
>>
>> On Fri, 9 Aug 2019 at 11:32, Jonas Devlieghere  wrote:
>>>
>>> I think this is causing a stage2 failure:
>>> http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/124/consoleFull#-95886206949ba4694-19c4-4d7e-bec5-911270d8a58c
>>>
>>> On Fri, Aug 9, 2019 at 10:41 AM Gabor Horvath via cfe-commits
>>>  wrote:
>>> >
>>> > Author: xazax
>>> > Date: Fri Aug  9 10:42:41 2019
>>> > New Revision: 368459
>>> >
>>> > URL: http://llvm.org/viewvc/llvm-project?rev=368459&view=rev
>>> > Log:
>>> > Fix a build bot failure and multiple warnings instances for range base 
>>> > for loops
>>> >
>>> > Modified:
>>> > cfe/trunk/lib/Sema/SemaInit.cpp
>>> > cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp
>>> >
>>> > Modified: cfe/trunk/lib/Sema/SemaInit.cpp
>>> > URL: 
>>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=368459&r1=368458&r2=368459&view=diff
>>> > ==
>>> > --- cfe/trunk/lib/Sema/SemaInit.cpp (original)
>>> > +++ cfe/trunk/lib/Sema/SemaInit.cpp Fri Aug  9 10:42:41 2019
>>> > @@ -6616,7 +6616,7 @@ static void handleGslAnnotatedTypes(Indi
>>> >  return;
>>> >} else if (auto *OCE = dyn_cast(Call)) {
>>> >  FunctionDecl *Callee = OCE->getDirectCallee();
>>> > -if (Callee->isCXXInstanceMember() &&
>>> > +if (Callee && Callee->isCXXInstanceMember() &&
>>> >  shouldTrackImplicitObjectArg(cast(Callee)))
>>> >VisitPointerArg(Callee, OCE->getArg(0));
>>> >  return;
>>> > @@ -7070,8 +7070,11 @@ static SourceRange nextPathEntryRange(co
>>> >// supporting lifetime extension.
>>> >break;
>>> >
>>> > -case IndirectLocalPathEntry::DefaultInit:
>>> >  case IndirectLocalPathEntry::VarInit:
>>> > +  if (cast(Path[I].D)->isImplicit())
>>> > +return SourceRange();
>>> > +  LLVM_FALLTHROUGH;
>>> > +case IndirectLocalPathEntry::DefaultInit:
>>> >return Path[I].E->getSourceRange();
>>> >  }
>>> >}
>>> > @@ -7133,7 +7136,7 @@ void Sema::checkInitializerLifetime(cons
>>> >  return false;
>>> >}
>>> >
>>> > -  if (IsGslPtrInitWithGslTempOwner) {
>>> > +  if (IsGslPtrInitWithGslTempOwner && DiagLoc.isValid()) {
>>> >  Diag(DiagLoc, diag::warn_dangling_lifetime_pointer) << DiagRange;
>>> >  return false;
>>> >}
>>> >
>>> > Modified: cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp
>>> > URL: 
>>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp?rev=368459&r1=368458&r2=368459&view=diff
>>> > ==
>>> > --- cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp (original)
>>> > +++ cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp Fri Aug  9 
>>> > 10:42:41 2019
>>> > @@ -201,6 +201,13 @@ void danglingReferenceFromTempOwner() {
>>> >  std::vector getTempVec();
>>> >  std::optional> getTempOptVec();
>>> >
>>> > +void testLoops() {
>>> > +  for (auto i : getTempVec()) // ok
>>> > +;
>>> > +  for (auto i : *getTempOptVec()) // expected-warning {{object backing 
>>> > the pointer will be destroyed at the end of the full-expression}}
>>> > +;
>>> > +}
>>> > +
>>> >  int &usedToBeFalsePositive(std::vector &v) {
>>> >std::vector::iterator it = v.begin();
>>> >int& value = *it;
>>> >
>>> >
>>> > ___
>>> > cfe-commits mailing list
>>> > cfe-commits@lists.llvm.org
>>> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r368459 - Fix a build bot failure and multiple warnings instances for range base for loops

2019-08-09 Thread Jonas Devlieghere via cfe-commits
I think this is causing a stage2 failure:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/124/consoleFull#-95886206949ba4694-19c4-4d7e-bec5-911270d8a58c

On Fri, Aug 9, 2019 at 10:41 AM Gabor Horvath via cfe-commits
 wrote:
>
> Author: xazax
> Date: Fri Aug  9 10:42:41 2019
> New Revision: 368459
>
> URL: http://llvm.org/viewvc/llvm-project?rev=368459&view=rev
> Log:
> Fix a build bot failure and multiple warnings instances for range base for 
> loops
>
> Modified:
> cfe/trunk/lib/Sema/SemaInit.cpp
> cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaInit.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=368459&r1=368458&r2=368459&view=diff
> ==
> --- cfe/trunk/lib/Sema/SemaInit.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaInit.cpp Fri Aug  9 10:42:41 2019
> @@ -6616,7 +6616,7 @@ static void handleGslAnnotatedTypes(Indi
>  return;
>} else if (auto *OCE = dyn_cast(Call)) {
>  FunctionDecl *Callee = OCE->getDirectCallee();
> -if (Callee->isCXXInstanceMember() &&
> +if (Callee && Callee->isCXXInstanceMember() &&
>  shouldTrackImplicitObjectArg(cast(Callee)))
>VisitPointerArg(Callee, OCE->getArg(0));
>  return;
> @@ -7070,8 +7070,11 @@ static SourceRange nextPathEntryRange(co
>// supporting lifetime extension.
>break;
>
> -case IndirectLocalPathEntry::DefaultInit:
>  case IndirectLocalPathEntry::VarInit:
> +  if (cast(Path[I].D)->isImplicit())
> +return SourceRange();
> +  LLVM_FALLTHROUGH;
> +case IndirectLocalPathEntry::DefaultInit:
>return Path[I].E->getSourceRange();
>  }
>}
> @@ -7133,7 +7136,7 @@ void Sema::checkInitializerLifetime(cons
>  return false;
>}
>
> -  if (IsGslPtrInitWithGslTempOwner) {
> +  if (IsGslPtrInitWithGslTempOwner && DiagLoc.isValid()) {
>  Diag(DiagLoc, diag::warn_dangling_lifetime_pointer) << DiagRange;
>  return false;
>}
>
> Modified: cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp?rev=368459&r1=368458&r2=368459&view=diff
> ==
> --- cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp (original)
> +++ cfe/trunk/test/Sema/warn-lifetime-analysis-nocfg.cpp Fri Aug  9 10:42:41 
> 2019
> @@ -201,6 +201,13 @@ void danglingReferenceFromTempOwner() {
>  std::vector getTempVec();
>  std::optional> getTempOptVec();
>
> +void testLoops() {
> +  for (auto i : getTempVec()) // ok
> +;
> +  for (auto i : *getTempOptVec()) // expected-warning {{object backing the 
> pointer will be destroyed at the end of the full-expression}}
> +;
> +}
> +
>  int &usedToBeFalsePositive(std::vector &v) {
>std::vector::iterator it = v.begin();
>int& value = *it;
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r367271 - [DependencyCollector] Make maybeAddDependency virtual (NFC)

2019-07-29 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Mon Jul 29 16:02:11 2019
New Revision: 367271

URL: http://llvm.org/viewvc/llvm-project?rev=367271&view=rev
Log:
[DependencyCollector] Make maybeAddDependency virtual (NFC)

Make DependencyCollector::maybeAddDependency, just like its other
methods, which I made virtual a while ago. The motivation for this
change is still the LLDB reproducer.

Modified:
cfe/trunk/include/clang/Frontend/Utils.h

Modified: cfe/trunk/include/clang/Frontend/Utils.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/Utils.h?rev=367271&r1=367270&r2=367271&view=diff
==
--- cfe/trunk/include/clang/Frontend/Utils.h (original)
+++ cfe/trunk/include/clang/Frontend/Utils.h Mon Jul 29 16:02:11 2019
@@ -99,11 +99,11 @@ public:
   /// Return true if system files should be passed to sawDependency().
   virtual bool needSystemDependencies() { return false; }
 
-  // implementation detail
   /// Add a dependency \p Filename if it has not been seen before and
   /// sawDependency() returns true.
-  void maybeAddDependency(StringRef Filename, bool FromModule, bool IsSystem,
-  bool IsModuleFile, bool IsMissing);
+  virtual void maybeAddDependency(StringRef Filename, bool FromModule,
+  bool IsSystem, bool IsModuleFile,
+  bool IsMissing);
 
 protected:
   /// Return true if the filename was added to the list of dependencies, false


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r366447 - [CMake] Don't set Python_ADDITIONAL_VERSIONS

2019-07-18 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Thu Jul 18 08:17:42 2019
New Revision: 366447

URL: http://llvm.org/viewvc/llvm-project?rev=366447&view=rev
Log:
[CMake] Don't set Python_ADDITIONAL_VERSIONS

Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's
Python support to 2.7. Now that both LLVM and LLDB both support Python
3, there's no longer a need to put an arbitrary limit on this.

However, instead of removing the variable, r365692 expanded the list,
which has the (presumably unintentional) side-effect of expression
preference for Python 3.

Instead, as Michal proposed in the original code review, we should just
not set the list at all, and let CMake pick whatever Python interpreter
you have in your path.

This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm,
clang and lld. I've also updated the docs with the default behavior and
how to force a different Python version to be used.

Differential revision: https://reviews.llvm.org/D64894

Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=366447&r1=366446&r2=366447&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Thu Jul 18 08:17:42 2019
@@ -129,7 +129,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY 
${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
 
   if(LLVM_INCLUDE_TESTS)
-set(Python_ADDITIONAL_VERSIONS 2.7)
 include(FindPythonInterp)
 if(NOT PYTHONINTERP_FOUND)
   message(FATAL_ERROR


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r360109 - Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an attribute declaration"

2019-05-07 Thread Jonas Devlieghere via cfe-commits
Hi Leonard,

My personal rule of thumb is that if I can fix it in something like 30
minutes or less, I'll leave the bot red and commit a fix. Otherwise I'll
revert my change. The problem with leaving the bot red is that if something
else breaks, that person doesn't get a signal, and issue start to pile up.

When I see a bot is red and it's blocking me, I will usually send an e-mail
and wait about the same time for a reply, before reverting the change
myself.

Cheers,
Jonas

On Tue, May 7, 2019 at 11:20 AM Leonard Chan  wrote:

> Thanks! It turns out that we weren't running debuginfo-tests. Trying to
> find a mac I can ssh into to reproduce this.
>
> Another side question: is there usually an etiquette for how long a
> greendragon bot is allowed to stay broken? I don't want to leave it that
> way for too long while working on my fix if it bothers others too much.
>
> Thanks,
> Leonard
>
> On Tue, May 7, 2019 at 10:13 AM Jonas Devlieghere 
> wrote:
>
>> Hi Leonard,
>>
>> The test that is asserting is part of the debuginfo test. (
>> https://github.com/llvm-project/debuginfo-tests)
>> The reason that it's only failing on the non-incremental bot is because
>> the incremental one isn't running those, I believe.
>>
>> RA stands for Release/Asserts.
>>
>> Hope that helps!
>>
>> Cheers,
>> Jonas
>>
>> On Tue, May 7, 2019 at 9:44 AM Leonard Chan 
>> wrote:
>>
>>> Yup, sorry for the delay. I submitted it overnight thinking it would be
>>> fixed this time. I have one more way that I think should fix it, but before
>>> trying it out, do you know any tips on how I can try to reproduce this
>>> locally? I see that you're running these on an x64 mac, but I can't seem to
>>> trigger this on our own mac builders. Also as a side question, do you what
>>> RA stands for in "Clang Stage 1: cmake, incremental RA, using system
>>> compiler
>>> "?
>>> It seems that I'm only breaking the non-incremental RA jobs, bit the
>>> incremental one still works fine with my change.
>>>
>>> Thanks,
>>> Leonard
>>>
>>> On Tue, May 7, 2019, 09:26 Jonas Devlieghere 
>>> wrote:
>>>
 Hi Leonard,

 It appears that your patch is still triggering an assertion on
 GreenDragon:
 http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/56255/consoleFull#312501878d489585b-5106-414a-ac11-3ff90657619c

 Can you please have a look?

 Thanks,
 Jonas


 On Mon, May 6, 2019 at 8:17 PM Leonard Chan via cfe-commits <
 cfe-commits@lists.llvm.org> wrote:

> Author: leonardchan
> Date: Mon May  6 20:20:17 2019
> New Revision: 360109
>
> URL: http://llvm.org/viewvc/llvm-project?rev=360109&view=rev
> Log:
> Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is
> an attribute declaration"
>
> Updated with fix for read of uninitialized memory.
>
> Added:
> cfe/trunk/test/Frontend/macro_defined_type.cpp
> cfe/trunk/test/Sema/address_space_print_macro.c
> Modified:
> cfe/trunk/include/clang/AST/ASTContext.h
> cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
> cfe/trunk/include/clang/AST/Type.h
> cfe/trunk/include/clang/AST/TypeLoc.h
> cfe/trunk/include/clang/AST/TypeNodes.def
> cfe/trunk/include/clang/Parse/Parser.h
> cfe/trunk/include/clang/Sema/ParsedAttr.h
> cfe/trunk/include/clang/Sema/Sema.h
> cfe/trunk/include/clang/Serialization/ASTBitCodes.h
> cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
> cfe/trunk/lib/AST/ASTContext.cpp
> cfe/trunk/lib/AST/ASTDiagnostic.cpp
> cfe/trunk/lib/AST/ASTStructuralEquivalence.cpp
> cfe/trunk/lib/AST/ItaniumMangle.cpp
> cfe/trunk/lib/AST/Type.cpp
> cfe/trunk/lib/AST/TypePrinter.cpp
> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Sema/SemaExpr.cpp
> cfe/trunk/lib/Sema/SemaStmt.cpp
> cfe/trunk/lib/Sema/SemaType.cpp
> cfe/trunk/lib/Sema/TreeTransform.h
> cfe/trunk/lib/Serialization/ASTReader.cpp
> cfe/trunk/lib/Serialization/ASTWriter.cpp
> cfe/trunk/test/Sema/address_spaces.c
> cfe/trunk/test/SemaObjC/externally-retained.m
> cfe/trunk/test/SemaObjC/gc-attributes.m
> cfe/trunk/test/SemaObjC/mrc-weak.m
> cfe/trunk/test/SemaObjCXX/gc-attributes.mm
> cfe/trunk/tools/libclang/CIndex.cpp
>
> Modified: cfe/trunk/include/clang/AST/ASTContext.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=360109&r1=360108&r2=360109&view=diff
>
> ==
> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> +++ cfe/trunk/include/clang/AST/ASTContext.h Mon May  6 20:20

r360192 - Revert "[OpenMP][Clang] Support for target math functions"

2019-05-07 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Tue May  7 14:08:15 2019
New Revision: 360192

URL: http://llvm.org/viewvc/llvm-project?rev=360192&view=rev
Log:
Revert "[OpenMP][Clang] Support for target math functions"

This commit appears to be breaking stage-2 builds on GreenDragon. The
OpenMP wrappers for cmath and math.h are copied into the root of the
resource directory and cause a cyclic dependency in module 'Darwin':
Darwin -> std -> Darwin. This blows up when CMake is testing for modules
support and breaks all stage 2 module builds, including the ThinLTO bot
and all LLDB bots.

CMake Error at cmake/modules/HandleLLVMOptions.cmake:497 (message):
  LLVM_ENABLE_MODULES is not supported by this compiler

Removed:
cfe/trunk/lib/Headers/openmp_wrappers/
cfe/trunk/test/Headers/Inputs/include/cmath
cfe/trunk/test/Headers/Inputs/include/limits
cfe/trunk/test/Headers/nvptx_device_cmath_functions.c
cfe/trunk/test/Headers/nvptx_device_cmath_functions.cpp
cfe/trunk/test/Headers/nvptx_device_math_functions.c
cfe/trunk/test/Headers/nvptx_device_math_functions.cpp
Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/lib/Headers/CMakeLists.txt
cfe/trunk/lib/Headers/__clang_cuda_cmath.h
cfe/trunk/lib/Headers/__clang_cuda_device_functions.h
cfe/trunk/lib/Headers/__clang_cuda_libdevice_declares.h
cfe/trunk/lib/Headers/__clang_cuda_math_forward_declares.h
cfe/trunk/test/Driver/openmp-offload-gpu.c
cfe/trunk/test/Headers/Inputs/include/math.h

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=360192&r1=360191&r2=360192&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Tue May  7 14:08:15 2019
@@ -1151,21 +1151,6 @@ void Clang::AddPreprocessingOptions(Comp
   if (JA.isOffloading(Action::OFK_Cuda))
 getToolChain().AddCudaIncludeArgs(Args, CmdArgs);
 
-  // If we are offloading to a target via OpenMP we need to include the
-  // openmp_wrappers folder which contains alternative system headers.
-  if (JA.isDeviceOffloading(Action::OFK_OpenMP) &&
-  getToolChain().getTriple().isNVPTX()){
-if (!Args.hasArg(options::OPT_nobuiltininc)) {
-  // Add openmp_wrappers/* to our system include path.  This lets us wrap
-  // standard library headers.
-  SmallString<128> P(D.ResourceDir);
-  llvm::sys::path::append(P, "include");
-  llvm::sys::path::append(P, "openmp_wrappers");
-  CmdArgs.push_back("-internal-isystem");
-  CmdArgs.push_back(Args.MakeArgString(P));
-}
-  }
-
   // Add -i* options, and automatically translate to
   // -include-pch/-include-pth for transparent PCH support. It's
   // wonky, but we include looking for .gch so we can support seamless

Modified: cfe/trunk/lib/Headers/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=360192&r1=360191&r2=360192&view=diff
==
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)
+++ cfe/trunk/lib/Headers/CMakeLists.txt Tue May  7 14:08:15 2019
@@ -33,9 +33,6 @@ set(files
   avxintrin.h
   bmi2intrin.h
   bmiintrin.h
-  openmp_wrappers/math.h
-  openmp_wrappers/cmath
-  openmp_wrappers/__clang_openmp_math.h
   __clang_cuda_builtin_vars.h
   __clang_cuda_cmath.h
   __clang_cuda_complex_builtins.h

Modified: cfe/trunk/lib/Headers/__clang_cuda_cmath.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/__clang_cuda_cmath.h?rev=360192&r1=360191&r2=360192&view=diff
==
--- cfe/trunk/lib/Headers/__clang_cuda_cmath.h (original)
+++ cfe/trunk/lib/Headers/__clang_cuda_cmath.h Tue May  7 14:08:15 2019
@@ -30,11 +30,7 @@
 // implementation.  Declaring in the global namespace and pulling into 
namespace
 // std covers all of the known knowns.
 
-#ifdef _OPENMP
-#define __DEVICE__ static __attribute__((always_inline))
-#else
 #define __DEVICE__ static __device__ __inline__ __attribute__((always_inline))
-#endif
 
 __DEVICE__ long long abs(long long __n) { return ::llabs(__n); }
 __DEVICE__ long abs(long __n) { return ::labs(__n); }
@@ -51,8 +47,6 @@ __DEVICE__ float exp(float __x) { return
 __DEVICE__ float fabs(float __x) { return ::fabsf(__x); }
 __DEVICE__ float floor(float __x) { return ::floorf(__x); }
 __DEVICE__ float fmod(float __x, float __y) { return ::fmodf(__x, __y); }
-// TODO: remove when variant is supported
-#ifndef _OPENMP
 __DEVICE__ int fpclassify(float __x) {
   return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
   FP_ZERO, __x);
@@ -61,7 +55,6 @@ __DEVICE__ int fpclassify(double __x) {
   return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
   FP_ZER

Re: r360109 - Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an attribute declaration"

2019-05-07 Thread Jonas Devlieghere via cfe-commits
Hi Leonard,

The test that is asserting is part of the debuginfo test. (
https://github.com/llvm-project/debuginfo-tests)
The reason that it's only failing on the non-incremental bot is because the
incremental one isn't running those, I believe.

RA stands for Release/Asserts.

Hope that helps!

Cheers,
Jonas

On Tue, May 7, 2019 at 9:44 AM Leonard Chan  wrote:

> Yup, sorry for the delay. I submitted it overnight thinking it would be
> fixed this time. I have one more way that I think should fix it, but before
> trying it out, do you know any tips on how I can try to reproduce this
> locally? I see that you're running these on an x64 mac, but I can't seem to
> trigger this on our own mac builders. Also as a side question, do you what
> RA stands for in "Clang Stage 1: cmake, incremental RA, using system
> compiler
> "?
> It seems that I'm only breaking the non-incremental RA jobs, bit the
> incremental one still works fine with my change.
>
> Thanks,
> Leonard
>
> On Tue, May 7, 2019, 09:26 Jonas Devlieghere 
> wrote:
>
>> Hi Leonard,
>>
>> It appears that your patch is still triggering an assertion on
>> GreenDragon:
>> http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/56255/consoleFull#312501878d489585b-5106-414a-ac11-3ff90657619c
>>
>> Can you please have a look?
>>
>> Thanks,
>> Jonas
>>
>>
>> On Mon, May 6, 2019 at 8:17 PM Leonard Chan via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: leonardchan
>>> Date: Mon May  6 20:20:17 2019
>>> New Revision: 360109
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=360109&view=rev
>>> Log:
>>> Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is
>>> an attribute declaration"
>>>
>>> Updated with fix for read of uninitialized memory.
>>>
>>> Added:
>>> cfe/trunk/test/Frontend/macro_defined_type.cpp
>>> cfe/trunk/test/Sema/address_space_print_macro.c
>>> Modified:
>>> cfe/trunk/include/clang/AST/ASTContext.h
>>> cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
>>> cfe/trunk/include/clang/AST/Type.h
>>> cfe/trunk/include/clang/AST/TypeLoc.h
>>> cfe/trunk/include/clang/AST/TypeNodes.def
>>> cfe/trunk/include/clang/Parse/Parser.h
>>> cfe/trunk/include/clang/Sema/ParsedAttr.h
>>> cfe/trunk/include/clang/Sema/Sema.h
>>> cfe/trunk/include/clang/Serialization/ASTBitCodes.h
>>> cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
>>> cfe/trunk/lib/AST/ASTContext.cpp
>>> cfe/trunk/lib/AST/ASTDiagnostic.cpp
>>> cfe/trunk/lib/AST/ASTStructuralEquivalence.cpp
>>> cfe/trunk/lib/AST/ItaniumMangle.cpp
>>> cfe/trunk/lib/AST/Type.cpp
>>> cfe/trunk/lib/AST/TypePrinter.cpp
>>> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>> cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
>>> cfe/trunk/lib/Parse/ParseDecl.cpp
>>> cfe/trunk/lib/Sema/SemaExpr.cpp
>>> cfe/trunk/lib/Sema/SemaStmt.cpp
>>> cfe/trunk/lib/Sema/SemaType.cpp
>>> cfe/trunk/lib/Sema/TreeTransform.h
>>> cfe/trunk/lib/Serialization/ASTReader.cpp
>>> cfe/trunk/lib/Serialization/ASTWriter.cpp
>>> cfe/trunk/test/Sema/address_spaces.c
>>> cfe/trunk/test/SemaObjC/externally-retained.m
>>> cfe/trunk/test/SemaObjC/gc-attributes.m
>>> cfe/trunk/test/SemaObjC/mrc-weak.m
>>> cfe/trunk/test/SemaObjCXX/gc-attributes.mm
>>> cfe/trunk/tools/libclang/CIndex.cpp
>>>
>>> Modified: cfe/trunk/include/clang/AST/ASTContext.h
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=360109&r1=360108&r2=360109&view=diff
>>>
>>> ==
>>> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
>>> +++ cfe/trunk/include/clang/AST/ASTContext.h Mon May  6 20:20:17 2019
>>> @@ -1441,6 +1441,9 @@ public:
>>>
>>>QualType getParenType(QualType NamedType) const;
>>>
>>> +  QualType getMacroQualifiedType(QualType UnderlyingTy,
>>> + const IdentifierInfo *MacroII) const;
>>> +
>>>QualType getElaboratedType(ElaboratedTypeKeyword Keyword,
>>>   NestedNameSpecifier *NNS, QualType
>>> NamedType,
>>>   TagDecl *OwnedTagDecl = nullptr) const;
>>>
>>> Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=360109&r1=360108&r2=360109&view=diff
>>>
>>> ==
>>> --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
>>> +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Mon May  6
>>> 20:20:17 2019
>>> @@ -1065,6 +1065,9 @@ DEF_TRAVERSE_TYPE(AttributedType,
>>>
>>>  DEF_TRAVERSE_TYPE(ParenType, { TRY_TO(TraverseType(T->getInnerType()));
>>> })
>>>
>>> +DEF_TRAVERSE_TYPE(MacroQualifiedType,
>>> +  { TRY_TO(TraverseType(T->getUnderlying

Re: r360109 - Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an attribute declaration"

2019-05-07 Thread Jonas Devlieghere via cfe-commits
Hi Leonard,

It appears that your patch is still triggering an assertion on GreenDragon:
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/56255/consoleFull#312501878d489585b-5106-414a-ac11-3ff90657619c

Can you please have a look?

Thanks,
Jonas


On Mon, May 6, 2019 at 8:17 PM Leonard Chan via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: leonardchan
> Date: Mon May  6 20:20:17 2019
> New Revision: 360109
>
> URL: http://llvm.org/viewvc/llvm-project?rev=360109&view=rev
> Log:
> Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an
> attribute declaration"
>
> Updated with fix for read of uninitialized memory.
>
> Added:
> cfe/trunk/test/Frontend/macro_defined_type.cpp
> cfe/trunk/test/Sema/address_space_print_macro.c
> Modified:
> cfe/trunk/include/clang/AST/ASTContext.h
> cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
> cfe/trunk/include/clang/AST/Type.h
> cfe/trunk/include/clang/AST/TypeLoc.h
> cfe/trunk/include/clang/AST/TypeNodes.def
> cfe/trunk/include/clang/Parse/Parser.h
> cfe/trunk/include/clang/Sema/ParsedAttr.h
> cfe/trunk/include/clang/Sema/Sema.h
> cfe/trunk/include/clang/Serialization/ASTBitCodes.h
> cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
> cfe/trunk/lib/AST/ASTContext.cpp
> cfe/trunk/lib/AST/ASTDiagnostic.cpp
> cfe/trunk/lib/AST/ASTStructuralEquivalence.cpp
> cfe/trunk/lib/AST/ItaniumMangle.cpp
> cfe/trunk/lib/AST/Type.cpp
> cfe/trunk/lib/AST/TypePrinter.cpp
> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Sema/SemaExpr.cpp
> cfe/trunk/lib/Sema/SemaStmt.cpp
> cfe/trunk/lib/Sema/SemaType.cpp
> cfe/trunk/lib/Sema/TreeTransform.h
> cfe/trunk/lib/Serialization/ASTReader.cpp
> cfe/trunk/lib/Serialization/ASTWriter.cpp
> cfe/trunk/test/Sema/address_spaces.c
> cfe/trunk/test/SemaObjC/externally-retained.m
> cfe/trunk/test/SemaObjC/gc-attributes.m
> cfe/trunk/test/SemaObjC/mrc-weak.m
> cfe/trunk/test/SemaObjCXX/gc-attributes.mm
> cfe/trunk/tools/libclang/CIndex.cpp
>
> Modified: cfe/trunk/include/clang/AST/ASTContext.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=360109&r1=360108&r2=360109&view=diff
>
> ==
> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> +++ cfe/trunk/include/clang/AST/ASTContext.h Mon May  6 20:20:17 2019
> @@ -1441,6 +1441,9 @@ public:
>
>QualType getParenType(QualType NamedType) const;
>
> +  QualType getMacroQualifiedType(QualType UnderlyingTy,
> + const IdentifierInfo *MacroII) const;
> +
>QualType getElaboratedType(ElaboratedTypeKeyword Keyword,
>   NestedNameSpecifier *NNS, QualType NamedType,
>   TagDecl *OwnedTagDecl = nullptr) const;
>
> Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=360109&r1=360108&r2=360109&view=diff
>
> ==
> --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
> +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Mon May  6 20:20:17
> 2019
> @@ -1065,6 +1065,9 @@ DEF_TRAVERSE_TYPE(AttributedType,
>
>  DEF_TRAVERSE_TYPE(ParenType, { TRY_TO(TraverseType(T->getInnerType())); })
>
> +DEF_TRAVERSE_TYPE(MacroQualifiedType,
> +  { TRY_TO(TraverseType(T->getUnderlyingType())); })
> +
>  DEF_TRAVERSE_TYPE(ElaboratedType, {
>if (T->getQualifier()) {
>  TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
> @@ -1308,6 +1311,9 @@ DEF_TRAVERSE_TYPELOC(InjectedClassNameTy
>
>  DEF_TRAVERSE_TYPELOC(ParenType, {
> TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); })
>
> +DEF_TRAVERSE_TYPELOC(MacroQualifiedType,
> + { TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); })
> +
>  DEF_TRAVERSE_TYPELOC(AttributedType,
>   { TRY_TO(TraverseTypeLoc(TL.getModifiedLoc())); })
>
>
> Modified: cfe/trunk/include/clang/AST/Type.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=360109&r1=360108&r2=360109&view=diff
>
> ==
> --- cfe/trunk/include/clang/AST/Type.h (original)
> +++ cfe/trunk/include/clang/AST/Type.h Mon May  6 20:20:17 2019
> @@ -4184,6 +4184,41 @@ public:
>static bool classof(const Type *T) { return T->getTypeClass() ==
> Typedef; }
>  };
>
> +/// Sugar type that represents a type that was qualified by a qualifier
> written
> +/// as a macro invocation.
> +class MacroQualifiedType : public Type {
> +  friend class ASTContext; // ASTContext creates these.
> +
> +  QualType UnderlyingTy;
> +  const IdentifierInfo *Ma

r353882 - Make ModuleDependencyCollector's method virtual (NFC)

2019-02-12 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Tue Feb 12 13:45:14 2019
New Revision: 353882

URL: http://llvm.org/viewvc/llvm-project?rev=353882&view=rev
Log:
Make ModuleDependencyCollector's method virtual (NFC)

For reproducers in LLDB we want to hook up into the existing clang
infrastructure. To make that happen we need to be able to override the
ModuleDependencyCollector's methods.

The alternative was to inherit from the DependencyCollector directly,
but that would mean re-implementing the ModuleDependencyListener and the
ModuleDependencyPPCallbacks and ModuleDependencyMMCallbacks.

Differential revision: https://reviews.llvm.org/D58072

Modified:
cfe/trunk/include/clang/Frontend/Utils.h

Modified: cfe/trunk/include/clang/Frontend/Utils.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/Utils.h?rev=353882&r1=353881&r2=353882&view=diff
==
--- cfe/trunk/include/clang/Frontend/Utils.h (original)
+++ cfe/trunk/include/clang/Frontend/Utils.h Tue Feb 12 13:45:14 2019
@@ -145,18 +145,18 @@ public:
   ~ModuleDependencyCollector() override { writeFileMap(); }
 
   StringRef getDest() { return DestDir; }
-  bool insertSeen(StringRef Filename) { return Seen.insert(Filename).second; }
-  void addFile(StringRef Filename, StringRef FileDst = {});
+  virtual bool insertSeen(StringRef Filename) { return 
Seen.insert(Filename).second; }
+  virtual void addFile(StringRef Filename, StringRef FileDst = {});
 
-  void addFileMapping(StringRef VPath, StringRef RPath) {
+  virtual void addFileMapping(StringRef VPath, StringRef RPath) {
 VFSWriter.addFileMapping(VPath, RPath);
   }
 
   void attachToPreprocessor(Preprocessor &PP) override;
   void attachToASTReader(ASTReader &R) override;
 
-  void writeFileMap();
-  bool hasErrors() { return HasErrors; }
+  virtual void writeFileMap();
+  virtual bool hasErrors() { return HasErrors; }
 };
 
 /// AttachDependencyGraphGen - Create a dependency graph generator, and attach


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r352605 - [ModuleDependencyCollector] Use llvm::sys::fs::real_path (NFC)

2019-01-29 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Tue Jan 29 22:26:26 2019
New Revision: 352605

URL: http://llvm.org/viewvc/llvm-project?rev=352605&view=rev
Log:
[ModuleDependencyCollector] Use llvm::sys::fs::real_path (NFC)

Use the real_path implementation from llvm::sys::fs::real_path instead
of having a custom implementation in the ModuleDependencyCollector.

Differential revision: https://reviews.llvm.org/D57411

Modified:
cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp

Modified: cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp?rev=352605&r1=352604&r2=352605&view=diff
==
--- cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp (original)
+++ cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp Tue Jan 29 22:26:26 
2019
@@ -98,24 +98,6 @@ struct ModuleDependencyMMCallbacks : pub
 
 }
 
-// TODO: move this to Support/Path.h and check for HAVE_REALPATH?
-static bool real_path(StringRef SrcPath, SmallVectorImpl &RealPath) {
-#ifdef LLVM_ON_UNIX
-  char CanonicalPath[PATH_MAX];
-
-  // TODO: emit a warning in case this fails...?
-  if (!realpath(SrcPath.str().c_str(), CanonicalPath))
-return false;
-
-  SmallString<256> RPath(CanonicalPath);
-  RealPath.swap(RPath);
-  return true;
-#else
-  // FIXME: Add support for systems without realpath.
-  return false;
-#endif
-}
-
 void ModuleDependencyCollector::attachToASTReader(ASTReader &R) {
   R.addListener(llvm::make_unique(*this));
 }
@@ -130,7 +112,7 @@ void ModuleDependencyCollector::attachTo
 static bool isCaseSensitivePath(StringRef Path) {
   SmallString<256> TmpDest = Path, UpperDest, RealDest;
   // Remove component traversals, links, etc.
-  if (!real_path(Path, TmpDest))
+  if (llvm::sys::fs::real_path(Path, TmpDest))
 return true; // Current default value in vfs.yaml
   Path = TmpDest;
 
@@ -140,7 +122,7 @@ static bool isCaseSensitivePath(StringRe
   // already expects when sensitivity isn't setup.
   for (auto &C : Path)
 UpperDest.push_back(toUppercase(C));
-  if (real_path(UpperDest, RealDest) && Path.equals(RealDest))
+  if (!llvm::sys::fs::real_path(UpperDest, RealDest) && Path.equals(RealDest))
 return false;
   return true;
 }
@@ -186,7 +168,7 @@ bool ModuleDependencyCollector::getRealP
   // Computing the real path is expensive, cache the search through the
   // parent path directory.
   if (DirWithSymLink == SymLinkMap.end()) {
-if (!real_path(Dir, RealPath))
+if (llvm::sys::fs::real_path(Dir, RealPath))
   return false;
 SymLinkMap[Dir] = RealPath.str();
   } else {


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r346675 - Revert "Make clang-based tools find libc++ on MacOS"

2018-11-12 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Mon Nov 12 08:59:50 2018
New Revision: 346675

URL: http://llvm.org/viewvc/llvm-project?rev=346675&view=rev
Log:
Revert "Make clang-based tools find libc++ on MacOS"

This breaks the LLDB bots.

Removed:
cfe/trunk/test/Tooling/Inputs/mock-libcxx/include/c++/v1/mock_vector
cfe/trunk/test/Tooling/clang-check-mac-libcxx-abspath.cpp
cfe/trunk/test/Tooling/clang-check-mac-libcxx-relpath.cpp
Modified:
cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
cfe/trunk/lib/Tooling/Tooling.cpp

Modified: cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearchOptions.h?rev=346675&r1=346674&r2=346675&view=diff
==
--- cfe/trunk/include/clang/Lex/HeaderSearchOptions.h (original)
+++ cfe/trunk/include/clang/Lex/HeaderSearchOptions.h Mon Nov 12 08:59:50 2018
@@ -108,13 +108,6 @@ public:
   /// etc.).
   std::string ResourceDir;
 
-  /// Compiler install dir as detected by the Driver.
-  /// This is typically the directory that contains the clang executable, i.e.
-  /// the 'bin/' subdir of a clang distribution.
-  /// Only used to add include dirs for libc++ on Darwin. Please avoid relying
-  /// on this field for other purposes.
-  std::string InstallDir;
-
   /// The directory used for the module cache.
   std::string ModuleCachePath;
 

Modified: cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp?rev=346675&r1=346674&r2=346675&view=diff
==
--- cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp (original)
+++ cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp Mon Nov 12 
08:59:50 2018
@@ -11,18 +11,17 @@
 //
 
//===--===//
 
+#include "clang/Frontend/Utils.h"
 #include "clang/Basic/DiagnosticOptions.h"
-#include "clang/Driver/Action.h"
 #include "clang/Driver/Compilation.h"
 #include "clang/Driver/Driver.h"
+#include "clang/Driver/Action.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/Tool.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
-#include "clang/Frontend/Utils.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Support/Host.h"
-#include "llvm/Support/Path.h"
 using namespace clang;
 using namespace llvm::opt;
 
@@ -103,8 +102,5 @@ std::unique_ptr clan
  CCArgs.size(),
  *Diags))
 return nullptr;
-  // Patch up the install dir, so we find the same standard library as the
-  // original compiler on MacOS.
-  CI->getHeaderSearchOpts().InstallDir = TheDriver.getInstalledDir();
   return CI;
 }

Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=346675&r1=346674&r2=346675&view=diff
==
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Mon Nov 12 08:59:50 2018
@@ -476,9 +476,14 @@ void InitHeaderSearch::AddDefaultInclude
   if (triple.isOSDarwin()) {
 // On Darwin, libc++ may be installed alongside the compiler in
 // include/c++/v1.
-if (!HSOpts.InstallDir.empty()) {
-  // Get from foo/bin to foo.
-  SmallString<128> P(llvm::sys::path::parent_path(HSOpts.InstallDir));
+if (!HSOpts.ResourceDir.empty()) {
+  // Remove version from foo/lib/clang/version
+  StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir);
+  // Remove clang from foo/lib/clang
+  StringRef Lib = llvm::sys::path::parent_path(NoVer);
+  // Remove lib from foo/lib
+  SmallString<128> P = llvm::sys::path::parent_path(Lib);
+
   // Get foo/include/c++/v1
   llvm::sys::path::append(P, "include", "c++", "v1");
   AddUnmappedPath(P, CXXSystem, false);

Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=346675&r1=346674&r2=346675&view=diff
==
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Mon Nov 12 08:59:50 2018
@@ -327,9 +327,6 @@ bool ToolInvocation::run() {
 Invocation->getPreprocessorOpts().addRemappedFile(It.getKey(),
   Input.release());
   }
-  // Patch up the install dir, so we find the same standard library as the
-  // original compiler on MacOS.
-  In

r346601 - Pass the function type instead of the return type to FunctionDecl::Create

2018-11-10 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Sat Nov 10 16:56:15 2018
New Revision: 346601

URL: http://llvm.org/viewvc/llvm-project?rev=346601&view=rev
Log:
Pass the function type instead of the return type to FunctionDecl::Create

Fix places where the return type of a FunctionDecl was being used in
place of the function type

FunctionDecl::Create() takes as its T parameter the type of function
that should be created, not the return type. Passing in the return type
looks to have been copypasta'd around a bit, but the number of correct
usages outweighs the incorrect ones so I've opted for keeping what T is
the same and fixing up the call sites instead.

This fixes a crash in Clang when attempting to compile the following
snippet of code with -fblocks -fsanitize=function -x objective-c++ (my
original repro case):

  void g(void(^)());
  void f()
  {
  __block int a = 0;
g(^(){ a++; });
  }

as well as the following which only requires -fsanitize=function -x c++:

  void f(char * buf)
  {
  __builtin_os_log_format(buf, "");
  }

Patch by: Ben (bobsayshilol)

Differential revision: https://reviews.llvm.org/D53263

Added:
cfe/trunk/test/CodeGenObjCXX/crash-function-type.mm
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/lib/CodeGen/CGNonTrivialStruct.cpp
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=346601&r1=346600&r2=346601&view=diff
==
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Sat Nov 10 16:56:15 2018
@@ -2652,6 +2652,7 @@ FunctionDecl::FunctionDecl(Kind DK, ASTC
  StartLoc),
   DeclContext(DK), redeclarable_base(C), ODRHash(0),
   EndRangeLoc(NameInfo.getEndLoc()), DNLoc(NameInfo.getInfo()) {
+  assert(T.isNull() || T->isFunctionType());
   setStorageClass(S);
   setInlineSpecified(isInlineSpecified);
   setExplicitSpecified(false);

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=346601&r1=346600&r2=346601&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sat Nov 10 16:56:15 2018
@@ -2008,16 +2008,16 @@ CodeGenFunction::GenerateCopyHelperFunct
 
   ASTContext &C = getContext();
 
+  QualType ReturnTy = C.VoidTy;
+
   FunctionArgList args;
-  ImplicitParamDecl DstDecl(getContext(), C.VoidPtrTy,
-ImplicitParamDecl::Other);
+  ImplicitParamDecl DstDecl(C, C.VoidPtrTy, ImplicitParamDecl::Other);
   args.push_back(&DstDecl);
-  ImplicitParamDecl SrcDecl(getContext(), C.VoidPtrTy,
-ImplicitParamDecl::Other);
+  ImplicitParamDecl SrcDecl(C, C.VoidPtrTy, ImplicitParamDecl::Other);
   args.push_back(&SrcDecl);
 
   const CGFunctionInfo &FI =
-CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, args);
+  CGM.getTypes().arrangeBuiltinFunctionDeclaration(ReturnTy, args);
 
   // FIXME: it would be nice if these were mergeable with things with
   // identical semantics.
@@ -2027,20 +2027,20 @@ CodeGenFunction::GenerateCopyHelperFunct
 llvm::Function::Create(LTy, llvm::GlobalValue::LinkOnceODRLinkage,
FuncName, &CGM.getModule());
 
-  IdentifierInfo *II
-= &CGM.getContext().Idents.get(FuncName);
+  IdentifierInfo *II = &C.Idents.get(FuncName);
 
-  FunctionDecl *FD = FunctionDecl::Create(C,
-  C.getTranslationUnitDecl(),
-  SourceLocation(),
-  SourceLocation(), II, C.VoidTy,
-  nullptr, SC_Static,
-  false,
-  false);
+  SmallVector ArgTys;
+  ArgTys.push_back(C.VoidPtrTy);
+  ArgTys.push_back(C.VoidPtrTy);
+  QualType FunctionTy = C.getFunctionType(ReturnTy, ArgTys, {});
+
+  FunctionDecl *FD = FunctionDecl::Create(
+  C, C.getTranslationUnitDecl(), SourceLocation(), SourceLocation(), II,
+  FunctionTy, nullptr, SC_Static, false, false);
 
   setBlockHelperAttributesVisibility(blockInfo.CapturesNonExternalType, Fn, FI,
  CGM);
-  StartFunction(FD, C.VoidTy, Fn, FI, args);
+  StartFunction(FD, ReturnTy, Fn, FI, args);
   ApplyDebugLocation NL{*this, blockInfo.getBlockExpr()->getBeginLoc()};
   llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();
 
@@ -2201,13 +2201,14 @@ CodeGenFunction::GenerateDestroyHelperFu
 
   ASTContext &C = getContext();
 
+  QualType

[clang-tools-extra] r344140 - Lift VFS from clang to llvm (NFC)

2018-10-10 Thread Jonas Devlieghere via cfe-commits
Author: jdevlieghere
Date: Wed Oct 10 06:27:25 2018
New Revision: 344140

URL: http://llvm.org/viewvc/llvm-project?rev=344140&view=rev
Log:
Lift VFS from clang to llvm (NFC)

This patch moves the virtual file system form clang to llvm so it can be
used by more projects.

Concretely the patch:
 - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support.
 - Moves the corresponding unit test from clang to llvm.
 - Moves the vfs namespace from clang::vfs to llvm::vfs.
 - Formats the lines affected by this change, mostly this is the result of
   the added llvm namespace.

RFC on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html

Differential revision: https://reviews.llvm.org/D52783

Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
clang-tools-extra/trunk/clang-tidy/ClangTidy.h
clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp
clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.h
clang-tools-extra/trunk/clangd/ClangdUnit.cpp
clang-tools-extra/trunk/clangd/ClangdUnit.h
clang-tools-extra/trunk/clangd/CodeComplete.cpp
clang-tools-extra/trunk/clangd/CodeComplete.h
clang-tools-extra/trunk/clangd/Compiler.cpp
clang-tools-extra/trunk/clangd/Compiler.h
clang-tools-extra/trunk/clangd/FS.cpp
clang-tools-extra/trunk/clangd/FS.h
clang-tools-extra/trunk/clangd/FSProvider.h
clang-tools-extra/trunk/clangd/Headers.h
clang-tools-extra/trunk/unittests/change-namespace/ChangeNamespaceTests.cpp
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h
clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
clang-tools-extra/trunk/unittests/clangd/FSTests.cpp
clang-tools-extra/trunk/unittests/clangd/SymbolCollectorTests.cpp
clang-tools-extra/trunk/unittests/clangd/TestFS.h
clang-tools-extra/trunk/unittests/include-fixer/IncludeFixerTest.cpp

clang-tools-extra/trunk/unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp?rev=344140&r1=344139&r2=344140&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp Wed Oct 10 06:27:25 2018
@@ -96,7 +96,7 @@ private:
 class ErrorReporter {
 public:
   ErrorReporter(ClangTidyContext &Context, bool ApplyFixes,
-llvm::IntrusiveRefCntPtr BaseFS)
+llvm::IntrusiveRefCntPtr BaseFS)
   : Files(FileSystemOptions(), BaseFS), DiagOpts(new DiagnosticOptions()),
 DiagPrinter(new TextDiagnosticPrinter(llvm::outs(), &*DiagOpts)),
 Diags(IntrusiveRefCntPtr(new DiagnosticIDs), &*DiagOpts,
@@ -503,7 +503,7 @@ getCheckOptions(const ClangTidyOptions &
 void runClangTidy(clang::tidy::ClangTidyContext &Context,
   const CompilationDatabase &Compilations,
   ArrayRef InputFiles,
-  llvm::IntrusiveRefCntPtr BaseFS,
+  llvm::IntrusiveRefCntPtr BaseFS,
   bool EnableCheckProfile, llvm::StringRef StoreCheckProfile) {
   ClangTool Tool(Compilations, InputFiles,
  std::make_shared(), BaseFS);
@@ -590,9 +590,9 @@ void runClangTidy(clang::tidy::ClangTidy
 
 void handleErrors(ClangTidyContext &Context, bool Fix,
   unsigned &WarningsAsErrorsCount,
-  llvm::IntrusiveRefCntPtr BaseFS) {
+  llvm::IntrusiveRefCntPtr BaseFS) {
   ErrorReporter Reporter(Context, Fix, BaseFS);
-  vfs::FileSystem &FileSystem =
+  llvm::vfs::FileSystem &FileSystem =
   *Reporter.getSourceManager().getFileManager().getVirtualFileSystem();
   auto InitialWorkingDir = FileSystem.getCurrentWorkingDirectory();
   if (!InitialWorkingDir)

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.h
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.h?rev=344140&r1=344139&r2=344140&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.h (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.h Wed Oct 10 06:27:25 2018
@@ -233,7 +233,7 @@ getCheckOptions(const ClangTidyOptions &
 void runClangTidy(clang::tidy::ClangTidyContext &Context,
   const tooling::CompilationDatabase &Compilations,
   ArrayRef InputFiles,
-  llvm::IntrusiveRefCntPtr BaseFS,
+  llvm::IntrusiveRefCntPtr BaseFS,
   bool EnableCheckProfile = false,
   llvm::StringRef StoreCheckProfile = StringRef());
 
@@ -245,7 +245,7 @@ void runClangTidy(clang::tidy::ClangTidy
 /// clang-format configuration file is found, the given \P FormatStyle is used.
 void handleErrors(ClangTidyContext &Context, bool Fix,
   unsigned &War

  1   2   >