[FreeBSD] Fix comparison in f75126eeabba13ce2aab53c2e4296fca12b9da0d
We have to compare the string contents and not the const char* pointer.
This happened to work in my testing but is not reliable.
[FreeBSD] Support -stdlib=libstdc++
The experimental-library-flag.cpp test was failing on FreeBSD builders,
which turned to be caused by missing support for -stdlib=libcstdc++ (and
just using a hardcoded libc++ in all cases).
Simplify FreeBSD::AddCXXStdlibLibArgs() by deferring to the parent class
and dealing with the FreeSBD < 14 profiling support as a special case.
While touching the test file also drop the unnecessary `-o %t.o`. This is
not needed since the RUN lines use -### and don't produce any output.
Reviewed By: DimitryAndric, MaskRay
Pull Request: https://github.com/llvm/llvm-project/pull/126302
[lld] enable installing lld headers and libraries as part of distribution (#127123)
This patch allows `lld-headers` and `lld-libraries` in
`LLVM_DISTRIBUTION_COMPONENTS` to be specified and thus enable piecewise
installation of `lld/**/*.h` headers and/or lld libraries (both in
shared and static builds).
This is similar to use cases such as
`clang;clang-headers;clang-libraries`. Note when `lld-libraries` is
present, `llvm-libraries` must be present as well because various lld
libraries depend on various llvm libraries.
[ELF] Refine ctx.arg.exportDynamic condition
--export-dynamic should be a no-op when ctx.hasDynsym is false.
* Drop unneeded ctx.hasDynsym checks.
* Static linking with --export-dynamic does not prevent devirtualization.
[LAA] Inline hasComputableBounds in only caller, simplify isNoWrap.
Inline hasComputableBounds into createCheckForAccess. This removes a
level of indirection and allows for passing the AddRec directly to
isNoWrap, removing the need to retrieve the AddRec for the pointer
again.
The early continue for invariant SCEVs now also applies to forked
pointers (i.e. when there's more than one entry in TranslatedPtrs) when
ShouldCheckWrap is true, as those trivially won't wrap.
The change is NFC otherwise. replaceSymbolicStrideSCEV is now called
earlier.
[llvm] Remove `br i1 undef` in some `llvm/test/CodeGen` tests (#127368)
This PR replaces some instances of `br i1 undef` with function argument
value in several tests under `llvm/test/CodeGen/ `directory. This PR is
a continuation of PR #125460
Reapply "[Analyzer][CFG] Correctly handle rebuilt default arg and default init expression" (#127338)
This PR reapply https://github.com/llvm/llvm-project/pull/117437.
The issue has been fixed by the 2nd commit, we need to ignore parens in
CXXDefaultArgExpr when build CFG, because CXXDefaultArgExpr::getExpr
stripped off the top level FullExpr and ConstantExpr, ParenExpr may
occurres in the top level.
---------
Signed-off-by: yronglin <yronglin777 at gmail.com>
[analyzer] StackAddrEscapeChecker: also check return for child stack frames (#126986)
Fixes #123459.
This changes checking of the returned expr to also look for memory
regions whose stack frame context was a child of the current stack frame
context, e.g., for cases like this given in #123459:
```
struct S { int *p; };
S f() {
S s;
{
int a = 1;
s.p = &a;
}
return s;
}
```
[Flang] LLVM_ENABLE_RUNTIMES=flang-rt (#110217)
Extract Flang's runtime library to use the LLVM_ENABLE_RUNTIME
mechanism. It will only become active when
`LLVM_ENABLE_RUNTIMES=flang-rt` is used, which also changes the
`FLANG_INCLUDE_RUNTIME` to `OFF` so the old runtime build rules do not
conflict. This also means that unless `LLVM_ENABLE_RUNTIMES=flang-rt` is
passed, nothing changes with the current build process.
Motivation:
* Consistency with LLVM's other runtime libraries (compiler-rt, libc,
libcxx, openmp offload, ...)
* Allows compiling the runtime for multiple targets at once using the
LLVM_RUNTIME_TARGETS configuration options
* Installs the runtime into the compiler's per-target resource directory
so it can be automatically found even when cross-compiling
Also see RFC discussion at
https://discourse.llvm.org/t/rfc-use-llvm-enable-runtimes-for-flangs-runtime/80826