diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-12 20:24:12 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-12 20:24:12 +0000 |
commit | fae1475823cd77fc51c75b0237a19636b36a6179 (patch) | |
tree | eb14877a08a4fc49514a9d2098577f9c62f6544d /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 9f4f5d94cd9a7245b8dfe36a94790beae5da7c41 (diff) | |
download | bcm5719-llvm-fae1475823cd77fc51c75b0237a19636b36a6179.tar.gz bcm5719-llvm-fae1475823cd77fc51c75b0237a19636b36a6179.zip |
Initial commit of the 'landingpad' instruction.
This implements the 'landingpad' instruction. It's used to indicate that a basic
block is a landing pad. There are several restrictions on its use (see
LangRef.html for more detail). These restrictions allow the exception handling
code to gather the information it needs in a much more sane way.
This patch has the definition, implementation, C interface, parsing, and bitcode
support in it.
llvm-svn: 137501
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 12f0715f1a8..5b3d96953a0 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1165,6 +1165,23 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, break; } + case Instruction::LandingPad: { + const LandingPadInst &LP = cast<LandingPadInst>(I); + Code = bitc::FUNC_CODE_INST_LANDINGPAD; + Vals.push_back(VE.getTypeID(LP.getType())); + PushValueAndType(LP.getPersonalityFn(), InstID, Vals, VE); + Vals.push_back(LP.isCleanup()); + Vals.push_back(LP.getNumClauses()); + for (unsigned I = 0, E = LP.getNumClauses(); I != E; ++I) { + if (LP.isCatch(I)) + Vals.push_back(LandingPadInst::Catch); + else + Vals.push_back(LandingPadInst::Filter); + PushValueAndType(LP.getClause(I), InstID, Vals, VE); + } + break; + } + case Instruction::Alloca: Code = bitc::FUNC_CODE_INST_ALLOCA; Vals.push_back(VE.getTypeID(I.getType())); |