- Jul 22, 2022
-
-
Chuanqi Xu authored
Previously we don't catch the reachability for partial specialization. Handle them in this patch.
-
Sebastian Neubauer authored
Copying the folder keeps the original permissions by default. This creates problems when the source folder is read-only, e.g. in a packaging environment. Then, the copied folder in the build directory is read-only as well. Later on, with configure_file, ClangConfig.cmake is copied into that directory (in the build tree), failing when the directory is read-only. Fix that problem by copying the folder without keeping the original permissions. Differential Revision: https://reviews.llvm.org/D130254
-
Sam McCall authored
These can be used to quantify parsing improvements from a change. Differential Revision: https://reviews.llvm.org/D130199
-
Benjamin Kramer authored
MarkupFilter keeps a reference to the last filtered StringRef. Just keep it alive a bit longer. Found by asan.
-
Fangrui Song authored
And avoid redundant identify_magic test.
-
Kazu Hirata authored
-
Cullen Rhodes authored
Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D130093
-
Cullen Rhodes authored
Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D130094
-
Nikita Popov authored
Also test realloc, and dead writes to the allocation.
-
Iain Sandoe authored
The re-land fixes module map module dependencies seen on Greendragon, but not in the clang test suite. --- Currently we only implement this for the Itanium ABI since the correct mangling for the initializers in other ABIs is not yet known. Intended result: For a module interface [which includes partition interface and implementation units] (instead of the generic CXX initializer) we emit a module init that: - wraps the contained initializations in a control variable to ensure that the inits only happen once, even if a module is imported many times by imports of the main unit. - calls module initializers for imported modules first. Note that the order of module import is not significant, and therefore neither is the order of imported module initializers. - We then call initializers for the Global Module Fragment (if present) - We then call initializers for the current module. - We then call initializers for the Private Module Fragment (if present) For a module implementation unit, or a non-module TU that imports at least one module we emit a regular CXX init that: - Calls the initializers for any imported modules first. - Then proceeds as normal with remaining inits. For all module unit kinds we include a global constructor entry, this allows for the (in most cases unusual) possibility that a module object could be included in a final binary without a specific call to its initializer. Implementation: - We provide the module pointer in the AST Context so that CodeGen can act on it and its sub-modules. - We need to account for module build lines like this: ` clang -cc1 -std=c++20 Foo.pcm -emit-obj -o Foo.o` or ` clang -cc1 -std=c++20 -xc++-module Foo.cpp -emit-obj -o Foo.o` - in order to do this, we add to ParseAST to set the module pointer in the ASTContext, once we establish that this is a module build and we know the module pointer. To be able to do this, we make the query for current module public in Sema. - In CodeGen, we determine if the current build requires a CXX20-style module init and, if so, we defer any module initializers during the "Eagerly Emitted" phase. - We then walk the module initializers at the end of the TU but before emitting deferred inits (which adds any hidden and static ones, fixing https://github.com/llvm/llvm-project/issues/51873 ). - We then proceed to emit the deferred inits and continue to emit the CXX init function. Differential Revision: https://reviews.llvm.org/D126189
-
Haojian Wu authored
- the grammar ambiguity is eliminated by a guard; - modify the guard function signatures, now all parameters are folded in to a single object, avoid a long parameter list (as we will add more parameters in the near future); Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D130160
-
LLVM GN Syncbot authored
-
Michael Buch authored
This patch adds support for evaluating expressions which reference a captured `this` from within the context of a C++ lambda expression. Currently LLDB doesn't provide Clang with enough information to determine that we're inside a lambda expression and are allowed to access variables on a captured `this`; instead Clang simply fails to parse the expression. There are two problems to solve here: 1. Make sure `clang::Sema` doesn't reject the expression due to an illegal member access. 2. Materialize all the captured variables/member variables required to evaluate the expression. To address (1), we currently import the outer structure's AST context onto `$__lldb_class`, making the `contextClass` and the `NamingClass` match, a requirement by `clang::Sema::BuildPossibleImplicitMemberExpr`. To address (2), we inject all captured variables as locals into the expression source code. **Testing** * Added API test
-
Michael Buch authored
This is required in preparation for the follow-up patch which adds support for evaluating expressions from within C++ lambdas. In such cases we need to materialize variables which are not part of the current frame but instead are ivars on a 'this' pointer of the current frame.
-
Michael Buch authored
-
Haojian Wu authored
-
Sam McCall authored
-
Johannes Doerfert authored
-
Johannes Doerfert authored
-
Tarun Prabhu authored
Lower F08 maskl and maskr intrinsics. Differential Revision: https://reviews.llvm.org/D129296
-
Tarun Prabhu authored
Lower F08 shift (shiftl, shiftr, shifta) and combined shift (dshiftl, dshiftr) intrinsics. The combined shift intrinsics are implemented using the definitions of shiftl and shiftr as described by the standard. For non-conformant arguments to the shift intrinsics, the implementation tries to replicate the behavior of other compilers if most of the other behave consistently. Differential Revision: https://reviews.llvm.org/D129316
-
Tarun Prabhu authored
Test compile-time folding of F08 maskl and maskr intrinsics. Differential Revision: https://reviews.llvm.org/D129663
-
Tarun Prabhu authored
Test compile-time folding of F08 shift (shiftl, shiftr, shifta) and combined shift (dshiftl, dshiftr) intrinsics. Differential Revision: https://reviews.llvm.org/D129696
-
Tarun Prabhu authored
Lower F08 bit population count intrinsics popcnt, poppar, leadz and trailz. popcnt, leadz and trailz are implemented using the corresponding MLIR math intrinsics. poppar is implemented in terms of popcnt. Differential Revision: https://reviews.llvm.org/D129584
-
Johannes Doerfert authored
If a function is non-recursive we only performed intra-procedural reasoning for reachability (via AA::isPotentiallyReachable). However, if it is re-entrant that doesn't mean we can't reach. Instead of this problematic logic in the reachability reasoning we utilize logic in AAPointerInfo. If a location is for sure written by a function it can be re-entrant or recursive we know only intra-procedural reasoning is sufficient.
-
Max Kazantsev authored
The existing code doesn't expect dummy values (undef, poison, null-derived constants etc) as arguments of these intrinsics. However, they can be there in unreached code. Currently we fail trying to find base for them. Handle these cases separately. Return null as base for them to be consistent with the handling in the main algorithm in findBaseDefiningValue. Differential Revision: https://reviews.llvm.org/D129561 Reviewed By: apilipenko
-
Uday Bondhugula authored
Add affine.if canonicalization to compose affine.apply ops into its set and operands. This eliminates affine.apply ops feeding into affine.if ops. Differential Revision: https://reviews.llvm.org/D130242
-
Johannes Doerfert authored
If we have a dominating must-write access we do not need to know the initial value of some object to perform reasoning about the potential values. The dominating must-write has overwritten the initial value.
-
Johannes Doerfert authored
These were forgotten when D118680 was applied. Similar to D125937. Differential Revision: https://reviews.llvm.org/D129516
-
Johannes Doerfert authored
The namespaces were missing causing the symbols to have "C" mangling. To avoid this in the future we qualify the names now fully.
-
Johannes Doerfert authored
-
Fangrui Song authored
-
Fangrui Song authored
lowerGlobalAddress added by D128427 can be used for PIC. The actual condition is that the global value needs to be dso_local (a dso_preemptable one needs GOT indirection). load-store.ll has UB due to out-of-bounds load/store. Fix the UB in the variable test and add an array test. Note: NOPIC array index is currently wrong. Reviewed By: wangleiat Differential Revision: https://reviews.llvm.org/D129977
-
Fangrui Song authored
-
Chenbing Zheng authored
Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D130220
-
Fangrui Song authored
-
Fangrui Song authored
-
Volodymyr Sapsai authored
Diagnostic for `-Wauto-import` shouldn't be a warning because it doesn't represent a potential problem in code that should be fixed. And the emitted fix-it is likely to trigger `-Watimport-in-framework-header` which makes it challenging to have a warning-free codebase. But it is still useful to see how include directives are translated into modular imports and which module a header belongs to, that's why keep it as a remark. Keep `-Wauto-import` for now to allow a gradual migration for codebases using `-Wno-auto-import`, e.g., `-Weverything -Wno-auto-import`. rdar://79594287 Differential Revision: https://reviews.llvm.org/D130138
-