mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
Add support for a temporary forward decl type. We want this so we
can rauw forward declarations if we decide to emit the full type. Part of rdar://10809898 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150024 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f99721a18
commit
4fe3457292
@ -341,6 +341,10 @@ namespace llvm {
|
||||
DIType createTemporaryType();
|
||||
DIType createTemporaryType(DIFile F);
|
||||
|
||||
/// createForwardDecl - Create a temporary forward-declared type.
|
||||
DIType createForwardDecl(unsigned Tag, StringRef Name, DIFile F,
|
||||
unsigned Line);
|
||||
|
||||
/// retainType - Retain DIType in a module even if it is not referenced
|
||||
/// through debug info anchors.
|
||||
void retainType(DIType T);
|
||||
|
@ -669,6 +669,28 @@ DIType DIBuilder::createTemporaryType(DIFile F) {
|
||||
return DIType(Node);
|
||||
}
|
||||
|
||||
/// createForwardDecl - Create a temporary forward-declared type that
|
||||
/// can be RAUW'd if the full type is seen.
|
||||
DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIFile F,
|
||||
unsigned Line) {
|
||||
// Create a temporary MDNode.
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, Tag),
|
||||
NULL, // TheCU
|
||||
MDString::get(VMContext, Name),
|
||||
F,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), Line),
|
||||
// To ease transition include sizes etc of 0.
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext),
|
||||
DIDescriptor::FlagFwdDecl)
|
||||
};
|
||||
MDNode *Node = MDNode::getTemporary(VMContext, Elts);
|
||||
return DIType(Node);
|
||||
}
|
||||
|
||||
/// getOrCreateArray - Get a DIArray, create one if required.
|
||||
DIArray DIBuilder::getOrCreateArray(ArrayRef<Value *> Elements) {
|
||||
if (Elements.empty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user