diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2021-12-30 13:42:11 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2021-12-30 13:54:37 +0300 |
commit | 62b1682570b1059e8c6542192159dcde32c13c30 (patch) | |
tree | bd44a364a7255071f0b4205f5b127a36dbc5f99a /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | a5337d6a1c6701eb98e085fb69a6e33c36f9533f (diff) | |
download | llvm-62b1682570b1059e8c6542192159dcde32c13c30.zip llvm-62b1682570b1059e8c6542192159dcde32c13c30.tar.gz llvm-62b1682570b1059e8c6542192159dcde32c13c30.tar.bz2 |
[Opaqueptrs][IR Serialization] Improve inlineasm [de]serialization
The bitcode reader expected that the pointers are typed,
so that it can extract the function type for the assembly
so `bitc::CST_CODE_INLINEASM` did not explicitly store said function type.
I'm not really sure how the upgrade path will look for existing bitcode,
but i think we can easily support opaque pointers going forward,
by simply storing the function type.
Reviewed By: #opaque-pointers, nikic
Differential Revision: https://reviews.llvm.org/D116341
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index dc06bc1..e0efdf2 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2458,6 +2458,7 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal, } if (const InlineAsm *IA = dyn_cast<InlineAsm>(V)) { + Record.push_back(VE.getTypeID(IA->getFunctionType())); Record.push_back( unsigned(IA->hasSideEffects()) | unsigned(IA->isAlignStack()) << 1 | unsigned(IA->getDialect() & 1) << 2 | unsigned(IA->canThrow()) << 3); |