aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
AgeCommit message (Collapse)AuthorFilesLines
2023-08-30[NFC][Clang] Remove unused function ↵Juan Manuel MARTINEZ CAAMAÑO1-8/+0
`CodeGenModule::addDefaultFunctionDefinitionAttributes` This patch deletes the unused `addDefaultFunctionDefinitionAttributes(llvm::Function);` function, while it still keeps `void addDefaultFunctionDefinitionAttributes(llvm::AttrBuilder &attrs);` which is being used. Differential Revision: https://reviews.llvm.org/D158990
2023-08-29[NFC][Clang] Add missing & to function argumentJuan Manuel MARTINEZ CAAMAÑO1-1/+1
Differential Revision: https://reviews.llvm.org/D158991
2023-08-29[Clang] Allow __declspec(noalias) to access inaccessible memoryNikita Popov1-1/+1
MSVC defines __declspec(noalias) as follows (https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/k649tyc7(v=vs.110)?redirectedfrom=MSDN): > noalias means that a function call does not modify or reference > visible global state and only modifies the memory pointed to > directly by pointer parameters (first-level indirections). > If a function is annotated as noalias, the optimizer can assume > that, in addition to the parameters themselves, only first-level > indirections of pointer parameters are referenced or modified > inside the function. The visible global state is the set of all > data that is not defined or referenced outside of the compilation > scope, and their address is not taken. The compilation scope is > all source files (/LTCG (Link-time Code Generation) builds) or a > single source file (non-/LTCG build). The wording is not super clear to me, but I believe this is saying that __declspec(noalias) functions may access inaccessible memory (i.e. non-visible global state in their words). Indeed, the Windows CRT applies this attribute to malloc, which does access inaccessible memory under LLVM's memory model. As such, change the attribute to emit memory(argmem: readwrite, inaccessiblemem: readwrite) instead of memory(argmem: readwrite). Fixes https://github.com/llvm/llvm-project/issues/64827. Differential Revision: https://reviews.llvm.org/D158984
2023-08-28Revert "[C++20] [Coroutines] Mark await_suspend as noinline if the awaiter ↵Chuanqi Xu1-28/+0
is not empty" This reverts commit 9d9c25f81456aace2bec4b58498a420e650007d9. This reverts commit 19ab2664ad3182ffa8fe3a95bb19765e4ae84653. This reverts commit c4672454743e942f148a1aff1e809dae73e464f6. As the issue https://github.com/llvm/llvm-project/issues/65018 shows, the previous fix introduce a regression actually. So this commit reverts the fix by our policies.
2023-08-28[C++20] [Coroutines] Don't mark await_suspend as noinline if it is specified ↵Chuanqi Xu1-1/+5
as always_inline already Address https://github.com/llvm/llvm-project/issues/64933 and partially https://github.com/llvm/llvm-project/issues/64945. After c467245, we will add a noinline attribute to the await_suspend member function of an awaiter if the awaiter has any non static member functions. Obviously, this decision will bring some performance regressions. And people may complain about this while the long term solution may not be available soon. In such cases, it is better to provide a solution for the users who met the regression surprisingly. Also it is natural to not prevent the inlining if the function is marked as always_inline by the users already.
2023-08-22[CGCall][RISCV] Handle function calls with parameter of RVV tuple typeeopXD1-22/+42
This was an oversight in D146872, where function calls with tuple type was not covered. This commit fixes this. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D157953
2023-08-22[C++20] [Coroutines] Mark await_suspend as noinline if the awaiter is not emptyChuanqi Xu1-0/+24
Close https://github.com/llvm/llvm-project/issues/56301 Close https://github.com/llvm/llvm-project/issues/64151 See the summary and the discussion of https://reviews.llvm.org/D157070 to get the full context. As @rjmccall pointed out, the key point of the root cause is that currently we didn't implement the semantics for '@llvm.coro.save' well ("after the await-ready returns false, the coroutine is considered to be suspended ") well. Since the semantics implies that we (the compiler) shouldn't write the spills into the coroutine frame in the await_suspend. But now it is possible due to some combinations of the optimizations so the semantics are broken. And the inlining is the root optimization of such optimizations. So in this patch, we tried to add the `noinline` attribute to the await_suspend call. Also as an optimization, we don't add the `noinline` attribute to the await_suspend call if the awaiter is an empty class. This should be correct since the programmers can't access the local variables in await_suspend if the awaiter is empty. I think this is necessary for the performance since it is pretty common. Another potential optimization is: call @llvm.coro.await_suspend(ptr %awaiter, ptr %handle, ptr @awaitSuspendFn) Then it is much easier to perform the safety analysis in the middle end. If it is safe to inline the call to awaitSuspend, we can replace it in the CoroEarly pass. Otherwise we could replace it in the CoroSplit pass. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D157833
2023-08-16Reapply: [IRGen] Emit lifetime intrinsics around temporary aggregate ↵Erik Pilkington1-1/+22
argument allocas This reverts commit e26c24b849211f35a988d001753e0cd15e4a9d7b. These temporaries are only used in the callee, and their memory can be reused after the call is complete. rdar://58552124 Link: https://github.com/llvm/llvm-project/issues/38157 Link: https://github.com/llvm/llvm-project/issues/41896 Link: https://github.com/llvm/llvm-project/issues/43598 Link: https://github.com/ClangBuiltLinux/linux/issues/39 Link: https://reviews.llvm.org/rGfafc6e4fdf3673dcf557d6c8ae0c0a4bb3184402 Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D74094
2023-08-15[clang] Skip stores in init for fields that are empty structsMartin Storsjö1-3/+9
An empty struct is handled as a struct with a dummy i8, on all targets. Most targets treat an empty struct return value as essentially void - but some don't. (Currently, at least x86_64-windows-* and powerpc64le-* don't treat it as void.) When intializing a struct with such a no_unique_address member, make sure we don't write the dummy i8 into the struct where there's no space allocated for it. Previously it would clobber the actual valid data of the struct. Fixes https://github.com/llvm/llvm-project/issues/64253, and possibly https://github.com/llvm/llvm-project/issues/64077 and https://github.com/llvm/llvm-project/issues/64427 as well. We should omit the store for any empty record (not only ones declared with no_unique_address); we can have a situation where a class doesn't have the no_unique_address attribute, but is embedded in an outer struct with the no_unique_address attribute - like this: struct S {}; S f(); struct S2 : public S { S2();}; S2::S2() : S(f()) {} struct S3 { int x; [[no_unique_address]] S2 y; S3(); }; S3::S3() : x(1), y() {} Here, the problematic store (which this patch omits) is in the constructor of S2. In the case of S3, S2 has no valid storage and aliases x - thus the constructor of S2 should omit the dummy store. Differential Revision: https://reviews.llvm.org/D157332
2023-08-11[clang][AMDGPU]: Don't use byval for struct arguments in function ABIChangpeng Fang1-4/+8
Summary: Byval requires allocating additional stack space, and always requires an implicit copy to be inserted in codegen, where it can be difficult to optimize. In this work, we use byref/IndirectAliased promotion method instead of byval with the implicit copy semantics. Reviewers: arsenm Differential Revision: https://reviews.llvm.org/D155986
2023-08-09Intrinsics: Add type overload to stacksave and stackstoreMatt Arsenault1-4/+2
This allows use with non-0 address space stacks. llvm_ptr_ty should never be used. This could use some more percolation up through mlir, but this is enough to fix existing tests. https://reviews.llvm.org/D156666
2023-08-08[Clang][AArch64] Add/implement ACLE keywords for SME.Sander de Smalen1-0/+15
This patch adds all the language-level function keywords defined in: https://github.com/ARM-software/acle/pull/188 (merged) https://github.com/ARM-software/acle/pull/261 (update after D148700 landed) The keywords are used to control PSTATE.ZA and PSTATE.SM, which are respectively used for enabling the use of the ZA matrix array and Streaming mode. This information needs to be available on call sites, since the use of ZA or streaming mode may have to be enabled or disabled around the call-site (depending on the IR attributes set on the caller and the callee). For calls to functions from a function pointer, there is no IR declaration available, so the IR attributes must be added explicitly to the call-site. With the exception of '__arm_locally_streaming' and '__arm_new_za' the information is part of the function's interface, not just the function definition, and thus needs to be propagated through the FunctionProtoType::ExtProtoInfo. This patch adds the defintions of these keywords, as well as codegen and semantic analysis to ensure conversions between function pointers are valid and that no conflicting keywords are set. For example, '__arm_streaming' and '__arm_streaming_compatible' are mutually exclusive. Differential Revision: https://reviews.llvm.org/D127762
2023-08-01[Intrinsics][ObjC] Mark objc_retain and friends as thisreturn.Jon Roelofs1-3/+3
https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-retain rdar://79869679 Differential revision: https://reviews.llvm.org/D105671
2023-07-27[Driver] Add `-f[no-]offload-uniform-block`Yaxun (Sam) Liu1-2/+7
By default, clang assumes HIP kernels are launched with uniform block size, which is the case for kernels launched through triple chevron or hipLaunchKernelGGL. Clang adds uniform-work-group-size function attribute to HIP kernels to allow the backend to do optimizations on that. However, in some rare cases, HIP kernels can be launched through hipExtModuleLaunchKernel where global work size is specified, which may result in non-uniform block size. To be able to support non-uniform block size for HIP kernels, an option `-f[no-]offload-uniform-block is added. This option is generic for offloading languages. Its default value is on for CUDA/HIP and off otherwise. Make -cl-uniform-work-group-size an alias to -foffload-uniform-block. Reviewed by: Siu Chi Chan, Matt Arsenault, Fangrui Song, Johannes Doerfert Differential Revision: https://reviews.llvm.org/D155213 Fixes: SWDEV-406592
2023-07-26Reland "Try to implement lambdas with inalloca parameters by forwarding ↵Amy Huang1-75/+69
without use of inallocas."t This reverts commit 8ed7aa59f489715d39d32e72a787b8e75cfda151. Differential Revision: https://reviews.llvm.org/D154007
2023-07-18[RISCV][AArch64][IRGen] Add a special case to CodeGenFunction::EmitCall for ↵Craig Topper1-0/+14
scalable vector return being coerced to fixed vector. Before falling back to CreateCoercedStore, detect a scalable vector return being coerced to fixed vector. Handle it using a vector.extract intrinsic without going through memory. Reviewed By: c-rhodes Differential Revision: https://reviews.llvm.org/D155495
2023-07-17[IRGen] Remove 'Sve' from the name of some IR names that are shared with ↵Craig Topper1-2/+2
RISC-V now. Reviewed By: c-rhodes Differential Revision: https://reviews.llvm.org/D155220
2023-07-02[clang] Remove CGBuilderTy::CreateElementBitCastYoungsuk Kim1-15/+11
`CGBuilderTy::CreateElementBitCast()` no longer does what its name suggests. Remove remaining in-tree uses by one of the following methods. * drop the call entirely * fold it to an `Address` construction * replace it with `Address::withElementType()` This is a NFC cleanup effort. Reviewed By: barannikov88, nikic, jrtc27 Differential Revision: https://reviews.llvm.org/D154285
2023-06-27[llvm] Move AttributeMask to a separate headerElliot Goodrich1-0/+1
Move `AttributeMask` out of `llvm/IR/Attributes.h` to a new file `llvm/IR/AttributeMask.h`. After doing this we can remove the `#include <bitset>` and `#include <set>` directives from `Attributes.h`. Since there are many headers including `Attributes.h`, but not needing the definition of `AttributeMask`, this causes unnecessary bloating of the translation units and slows down compilation. This commit adds in the include directive for `llvm/IR/AttributeMask.h` to the handful of source files that need to see the definition. This reduces the total number of preprocessing tokens across the LLVM source files in lib from (roughly) 1,917,509,187 to 1,902,982,273 - a reduction of ~0.76%. This should result in a small improvement in compilation time. Differential Revision: https://reviews.llvm.org/D153728
2023-06-27[clang] Allow 'nomerge' attribute for function pointersEduard Zingerman1-0/+3
Allow specifying 'nomerge' attribute for function pointers, e.g. like in the following C code: extern void (*foo)(void) __attribute__((nomerge)); void bar(long i) { if (i) foo(); else foo(); } With the goal to attach 'nomerge' to both calls done through 'foo': @foo = external local_unnamed_addr global ptr, align 8 define dso_local void @bar(i64 noundef %i) local_unnamed_addr #0 { ; ... %0 = load ptr, ptr @foo, align 8, !tbaa !5 ; ... if.then: tail call void %0() #1 br label %if.end if.else: tail call void %0() #1 br label %if.end if.end: ret void } ; ... attributes #1 = { nomerge ... } Report a warning in case if 'nomerge' is specified for a variable that is not a function pointer, e.g.: t.c:2:22: warning: 'nomerge' attribute is ignored because 'j' is not a function pointer [-Wignored-attributes] 2 | int j __attribute__((nomerge)); | ^ The intended use-case is for BPF backend. BPF provides a sort of "standard library" functions that are called helpers. BPF also verifies usage of these helpers before program execution. Because of limitations of verification / runtime model it is important to keep calls to some of such helpers from merging. An example could be found by the link [1], there input C code: if (data_end - data > 1024) { bpf_for_each_map_elem(&map1, cb, &cb_data, 0); } else { bpf_for_each_map_elem(&map2, cb, &cb_data, 0); } Is converted to bytecode equivalent to: if (data_end - data > 1024) tmp = &map1; else tmp = &map2; bpf_for_each_map_elem(tmp, cb, &cb_data, 0); However, BPF verification/runtime requires to use the same map address for each particular `bpf_for_each_map_elem()` call. The 'nomerge' attribute is a perfect match for this situation, but unfortunately BPF helpers are declared as pointers to functions: static long (*bpf_for_each_map_elem)(void *map, ...) = (void *) 164; Hence, this commit, allowing to use 'nomerge' for function pointers. [1] https://lore.kernel.org/bpf/03bdf90f-f374-1e67-69d6-76dd9c8318a4@meta.com/ Differential Revision: https://reviews.llvm.org/D152986
2023-06-22Revert "Try to implement lambdas with inalloca parameters by forwarding ↵Amy Huang1-69/+74
without use of inallocas." Causes a clang crash (see crbug.com/1457256). This reverts commit 015049338d7e8e0e81f2ad2f94e5a43e2e3f5220.
2023-06-20Try to implement lambdas with inalloca parameters by forwarding without use ↵Amy Huang1-74/+69
of inallocas. Differential Revision: https://reviews.llvm.org/D137872
2023-06-20[Clang] Allow bitcode linking when the input is LLVM-IRJoseph Huber1-32/+68
Clang provides the `-mlink-bitcode-file` and `-mlink-builtin-bitcode` options to insert LLVM-IR into the current TU. These are usefuly primarily for including LLVM-IR files that require special handling to be correct and cannot be linked normally, such as GPU vendor libraries like `libdevice.10.bc`. Currently these options can only be used if the source input goes through the AST consumer path. This patch makes the changes necessary to also support this when the input is LLVM-IR. This will allow the following operation: ``` clang in.bc -Xclang -mlink-builtin-bitcode -Xclang libdevice.10.bc ``` Reviewed By: yaxunl Differential Revision: https://reviews.llvm.org/D152391
2023-06-16[CGCall] Prune ArgStruct [-Wunused-variable]NAKAMURA Takumi1-4/+1
It has been unused since b92ccc355acb
2023-06-15[CGCall] Directly create opaque pointers (NFCI)Nikita Popov1-49/+13
2023-06-12[Clang] Remove uses of PointerType::getWithSamePointeeType (NFC)Nikita Popov1-3/+2
No longer relevant with opaque pointers.
2023-06-09[Clang] Remove typed pointer consistency assertions (NFC)Nikita Popov1-19/+0
These are no-ops with opaque pointers.
2023-06-07[clang][CodeGen] Fix GPU-specific attributes being dropped by bitcode linkingpvanhout1-1/+2
Device libs make use of patterns like this: ``` __attribute__((target("gfx11-insts"))) static unsigned do_intrin_stuff(void) { return __builtin_amdgcn_s_sendmsg_rtnl(0x0); } ``` For functions that are assumed to be eliminated if the currennt GPU target doesn't support them. At O0 such functions aren't eliminated by common optimizations but often by AMDGPURemoveIncompatibleFunctions instead, which sees the "+gfx11-insts" attribute on, say, GFX9 and knows it's not valid, so it removes the function. D142907 accidentally made it so such attributes were dropped during bitcode linking, making it impossible for RemoveIncompatibleFunctions to catch the functions and causing ISel to catch fire eventually. This fixes the issue and adds a new test to ensure we don't accidentally fall into this trap again. Fixes SWDEV-403642 Reviewed By: arsenm, yaxunl Differential Revision: https://reviews.llvm.org/D152251
2023-06-02[NFC][CLANG] Fix bug with dereference null return value in ↵Manna, Soumi1-1/+1
GetFunctionTypeForVTable() This patch uses castAs instead of getAs which will assert if the type doesn't match in clang::CodeGen::CodeGenTypes::GetFunctionTypeForVTable(clang::GlobalDecl). Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D151957
2023-05-30[clang][analyzer][NFC] Remove unnecessary FALLTHROUGH markersDmitri Gribenko1-1/+0
They are redundant with the [[fallthrough]]; attribute that follows. Reviewed By: steakhal Differential Revision: https://reviews.llvm.org/D151723
2023-05-24[IRGen] Handle infinite cycles in findDominatingStoreToReturnValue.Florian Hahn1-1/+2
If there is an infinite cycle in the IR, the loop will never exit. Keep track of visited basic blocks in a set and return nullptr if a block is visited again. Fixes #62830. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D151076
2023-05-22[2/11][POC][Clang][RISCV] Define RVV tuple typeseopXD1-19/+40
For the cover letter of this patch-set, please checkout D146872. Depends on D146872. This is the 2nd patch of the patch-set. This patch originates from D97264. This patch further allows local variable declaration and function parameter passing by adjustment in clang lowering. Test cases are provided to demonstrate the LLVM IR generated. Note: This patch is currently only a proof-of-concept with only a single RVV tuple type declared here, the rest will be added when the concept of this patch-set is accepted. Authored-by: eop Chen <eop.chen@sifive.com> Co-Authored-by: Hsiangkai Wang <kai.wang@sifive.com> Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D146873
2023-04-29LangRef: Add "dynamic" option to "denormal-fp-math"Matt Arsenault1-14/+92
This is stricter than the default "ieee", and should probably be the default. This patch leaves the default alone. I can change this in a future patch. There are non-reversible transforms I would like to perform which are legal under IEEE denormal handling, but illegal with flushing zero behavior. Namely, conversions between llvm.is.fpclass and fcmp with zeroes. Under "ieee" handling, it is legal to translate between llvm.is.fpclass(x, fcZero) and fcmp x, 0. Under "preserve-sign" handling, it is legal to translate between llvm.is.fpclass(x, fcSubnormal|fcZero) and fcmp x, 0. I would like to compile and distribute some math library functions in a mode where it's callable from code with and without denormals enabled, which requires not changing the compares with denormals or zeroes. If an IEEE function transforms an llvm.is.fpclass call into an fcmp 0, it is no longer possible to call the function from code with denormals enabled, or write an optimization to move the function into a denormal flushing mode. For the original function, if x was a denormal, the class would evaluate to false. If the function compiled with denormal handling was converted to or called from a preserve-sign function, the fcmp now evaluates to true. This could also be of use for strictfp handling, where code may be changing the denormal mode. Alternative name could be "unknown". Replaces the old AMDGPU custom inlining logic with more conservative logic which tries to permit inlining for callees with dynamic handling and avoids inlining other mismatched modes.
2023-03-30[SYCL] Always set NoUnwind attribute for SYCL.Harald van Dijk1-3/+2
Like CUDA and OpenCL, the SYCL specification says that throwing and catching exceptions in device functions is not supported, so this change extends the logic for adding the NoUnwind attribute to SYCL. The existing convergent.cpp test, which tests that the convergent attribute is added to functions by default, is renamed and reused to test that the nounwind attribute is added by default. This test now has -fexceptions added to it, which the driver adds by default as well. The obvious question here is why not simply change the driver to remove -fexceptions. This change follows the direction given by the TODO comment because removing -fexceptions would also disable the __EXCEPTIONS macro, which should reflect whether exceptions are enabled on the host, rather than on the device, to avoid conflicts in types shared between host and device. Reviewed By: bader Differential Revision: https://reviews.llvm.org/D147097
2023-03-15[Clang] Check feature requirement from inlined calleeQiu Chaofan1-1/+2
Currently clang emits error when both always_inline and target attributes are on callee, but caller doesn't have some feature. This patch makes clang emit error when caller cannot meet target feature requirements from an always-inlined callee. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D143479
2023-03-15clang: Emit nofpclass(nan inf) for -ffinite-math-onlyMatt Arsenault1-1/+40
Set this on any source level floating-point type argument, return value, call return or outgoing parameter which is lowered to a valid IR type for the attribute. Currently this isn't applied to emitted intrinsics since those don't go through ABI code.
2023-02-28[Clang][CodeGen] Fix this argument type for certain destructorsJacob Young1-1/+3
With the Microsoft ABI, some destructors need to offset a parameter to get the derived this pointer, in which case the type of that parameter should not be a pointer to the derived type. Fixes #60465
2023-02-15[CodeGen] Add a flag to `Address` and `Lvalue` that is used to keepAkira Hatanaka1-1/+1
track of whether the pointer is known not to be null The flag will be used for the arm64e work we plan to upstream in the future (see https://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html). Currently the flag has no effect on code generation. Differential Revision: https://reviews.llvm.org/D142584
2023-01-31[clang][CGCall] Remove header file not used. [NFCI]Francesco Petrogalli1-1/+0
Reviewed By: fpetrogalli Differential Revision: https://reviews.llvm.org/D142976
2023-01-20[OpenCL] Always add nounwind attribute for OpenCLSven van Haastregt1-3/+3
Neither OpenCL nor C++ for OpenCL support exceptions, so add the `nounwind` attribute unconditionally for those languages. Differential Revision: https://reviews.llvm.org/D142033
2023-01-13[clang][NFC] Remove dependency on DataLayout::getPrefTypeAlignmentGuillaume Chatelet1-2/+2
2023-01-13[clang][NFC] Remove dependency on DataLayout::getPrefTypeAlignmentGuillaume Chatelet1-9/+8
2023-01-11[clang][NFC] Use the TypeSize::getXXXValue() instead of TypeSize::getXXXSize)Guillaume Chatelet1-7/+7
This change is one of a series to implement the discussion from https://reviews.llvm.org/D141134.
2023-01-03clang: Don't emit "frame-pointer"="none"Matt Arsenault1-7/+4
This is the default behavior and cuts down on attribute spam. Probably should also do something to consolidate the option spellings; printing and parsing it is repeated in at least 3 different places. In the OpenMP tests, I had to manually delete some metadata check lines update_cc_test_checks was inserting that included the local build revision.
2022-12-16[clang][dataflow] Remove unused argument in getNullabilityDani Ferreira Franco Moura1-1/+1
This change will allow users to call getNullability() without providing an ASTContext. Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D140104
2022-12-05[msan][CodeGen] Set noundef for C return valueVitaly Buka1-1/+7
Msan needs noundef consistency between interface and implementation. If we call C++ from C we can have noundef on C++ side, and no noundef on caller C side, noundef implementation will not set TLS for return value, no noundef caller will expect it. Then we have false reports in msan. The workaround could be set TLS to zero even for noundef return values. However if we do that always it will increase binary size by about 10%. If we do that selectively we need to handle "address is taken" functions, any non local functions, and probably all function which have musttail callers. Which is still a lot. The existing implementation of HasStrictReturn refers to C standard as the reason not enforcing noundef. I believe it applies only to the case when return statement is omitted. Testing on Google codebase I never see such cases, however I've see tens of cases where C code returns actual uninitialized variables, but we ignore that it because of "omitted return" case. So this patch will: 1. fix false-positives with TLS missmatch. 2. detect bugs returning uninitialized variables for C as well. 3. report "omitted return" cases stricter than C, which is already a warning and very likely a bug in a code anyway. Reviewed By: kda Differential Revision: https://reviews.llvm.org/D139296
2022-12-04[NFC][CodeGen] Extract HasStrictReturnVitaly Buka1-20/+28
2022-12-04[NFC][CodeGen] Add const to a methodVitaly Buka1-1/+1
2022-12-03[CodeGen] Use std::nullopt instead of None (NFC)Kazu Hirata1-7/+8
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-02Attributes: convert Optional to std::optionalKrzysztof Parzyszek1-1/+2