mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
0eee52640f
This patch implements PR31013 by introducing a DIGlobalVariableExpression that holds a pair of DIGlobalVariable and DIExpression. Currently, DIGlobalVariables holds a DIExpression. This is not the best way to model this: (1) The DIGlobalVariable should describe the source level variable, not how to get to its location. (2) It makes it unsafe/hard to update the expressions when we call replaceExpression on the DIGLobalVariable. (3) It makes it impossible to represent a global variable that is in more than one location (e.g., a variable with multiple DW_OP_LLVM_fragment-s). We also moved away from attaching the DIExpression to DILocalVariable for the same reasons. <rdar://problem/29250149> https://llvm.org/bugs/show_bug.cgi?id=31013 Differential Revision: https://reviews.llvm.org/D26769 llvm-svn: 289902
126 lines
4.9 KiB
C++
126 lines
4.9 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_LEAF_UNIQUABLE || defined HANDLE_MDNODE_BRANCH || \
|
|
defined HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE || \
|
|
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 specialized and uniquable leaf nodes under MDNode. Defers to
|
|
// HANDLE_MDNODE_LEAF_UNIQUABLE if it's defined, otherwise to
|
|
// HANDLE_SPECIALIZED_MDNODE_LEAF.
|
|
#ifndef HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE
|
|
#ifdef HANDLE_MDNODE_LEAF_UNIQUABLE
|
|
#define HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(CLASS) \
|
|
HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS)
|
|
#else
|
|
#define HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(CLASS) \
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS)
|
|
#endif
|
|
#endif
|
|
|
|
// Handler for leaf nodes under MDNode.
|
|
#ifndef HANDLE_MDNODE_LEAF_UNIQUABLE
|
|
#define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) HANDLE_MDNODE_LEAF(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_METADATA_LEAF(DistinctMDOperandPlaceholder)
|
|
HANDLE_MDNODE_BRANCH(MDNode)
|
|
HANDLE_MDNODE_LEAF_UNIQUABLE(MDTuple)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILocation)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIExpression)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGlobalVariableExpression)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DINode)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(GenericDINode)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubrange)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIEnumerator)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DIScope)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DIType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIBasicType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIDerivedType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DICompositeType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubroutineType)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIFile)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF(DICompileUnit)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DILocalScope)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubprogram)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DILexicalBlockBase)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILexicalBlock)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILexicalBlockFile)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DINamespace)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIModule)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DITemplateParameter)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DITemplateTypeParameter)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DITemplateValueParameter)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DIVariable)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGlobalVariable)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILocalVariable)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIObjCProperty)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIImportedEntity)
|
|
HANDLE_SPECIALIZED_MDNODE_BRANCH(DIMacroNode)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIMacro)
|
|
HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIMacroFile)
|
|
|
|
#undef HANDLE_METADATA
|
|
#undef HANDLE_METADATA_LEAF
|
|
#undef HANDLE_METADATA_BRANCH
|
|
#undef HANDLE_MDNODE_LEAF
|
|
#undef HANDLE_MDNODE_LEAF_UNIQUABLE
|
|
#undef HANDLE_MDNODE_BRANCH
|
|
#undef HANDLE_SPECIALIZED_MDNODE_LEAF
|
|
#undef HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE
|
|
#undef HANDLE_SPECIALIZED_MDNODE_BRANCH
|