forked from OSchip/llvm-project
parent
7d9f67f76e
commit
b76b57fefd
|
@ -3149,7 +3149,7 @@ CGDebugInfo::CollectAnonRecordDecls(const RecordDecl *RD, llvm::DIFile Unit,
|
|||
continue;
|
||||
}
|
||||
// Use VarDecl's Tag, Scope and Line number.
|
||||
GV = DBuilder.createStaticVariable(DContext, FieldName, LinkageName, Unit,
|
||||
GV = DBuilder.createGlobalVariable(DContext, FieldName, LinkageName, Unit,
|
||||
LineNo, FieldTy,
|
||||
Var->hasInternalLinkage(), Var,
|
||||
llvm::DIDerivedType());
|
||||
|
@ -3201,7 +3201,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
|
|||
assert(RD->isAnonymousStructOrUnion() && "unnamed non-anonymous struct or union?");
|
||||
GV = CollectAnonRecordDecls(RD, Unit, LineNo, LinkageName, Var, DContext);
|
||||
} else {
|
||||
GV = DBuilder.createStaticVariable(
|
||||
GV = DBuilder.createGlobalVariable(
|
||||
DContext, DeclName, LinkageName, Unit, LineNo, getOrCreateType(T, Unit),
|
||||
Var->hasInternalLinkage(), Var,
|
||||
getOrCreateStaticDataMemberDeclarationOrNull(D));
|
||||
|
@ -3234,7 +3234,7 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
|
|||
return;
|
||||
llvm::DIDescriptor DContext =
|
||||
getContextDescriptor(dyn_cast<Decl>(VD->getDeclContext()));
|
||||
llvm::DIGlobalVariable GV = DBuilder.createStaticVariable(
|
||||
llvm::DIGlobalVariable GV = DBuilder.createGlobalVariable(
|
||||
DContext, Name, StringRef(), Unit, getLineNumber(VD->getLocation()), Ty,
|
||||
true, Init,
|
||||
getOrCreateStaticDataMemberDeclarationOrNull(cast<VarDecl>(VD)));
|
||||
|
|
|
@ -451,33 +451,8 @@ namespace llvm {
|
|||
/// implicitly uniques the values returned.
|
||||
DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
|
||||
|
||||
/// createGlobalVariable - Create a new descriptor for the specified global.
|
||||
/// @param Name Name of the variable.
|
||||
/// @param File File where this variable is defined.
|
||||
/// @param LineNo Line number.
|
||||
/// @param Ty Variable Type.
|
||||
/// @param isLocalToUnit Boolean flag indicate whether this variable is
|
||||
/// externally visible or not.
|
||||
/// @param Val llvm::Value of the variable.
|
||||
DIGlobalVariable
|
||||
createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
|
||||
DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val);
|
||||
|
||||
/// \brief Create a new descriptor for the specified global.
|
||||
/// @param Name Name of the variable.
|
||||
/// @param LinkageName Mangled variable name.
|
||||
/// @param File File where this variable is defined.
|
||||
/// @param LineNo Line number.
|
||||
/// @param Ty Variable Type.
|
||||
/// @param isLocalToUnit Boolean flag indicate whether this variable is
|
||||
/// externally visible or not.
|
||||
/// @param Val llvm::Value of the variable.
|
||||
DIGlobalVariable
|
||||
createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
|
||||
unsigned LineNo, DITypeRef Ty, bool isLocalToUnit,
|
||||
llvm::Value *Val);
|
||||
|
||||
/// createStaticVariable - Create a new descriptor for the specified
|
||||
/// createGlobalVariable - Create a new descriptor for the specified
|
||||
/// variable.
|
||||
/// @param Context Variable scope.
|
||||
/// @param Name Name of the variable.
|
||||
|
@ -490,15 +465,15 @@ namespace llvm {
|
|||
/// @param Val llvm::Value of the variable.
|
||||
/// @param Decl Reference to the corresponding declaration.
|
||||
DIGlobalVariable
|
||||
createStaticVariable(DIDescriptor Context, StringRef Name,
|
||||
createGlobalVariable(DIDescriptor Context, StringRef Name,
|
||||
StringRef LinkageName, DIFile File, unsigned LineNo,
|
||||
DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val,
|
||||
MDNode *Decl = nullptr);
|
||||
|
||||
/// createTempStaticVariableFwdDecl - Identical to createStaticVariable
|
||||
/// createTempGlobalVariableFwdDecl - Identical to createGlobalVariable
|
||||
/// except that the resulting DbgNode is temporary and meant to be RAUWed.
|
||||
DIGlobalVariable
|
||||
createTempStaticVariableFwdDecl(DIDescriptor Context, StringRef Name,
|
||||
createTempGlobalVariableFwdDecl(DIDescriptor Context, StringRef Name,
|
||||
StringRef LinkageName, DIFile File,
|
||||
unsigned LineNo, DITypeRef Ty,
|
||||
bool isLocalToUnit, llvm::Value *Val,
|
||||
|
|
|
@ -948,44 +948,8 @@ DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Count) {
|
|||
return DISubrange(MDNode::get(VMContext, Elts));
|
||||
}
|
||||
|
||||
/// \brief Create a new descriptor for the specified global.
|
||||
DIGlobalVariable DIBuilder::createGlobalVariable(StringRef Name,
|
||||
StringRef LinkageName,
|
||||
DIFile F, unsigned LineNumber,
|
||||
DITypeRef Ty, bool isLocalToUnit,
|
||||
Value *Val) {
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_variable),
|
||||
Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||
nullptr, // TheCU,
|
||||
MDString::get(VMContext, Name),
|
||||
MDString::get(VMContext, Name),
|
||||
MDString::get(VMContext, LinkageName),
|
||||
F,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||
Ty,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), isLocalToUnit),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), 1), /* isDefinition*/
|
||||
Val,
|
||||
DIDescriptor()
|
||||
};
|
||||
MDNode *Node = MDNode::get(VMContext, Elts);
|
||||
AllGVs.push_back(Node);
|
||||
return DIGlobalVariable(Node);
|
||||
}
|
||||
|
||||
/// \brief Create a new descriptor for the specified global.
|
||||
DIGlobalVariable DIBuilder::createGlobalVariable(StringRef Name, DIFile F,
|
||||
unsigned LineNumber,
|
||||
DITypeRef Ty,
|
||||
bool isLocalToUnit,
|
||||
Value *Val) {
|
||||
return createGlobalVariable(Name, Name, F, LineNumber, Ty, isLocalToUnit,
|
||||
Val);
|
||||
}
|
||||
|
||||
static DIGlobalVariable
|
||||
createStaticVariableHelper(LLVMContext &VMContext, DIDescriptor Context,
|
||||
createGlobalVariableHelper(LLVMContext &VMContext, DIDescriptor Context,
|
||||
StringRef Name, StringRef LinkageName, DIFile F,
|
||||
unsigned LineNumber, DITypeRef Ty, bool isLocalToUnit,
|
||||
Value *Val, MDNode *Decl, bool isDefinition,
|
||||
|
@ -1009,16 +973,16 @@ createStaticVariableHelper(LLVMContext &VMContext, DIDescriptor Context,
|
|||
return DIGlobalVariable(CreateFunc(Elts));
|
||||
}
|
||||
|
||||
/// createStaticVariable - Create a new descriptor for the specified
|
||||
/// createGlobalVariable - Create a new descriptor for the specified
|
||||
/// variable.
|
||||
DIGlobalVariable DIBuilder::createStaticVariable(DIDescriptor Context,
|
||||
DIGlobalVariable DIBuilder::createGlobalVariable(DIDescriptor Context,
|
||||
StringRef Name,
|
||||
StringRef LinkageName,
|
||||
DIFile F, unsigned LineNumber,
|
||||
DITypeRef Ty,
|
||||
bool isLocalToUnit,
|
||||
Value *Val, MDNode *Decl) {
|
||||
return createStaticVariableHelper(VMContext, Context, Name, LinkageName, F,
|
||||
return createGlobalVariableHelper(VMContext, Context, Name, LinkageName, F,
|
||||
LineNumber, Ty, isLocalToUnit, Val, Decl, true,
|
||||
[&] (ArrayRef<Value *> Elts) -> MDNode * {
|
||||
MDNode *Node = MDNode::get(VMContext, Elts);
|
||||
|
@ -1027,17 +991,17 @@ DIGlobalVariable DIBuilder::createStaticVariable(DIDescriptor Context,
|
|||
});
|
||||
}
|
||||
|
||||
/// createTempStaticVariableFwdDecl - Create a new temporary descriptor for the
|
||||
/// createTempGlobalVariableFwdDecl - Create a new temporary descriptor for the
|
||||
/// specified variable declarartion.
|
||||
DIGlobalVariable
|
||||
DIBuilder::createTempStaticVariableFwdDecl(DIDescriptor Context,
|
||||
DIBuilder::createTempGlobalVariableFwdDecl(DIDescriptor Context,
|
||||
StringRef Name,
|
||||
StringRef LinkageName,
|
||||
DIFile F, unsigned LineNumber,
|
||||
DITypeRef Ty,
|
||||
bool isLocalToUnit,
|
||||
Value *Val, MDNode *Decl) {
|
||||
return createStaticVariableHelper(VMContext, Context, Name, LinkageName, F,
|
||||
return createGlobalVariableHelper(VMContext, Context, Name, LinkageName, F,
|
||||
LineNumber, Ty, isLocalToUnit, Val, Decl, false,
|
||||
[&] (ArrayRef<Value *> Elts) {
|
||||
return MDNode::getTemporary(VMContext, Elts);
|
||||
|
|
Loading…
Reference in New Issue