mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-07 12:07:17 +00:00
ab10069039
Add a subclass of `MDScope` to explicitly categorize the legal scopes for locals -- in particular, scopes that are legal for `MDLocation`, `MDLexicalBlockBase`, and `MDLocalVariable`. This provides a convenient `isa<>` target for the verifier, and eventually I'll be changing the above classes' `getScope()` to specifically return it. Currently, its subclasses are `MDSubprogram`, `MDLexicalBlock`, and `MDLexicalBlockFile`. I've gone with `MDLocalScope` for now -- a little ambiguous since it's a scope *for* locals, not a scope that's local -- but I'm open to more descriptive names if someone can think of something better. Regardless, the code docs should make it clear enough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233092 91177308-0d34-0410-b5e6-96231b3b80d8
101 lines
3.7 KiB
C++
101 lines
3.7 KiB
C++
//===- llvm/IR/Metadata.def - Metadata definitions --------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Macros for running through all types of metadata.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#if !(defined HANDLE_METADATA || defined HANDLE_METADATA_LEAF || \
|
|
defined HANDLE_METADATA_BRANCH || defined HANDLE_MDNODE_LEAF || \
|
|
defined HANDLE_MDNODE_BRANCH || \
|
|
defined HANDLE_SPECIALIZED_MDNODE_LEAF || \
|
|
defined HANDLE_SPECIALIZED_MDNODE_BRANCH)
|
|
#error "Missing macro definition of HANDLE_METADATA*"
|
|
#endif
|
|
|
|
// Handler for all types of metadata.
|
|
#ifndef HANDLE_METADATA
|
|
#define HANDLE_METADATA(CLASS)
|
|
#endif
|
|
|
|
// Handler for leaf nodes in the class hierarchy.
|
|
#ifndef HANDLE_METADATA_LEAF
|
|
#define HANDLE_METADATA_LEAF(CLASS) HANDLE_METADATA(CLASS)
|
|
#endif
|
|
|
|
// Handler for non-leaf nodes in the class hierarchy.
|
|
#ifndef HANDLE_METADATA_BRANCH
|
|
#define HANDLE_METADATA_BRANCH(CLASS) HANDLE_METADATA(CLASS)
|
|
#endif
|
|
|
|
// Handler for leaf nodes under MDNode.
|
|
#ifndef HANDLE_MDNODE_LEAF
|
|
#define HANDLE_MDNODE_LEAF(CLASS) HANDLE_METADATA_LEAF(CLASS)
|
|
#endif
|
|
|
|
// Handler for non-leaf nodes under MDNode.
|
|
#ifndef HANDLE_MDNODE_BRANCH
|
|
#define HANDLE_MDNODE_BRANCH(CLASS) HANDLE_METADATA_BRANCH(CLASS)
|
|
#endif
|
|
|
|
// Handler for specialized leaf nodes under MDNode.
|
|
#ifndef HANDLE_SPECIALIZED_MDNODE_LEAF
|
|
#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) HANDLE_MDNODE_LEAF(CLASS)
|
|
#endif
|
|
|
|
// Handler for specialized non-leaf nodes under MDNode.
|
|
#ifndef HANDLE_SPECIALIZED_MDNODE_BRANCH
|
|
#define HANDLE_SPECIALIZED_MDNODE_BRANCH(CLASS) HANDLE_MDNODE_BRANCH(CLASS)
|
|
#endif
|
|
|
|
HANDLE_METADATA_LEAF(MDString)
|
|
HANDLE_METADATA_BRANCH(ValueAsMetadata)
|
|
HANDLE_METADATA_LEAF(ConstantAsMetadata)
|
|
HANDLE_METADATA_LEAF(LocalAsMetadata)
|
|
HANDLE_MDNODE_BRANCH(MDNode)
|
|
HANDLE_MDNODE_LEAF(MDTuple)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDLocation)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDExpression)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DebugNode)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(GenericDebugNode)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDSubrange)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDEnumerator)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDScope)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDBasicType)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDDerivedTypeBase)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDDerivedType)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDCompositeTypeBase)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDCompositeType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDSubroutineType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDFile)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDCompileUnit)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDLocalScope)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDSubprogram)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDLexicalBlockBase)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDLexicalBlock)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDLexicalBlockFile)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDNamespace)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDTemplateParameter)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDTemplateTypeParameter)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDTemplateValueParameter)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(MDVariable)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDGlobalVariable)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDLocalVariable)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDObjCProperty)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(MDImportedEntity)
|
|
|
|
#undef HANDLE_METADATA
|
|
#undef HANDLE_METADATA_LEAF
|
|
#undef HANDLE_METADATA_BRANCH
|
|
#undef HANDLE_MDNODE_LEAF
|
|
#undef HANDLE_MDNODE_BRANCH
|
|
#undef HANDLE_SPECIALIZED_MDNODE_LEAF
|
|
#undef HANDLE_SPECIALIZED_MDNODE_BRANCH
|