diff options
author | James Y Knight <jyknight@google.com> | 2019-01-31 20:35:56 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2019-01-31 20:35:56 +0000 |
commit | 8e4d96d7af588044c3871d0c673dc558dda6984b (patch) | |
tree | e1a681b62279fe72aa2848692c99ea2a6225ad4a /include/llvm/CodeGen | |
parent | fafbf5786f0d991172ddbff01f7d95f50fbcb5db (diff) | |
download | llvm-8e4d96d7af588044c3871d0c673dc558dda6984b.tar.gz |
[opaque pointer types] Add a FunctionCallee wrapper type, and use it.
The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
and is a useful convenience to enable code to continue passing the
result of getOrInsertFunction() through to EmitCall, even once pointer
types lose their pointee-type.
Then:
- update the CallInst/InvokeInst instruction creation functions to
take a Callee,
- modify getOrInsertFunction to return FunctionCallee, and
- update all callers appropriately.
One area of particular note is the change to the sanitizer
code. Previously, they had been casting the result of
`getOrInsertFunction` to a `Function*` via
`checkSanitizerInterfaceFunction`, and storing that. That would report
an error if someone had already inserted a function declaraction with
a mismatching signature.
However, in general, LLVM allows for such mismatches, as
`getOrInsertFunction` will automatically insert a bitcast if
needed. As part of this cleanup, cause the sanitizer code to do the
same. (It will call its functions using the expected signature,
however they may have been declared.)
Finally, in a small number of locations, callers of
`getOrInsertFunction` actually were expecting/requiring that a brand
new function was being created. In such cases, I've switched them to
Function::Create instead.
Differential Revision: https://reviews.llvm.org/D57315
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/IntrinsicLowering.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/IntrinsicLowering.h b/include/llvm/CodeGen/IntrinsicLowering.h index 5f8da028783..daf2d9a4780 100644 --- a/include/llvm/CodeGen/IntrinsicLowering.h +++ b/include/llvm/CodeGen/IntrinsicLowering.h @@ -30,10 +30,6 @@ class IntrinsicLowering { public: explicit IntrinsicLowering(const DataLayout &DL) : DL(DL), Warned(false) {} - /// Add all of the prototypes that might be needed by an intrinsic lowering - /// implementation to be inserted into the module specified. - void AddPrototypes(Module &M); - /// Replace a call to the specified intrinsic function. /// If an intrinsic function must be implemented by the code generator /// (such as va_start), this function should print a message and abort. |