21 Commits

Author SHA1 Message Date
Alessandro Di Federico 4fb6b5f4e1 Minor changes 2025-10-24 18:20:48 +02:00
Ivan Krysak f4e86b37b8 OpaqueFunctionsPool: leave a TODO 2025-07-23 11:38:51 +02:00
Alessandro Di Federico 16e01f43d6 Import revng-c's FunctionTags.h 2024-10-31 17:19:51 +01:00
Alessandro Di Federico 36c344fc62 OpaqueFunctionsPool: improve assertion 2024-10-31 17:19:51 +01:00
Ivan Krysak a123ec2c35 Remove clang-format off around concepts
Now that clang-format no longer breaks anything involving a concept or
a requires clause on sight, these are no longer necessary
2023-07-02 13:20:49 +02:00
Alessandro Di Federico 5b8d5a8a41 Introduce OpaqueFunctionsPool::initializeFromName 2023-04-14 08:36:05 +02:00
Alessandro Di Federico 43fd690ea8 InaccessibleMemOnly: adopt MemoryEffects 2023-04-08 08:42:24 +02:00
Alessandro Di Federico e131817334 Drop usage of Type::getPointerElementType 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 06f9bca598 Adopt {add,remove}FnAttribute 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 52521f8cac Adopt more standard library's features 2023-04-08 08:42:23 +02:00
Ivan Krysak 65d1a016d4 Standardize concept naming across the codebase 2022-08-05 17:27:56 +03:00
Alessandro Di Federico 1a2a729e92 Rework FunctionTags::Tag 2022-03-31 12:51:24 +02:00
Pietro Fezzardi 32cf3fc3cf OpaqueFunctionsPool: remove redundant LLVMContext 2022-03-30 17:21:48 +02:00
Pietro Fezzardi 838c5f7319 Load type-based OpaqueFunctionsPool from Module
This commit adds two method for OpaqueFunctionsPool that use
a pointer to `llvm::Type` (or a class derived from `llvm::Type`) as key.

Both methods are used to initialize the pool with pre-existing functions
inside an `llvm::Module` that match a specific `FunctionTags::Tag`:
- `initializeFromReturnType` uses the return `llvm::Type` of the
  function as key in the pool
- `initializeFromNthArgType` takes an additional argument which is an
  index N, and uses the return `llvm::Type` of the N-th argument as a
  key in the pool

These methods are useful for avoiding unnecessary proliferation of
opaque functions in an `llvm::Module`, re-using the existing ones
instead if they are already present.
2022-03-30 17:21:48 +02:00
Alessandro Di Federico 3e1e69e08f Introduce eraseFromParent 2021-12-17 18:50:08 +01:00
Alessandro Di Federico 2e9c2ee275 Introduce FunctionTags
FunctionTags goal is to solve the long-standing problem of identifying
what type of function are we dealing with. Is it a lifted function? An
helper?

Now we have a sane way to determine this using Metadata and a proper
API.
2021-04-22 18:07:24 +02:00
Alessandro Di Federico 8c27f2bfcd OpaqueFunctionsPool: enumeration and registration 2021-04-22 18:03:53 +02:00
Pietro Fezzardi 9869f057b9 Use #pragma once for header include guards 2020-11-13 14:12:18 +01:00
Pietro Fezzardi cd9bc34d9d Enforce new include conventions 2020-11-13 10:00:24 +01:00
Pietro Fezzardi fc537a2fc7 Add missing MIT license headers 2020-11-12 14:55:57 +01:00
Alessandro Di Federico ccb0b183a5 FunctionIsolation: member.type, not function_call
FunctionIsolation used to base its work on calls to the marker function
`function_call`, as opposed to information provided by the StackAnalysis
(i.e., `revng.member.type` along with `func.call`).

This also affected EnforceABI, which took care of finishing the work
left over by FunctionIsolation. This was hackish and inelegant.

This commit makes FunctionIsolation work exclusively employing
information from StackAnalysis and purges away code that is no longer
necessary from EnforceABI.
2020-11-02 11:21:07 +01:00