llvm-6502/lib/IR
Duncan P. N. Exon Smith ae3211466a IR: Add assembly/bitcode support for function metadata attachments
Add serialization support for function metadata attachments (added in
r235783).  The syntax is:

    define @foo() !attach !0 {

Metadata attachments are only allowed on functions with bodies.  Since
they come before the `{`, they're not really part of the body; since
they require a body, they're not really part of the header.  In
`LLParser` I gave them a separate function called from `ParseDefine()`,
`ParseOptionalFunctionMetadata()`.

In bitcode, I'm using the same `METADATA_ATTACHMENT` record used by
instructions.  Instruction metadata attachments are included in a
special "attachment" block at the end of a `Function`.  The attachment
records are laid out like this:

    InstID (KindID MetadataID)+

Note that these records always have an odd number of fields.  The new
code takes advantage of this to recognize function attachments (which
don't need an instruction ID):

    (KindID MetadataID)+

This means we can use the same attachment block already used for
instructions.

This is part of PR23340.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24 22:04:41 +00:00
..
AsmWriter.cpp IR: Add assembly/bitcode support for function metadata attachments 2015-04-24 22:04:41 +00:00
AttributeImpl.h [IR] Introduce a dereferenceable_or_null(N) attribute. 2015-04-16 20:29:50 +00:00
Attributes.cpp [IR] Introduce a dereferenceable_or_null(N) attribute. 2015-04-16 20:29:50 +00:00
AutoUpgrade.cpp [opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType 2015-04-24 21:16:07 +00:00
BasicBlock.cpp Return iterator from BasicBlock::eraseFromParent 2015-04-03 01:20:33 +00:00
CMakeLists.txt uselistorder: Remove the global bits 2015-04-15 03:14:06 +00:00
Comdat.cpp
ConstantFold.cpp Correct extractelement constant folding 2015-04-24 07:42:35 +00:00
ConstantFold.h
ConstantRange.cpp [ConstantRange] Split makeICmpRegion in two. 2015-03-18 00:41:24 +00:00
Constants.cpp IR: Add ConstantFP::getNaN() 2015-04-20 19:38:24 +00:00
ConstantsContext.h
Core.cpp Add the i128 builtin type to LLVM. 2015-04-17 15:32:15 +00:00
DataLayout.cpp COFF: Let globals with private linkage reside in their own section 2015-03-17 23:54:51 +00:00
DebugInfo.cpp DebugInfo: Remove DIArray and DITypeArray typedefs 2015-04-21 20:07:38 +00:00
DebugInfoMetadata.cpp DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable 2015-04-15 22:29:27 +00:00
DebugLoc.cpp DebugInfo: Delete subclasses of DIScope 2015-04-20 22:10:08 +00:00
DiagnosticInfo.cpp DebugInfo: Gut DILocation 2015-04-14 01:35:55 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp DebugInfo: Remove DIArray and DITypeArray typedefs 2015-04-21 20:07:38 +00:00
Dominators.cpp
Function.cpp IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
GCOV.cpp Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Globals.cpp
GVMaterializer.cpp
InlineAsm.cpp Silence sign compare warning. NFC. 2015-03-29 20:49:03 +00:00
Instruction.cpp Return iterator from Instruction::eraseFromParent. 2015-04-02 00:03:07 +00:00
Instructions.cpp Recommit r235458: [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst 2015-04-23 21:36:23 +00:00
IntrinsicInst.cpp
IRBuilder.cpp [opaque pointer type] More GEP IRBuilder API migrations... 2015-04-03 21:33:42 +00:00
IRPrintingPasses.cpp uselistorder: Pull the bit through PrintModulePass 2015-04-15 02:38:06 +00:00
LegacyPassManager.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp Add the i128 builtin type to LLVM. 2015-04-17 15:32:15 +00:00
LLVMContextImpl.h IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
Makefile
Mangler.cpp Revert "Address review comments" 2015-03-17 20:40:21 +00:00
MDBuilder.cpp
Metadata.cpp IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
MetadataImpl.h
MetadataTracking.cpp
Module.cpp Be lazy about loading metadata in IRObjectFile. 2015-03-13 21:54:20 +00:00
module.modulemap
Pass.cpp
PassManager.cpp
PassRegistry.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp Add the i128 builtin type to LLVM. 2015-04-17 15:32:15 +00:00
TypeFinder.cpp
Use.cpp
User.cpp
Value.cpp Move Value.isDereferenceablePointer to ValueTracking [NFC] 2015-04-23 17:36:48 +00:00
ValueSymbolTable.cpp
ValueTypes.cpp Add support for v1i128 type. 2015-04-17 16:11:05 +00:00
Verifier.cpp Verifier: Function metadata attachments require a body 2015-04-24 21:53:27 +00:00