- Dec 13, 2023
-
-
paperchalice authored
- `CollectorMetadataAnalysis` provides `GCStrategyMap`. - `GCFunctionAnalysis` provides `GCFunctionInfo`. `GCStrategyMap` owns `GCStrategy` pointers and this pass is used by `AsmPrinter` to iterate all GC strategies. Most passes that require `GCModuleInfo` actually require the `GCFunctionInfo`, so add `GCFunctionAnalysis` for convenience.
-
Mariya Podchishchaeva authored
Current context set to where alias was met, not where it is declared caused incorrect access check in case alias referenced private members of the parent class. This is a recommit of 6b1aa319 with a slight modification in order to fix reported regression. Fixes https://github.com/llvm/llvm-project/issues/41693
-
Pierre van Houtryve authored
See https://discourse.llvm.org/t/rfc-make-globalisel-match-table-entries-1-byte-instead-of-8/75411 This helps reduce llc's binary size, at the cost of some added complexity to the MatchTable machinery.
-
Mariya Podchishchaeva authored
Normally warning is not reported when a field has default initializer. Do so for anonymous unions with default initializers as well. No release note since it is a regression in clang 18. Fixes https://github.com/llvm/llvm-project/issues/70384
-
David Green authored
-
Vitaly Buka authored
It's required for hwasan `aliasing` mode.
-
Yeting Kuo authored
Bump to https://github.com/riscv/riscv-cfi/releases/tag/v0.4.0. Actually there is no functional change here.
-
Vitaly Buka authored
This avoids internal libstdc++ leaks.
-
Fangrui Song authored
-
Vitaly Buka authored
-
Sizov Nikita authored
``` CommutativeBinOp(select(V, A, B), select(V, B, A) --> CommutativeBinOp(A, B) CommutativeIntrinsicCall(select(V, A, B), select(V, B, A), ...) --> CommutativeIntrinsicCall(A, B, ...) ``` https://alive2.llvm.org/ce/z/8CDUZ4 Closes #73904
-
Eric authored
Also add links to github actions workflow.
-
serge-sans-paille authored
We only allow for assembly code in naked function, and PGO instrumentation (esp. temporal instrumentation that introduces a function call) can wreak havoc in this. Fix #74573
-
Vitaly Buka authored
Fixes sanitizer-ppc64le-linux bot.
-
Yingchi Long authored
Currently on mcpu=v3 we do not support sdiv, srem instructions. And the backend crashes with stacktrace & coredump, which is misleading for end users, as this is not a "bug" Add llvm bug reporting for sdiv/srem on ISel legalize-op phase. For clang frontend we can get detailed location & bug report. $ build/bin/clang -g -target bpf -c local/sdiv.c local/sdiv.c:1:35: error: unsupported signed division, please convert to unsigned div/mod. 1 | int sdiv(int a, int b) { return a / b; } | ^ 1 error generated. Fixes: #70433 Fixes: #48647 This also improves error handling for dynamic stack allocation: local/vla.c:2:3: error: unsupported dynamic stack allocation 2 | int b[n]; | ^ 1 error generated. Fixes: https://github.com/llvm/llvm-project/issues/57171 -
Matheus Izvekov authored
Reverts llvm/llvm-project#75104 Original commit causes clang to generate invalid IR: ``` mismatched subprogram between llvm.dbg.declare variable and !dbg attachment call void @llvm.dbg.declare(metadata ptr %4, metadata !34468, metadata !DIExpression(DW_OP_plus_uconst, 176)), !dbg !34467 ```
-
Tacet authored
This commit introduces basic annotations for `std::basic_string`, mirroring the approach used in `std::vector` and `std::deque`. Initially, only long strings with the default allocator will be annotated. Short strings (_SSO - short string optimization_) and strings with non-default allocators will be annotated in the near future, with separate commits dedicated to enabling them. The process will be similar to the workflow employed for enabling annotations in `std::deque`. **Please note**: these annotations function effectively only when libc++ and libc++abi dylibs are instrumented (with ASan). This aligns with the prevailing behavior of Memory Sanitizer. To avoid breaking everything, this commit also appends `_LIBCPP_INSTRUMENTED_WITH_ASAN` to `__config_site` whenever libc++ is compiled with ASan. If this macro is not defined, string annotations are not enabled. However, linking a binary that does **not** annotate strings with a dynamic library that annotates strings, is not permitted. Originally proposed here: https://reviews.llvm.org/D132769 Related patches on Phabricator: - Turning on annotations for short strings: https://reviews.llvm.org/D147680 - Turning on annotations for all allocators: https://reviews.llvm.org/D146214 This PR is a part of a series of patches extending AddressSanitizer C++ container overflow detection capabilities by adding annotations, similar to those existing in `std::vector` and `std::deque` collections. These enhancements empower ASan to effectively detect instances where the instrumented program attempts to access memory within a collection's internal allocation that remains unused. This includes cases where access occurs before or after the stored elements in `std::deque`, or between the `std::basic_string`'s size (including the null terminator) and capacity bounds. The introduction of these annotations was spurred by a real-world software bug discovered by Trail of Bits, involving an out-of-bounds memory access during the comparison of two strings using the `std::equals` function. This function was taking iterators (`iter1_begin`, `iter1_end`, `iter2_begin`) to perform the comparison, using a custom comparison function. When the `iter1` object exceeded the length of `iter2`, an out-of-bounds read could occur on the `iter2` object. Container sanitization, upon enabling these annotations, would effectively identify and flag this potential vulnerability. This Pull Request introduces basic annotations for `std::basic_string`. Long strings exhibit structural similarities to `std::vector` and will be annotated accordingly. Short strings are already implemented, but will be turned on separately in a forthcoming commit. Look at [a comment](https://github.com/llvm/llvm-project/pull/72677#issuecomment-1850554465) below to read about SSO issues at current moment. Due to the functionality introduced in [D132522](https://github.com/llvm/llvm-project/commit/dd1b7b797a116eed588fd752fbe61d34deeb24e4), the `__sanitizer_annotate_contiguous_container` function now offers compatibility with all allocators. However, enabling this support will be done in a subsequent commit. For the time being, only strings with the default allocator will be annotated. If you have any questions, please email: - advenam.tacet@trailofbits.com - disconnect3d@trailofbits.com
-
Vitaly Buka authored
-
Matheus Izvekov authored
Add test for https://github.com/llvm/llvm-project/issues/75115
-
paperchalice authored
-
Vitaly Buka authored
They already include workarounds.
-
Matt Arsenault authored
-
Matt Arsenault authored
-
Cyndy Ishida authored
This reverts commit aa217eb0. This reverts commit 634feddc. This breaks buildbots by introducing cycle dependency between libObject and TextAPI and breaks gcc compiles on buildbots.
-
Vitaly Buka authored
-
Cyndy Ishida authored
* Reported in buildbot failures
-
Cyndy Ishida authored
Add support for reading binary Mach-o dynamic libraries. It uses libObject APIs for extracting information relavant to TAPI and tbd files. This includes but is not limited to load commands encode data like install names, current/compat versions and symbols.
-
Nico Weber authored
-
Craig Topper authored
Rather than using size_t, use uint32_t. We don't have more than 4 billion intrinsics.
-
Greg Clayton authored
This patch revives the effort to get this Phabricator patch into upstream: https://reviews.llvm.org/D137900 This patch was accepted before in Phabricator but I found some -gsimple-template-names issues that are fixed in this patch. A fixed up version of the description from the original patch starts now. This patch started off trying to fix Module::FindFirstType() as it sometimes didn't work. The issue was the SymbolFile plug-ins didn't do any filtering of the matching types they produced, and they only looked up types using the type basename. This means if you have two types with the same basename, your type lookup can fail when only looking up a single type. We would ask the Module::FindFirstType to lookup "Foo::Bar" and it would ask the symbol file to find only 1 type matching the basename "Bar", and then we would filter out any matches that didn't match "Foo::Bar". So if the SymbolFile found "Foo::Bar" first, then it would work, but if it found "Baz::Bar" first, it would return only that type and it would be filtered out. Discovering this issue lead me to think of the patch Alex Langford did a few months ago that was done for finding functions, where he allowed SymbolFile objects to make sure something fully matched before parsing the debug information into an AST type and other LLDB types. So this patch aimed to allow type lookups to also be much more efficient. As LLDB has been developed over the years, we added more ways to to type lookups. These functions have lots of arguments. This patch aims to make one API that needs to be implemented that serves all previous lookups: - Find a single type - Find all types - Find types in a namespace This patch introduces a `TypeQuery` class that contains all of the state needed to perform the lookup which is powerful enough to perform all of the type searches that used to be in our API. It contain a vector of CompilerContext objects that can fully or partially specify the lookup that needs to take place. If you just want to lookup all types with a matching basename, regardless of the containing context, you can specify just a single CompilerContext entry that has a name and a CompilerContextKind mask of CompilerContextKind::AnyType. Or you can fully specify the exact context to use when doing lookups like: CompilerContextKind::Namespace "std" CompilerContextKind::Class "foo" CompilerContextKind::Typedef "size_type" This change expands on the clang modules code that already used a vector<CompilerContext> items, but it modifies it to work with expression type lookups which have contexts, or user lookups where users query for types. The clang modules type lookup is still an option that can be enabled on the `TypeQuery` objects. This mirrors the most recent addition of type lookups that took a vector<CompilerContext> that allowed lookups to happen for the expression parser in certain places. Prior to this we had the following APIs in Module: ``` void Module::FindTypes(ConstString type_name, bool exact_match, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeList &types); void Module::FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap &types); void Module::FindTypesInNamespace(ConstString type_name, const CompilerDeclContext &parent_decl_ctx, size_t max_matches, TypeList &type_list); ``` The new Module API is much simpler. It gets rid of all three above functions and replaces them with: ``` void FindTypes(const TypeQuery &query, TypeResults &results); ``` The `TypeQuery` class contains all of the needed settings: - The vector<CompilerContext> that allow efficient lookups in the symbol file classes since they can look at basename matches only realize fully matching types. Before this any basename that matched was fully realized only to be removed later by code outside of the SymbolFile layer which could cause many types to be realized when they didn't need to. - If the lookup is exact or not. If not exact, then the compiler context must match the bottom most items that match the compiler context, otherwise it must match exactly - If the compiler context match is for clang modules or not. Clang modules matches include a Module compiler context kind that allows types to be matched only from certain modules and these matches are not needed when d oing user type lookups. - An optional list of languages to use to limit the search to only certain languages The `TypeResults` object contains all state required to do the lookup and store the results: - The max number of matches - The set of SymbolFile objects that have already been searched - The matching type list for any matches that are found The benefits of this approach are: - Simpler API, and only one API to implement in SymbolFile classes - Replaces the FindTypesInNamespace that used a CompilerDeclContext as a way to limit the search, but this only worked if the TypeSystem matched the current symbol file's type system, so you couldn't use it to lookup a type in another module - Fixes a serious bug in our FindFirstType functions where if we were searching for "foo::bar", and we found a "baz::bar" first, the basename would match and we would only fetch 1 type using the basename, only to drop it from the matching list and returning no results
-
paperchalice authored
Port `CFGuard` to new pass manager, add a pass parameter to choose guard mechanism.
-
Arthur Eubanks authored
Revert "[X86] Set SHF_X86_64_LARGE for globals with explicit well-known large section name (#74381)" This reverts commit 323451ab. Code with these section names in the wild doesn't compile because support for large globals in the small code model is not complete yet.
-
Aart Bik authored
Separates actual transformation files from supporting utility files in the transforms directory. Includes a bazel overlay fix for the build (as well as a bit of cleanup of that file to be less verbose and more flexible).
-
Stella Laurenzo authored
I was not able to fully triage why this just started failing on one of our bots as it seems that the use was added 4 months ago. I would assume that it was accidentally coming in transitively in some way as the dep was definitely missing. For context, this started failing in [our byo_llvm](https://github.com/openxla/iree/blob/main/build_tools/llvm/byo_llvm.sh) build on a stock build of MLIR on top of an existing LLVM. We were getting: ``` ld.lld: error: undefined symbol: mlir::registerSPIRVDialectTranslation(mlir::DialectRegistry&) >>> referenced by mlir-opt.cpp >>> tools/mlir-opt/CMakeFiles/mlir-opt.dir/mlir-opt.cpp.o:(main) ```
-
Vitaly Buka authored
This allows to remove `asan_init_is_running` which likely had a data race. Simplifies https://github.com/llvm/llvm-project/pull/74086 and reduces a difference between platforms. Reviewers: zacklj89, eugenis, dvyukov Reviewed By: zacklj89, dvyukov Pull Request: https://github.com/llvm/llvm-project/pull/74387
-
Craig Topper authored
-
michaelrj-google authored
This patch adds the bind function to go with the socket function. It also cleans up a lot of socket related data structures.
-
Fangrui Song authored
-
Sam Clegg authored
`importUndefined` is only used a couple of places and both of those already handle `isPIC` separately.
-
Mark de Wever authored
The fix changes the way the validation script determines the qualified name of a declaration. Inline namespaces without a reserved name are now always part of the name. The Clang code only does this when the names are ambigious. This method is often used for the operator""foo for UDLs. Adjusted the newly flagged issue and removed a work-around in the test code that is no longer required. Fixes https://github.com/llvm/llvm-project/issues/72427
-