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
Attributes.cpp
AutoUpgrade.cpp [opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType 2015-04-24 21:16:07 +00:00
BasicBlock.cpp
CMakeLists.txt
Comdat.cpp
ConstantFold.cpp Correct extractelement constant folding 2015-04-24 07:42:35 +00:00
ConstantFold.h
ConstantRange.cpp
Constants.cpp IR: Add ConstantFP::getNaN() 2015-04-20 19:38:24 +00:00
ConstantsContext.h
Core.cpp
DataLayout.cpp
DebugInfo.cpp DebugInfo: Remove DIArray and DITypeArray typedefs 2015-04-21 20:07:38 +00:00
DebugInfoMetadata.cpp
DebugLoc.cpp DebugInfo: Delete subclasses of DIScope 2015-04-20 22:10:08 +00:00
DiagnosticInfo.cpp
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
Globals.cpp
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp
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
IRPrintingPasses.cpp
LegacyPassManager.cpp
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp
LLVMContextImpl.h IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
Makefile
Mangler.cpp
MDBuilder.cpp
Metadata.cpp IR: Add Function metadata attachments 2015-04-24 21:51:02 +00:00
MetadataImpl.h
MetadataTracking.cpp
Module.cpp
module.modulemap
Pass.cpp
PassManager.cpp
PassRegistry.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp
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