mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
PR9214: Convert the DIBuilder API to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -16,6 +16,7 @@
|
|||||||
#define LLVM_ANALYSIS_DIBUILDER_H
|
#define LLVM_ANALYSIS_DIBUILDER_H
|
||||||
|
|
||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
|
#include "llvm/ADT/ArrayRef.h"
|
||||||
#include "llvm/ADT/StringRef.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -302,7 +303,7 @@ namespace llvm {
|
|||||||
DIDescriptor createUnspecifiedParameter();
|
DIDescriptor createUnspecifiedParameter();
|
||||||
|
|
||||||
/// getOrCreateArray - Get a DIArray, create one if required.
|
/// getOrCreateArray - Get a DIArray, create one if required.
|
||||||
DIArray getOrCreateArray(Value *const *Elements, unsigned NumElements);
|
DIArray getOrCreateArray(ArrayRef<Value *> Elements);
|
||||||
|
|
||||||
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
||||||
/// implicitly uniques the values returned.
|
/// implicitly uniques the values returned.
|
||||||
@ -369,14 +370,13 @@ namespace llvm {
|
|||||||
/// @param File File where this variable is defined.
|
/// @param File File where this variable is defined.
|
||||||
/// @param LineNo Line number.
|
/// @param LineNo Line number.
|
||||||
/// @param Ty Variable Type
|
/// @param Ty Variable Type
|
||||||
/// @param Addr A pointer to a vector of complex address operations.
|
/// @param Addr An array of complex address operations.
|
||||||
/// @param NumAddr Num of address operations in the vector.
|
|
||||||
/// @param ArgNo If this variable is an arugment then this argument's
|
/// @param ArgNo If this variable is an arugment then this argument's
|
||||||
/// number. 1 indicates 1st argument.
|
/// number. 1 indicates 1st argument.
|
||||||
DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
||||||
StringRef Name, DIFile F, unsigned LineNo,
|
StringRef Name, DIFile F, unsigned LineNo,
|
||||||
DIType Ty, Value *const *Addr,
|
DIType Ty, ArrayRef<Value *> Addr,
|
||||||
unsigned NumAddr, unsigned ArgNo = 0);
|
unsigned ArgNo = 0);
|
||||||
|
|
||||||
/// createFunction - Create a new descriptor for the specified subprogram.
|
/// createFunction - Create a new descriptor for the specified subprogram.
|
||||||
/// See comments in DISubprogram for descriptions of these fields.
|
/// See comments in DISubprogram for descriptions of these fields.
|
||||||
|
@ -537,14 +537,12 @@ DIType DIBuilder::createTemporaryType(DIFile F) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// getOrCreateArray - Get a DIArray, create one if required.
|
/// getOrCreateArray - Get a DIArray, create one if required.
|
||||||
DIArray DIBuilder::getOrCreateArray(Value *const *Elements,
|
DIArray DIBuilder::getOrCreateArray(ArrayRef<Value *> Elements) {
|
||||||
unsigned NumElements) {
|
if (Elements.empty()) {
|
||||||
if (NumElements == 0) {
|
|
||||||
Value *Null = llvm::Constant::getNullValue(Type::getInt32Ty(VMContext));
|
Value *Null = llvm::Constant::getNullValue(Type::getInt32Ty(VMContext));
|
||||||
return DIArray(MDNode::get(VMContext, Null));
|
return DIArray(MDNode::get(VMContext, Null));
|
||||||
}
|
}
|
||||||
return DIArray(MDNode::get(VMContext,
|
return DIArray(MDNode::get(VMContext, Elements));
|
||||||
ArrayRef<Value*>(Elements, NumElements)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
||||||
@ -649,8 +647,8 @@ DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
|||||||
DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
||||||
StringRef Name, DIFile F,
|
StringRef Name, DIFile F,
|
||||||
unsigned LineNo,
|
unsigned LineNo,
|
||||||
DIType Ty, Value *const *Addr,
|
DIType Ty, ArrayRef<Value *> Addr,
|
||||||
unsigned NumAddr, unsigned ArgNo) {
|
unsigned ArgNo) {
|
||||||
SmallVector<Value *, 15> Elts;
|
SmallVector<Value *, 15> Elts;
|
||||||
Elts.push_back(GetTagConstant(VMContext, Tag));
|
Elts.push_back(GetTagConstant(VMContext, Tag));
|
||||||
Elts.push_back(Scope);
|
Elts.push_back(Scope);
|
||||||
@ -658,7 +656,7 @@ DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
|||||||
Elts.push_back(F);
|
Elts.push_back(F);
|
||||||
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), (LineNo | (ArgNo << 24))));
|
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), (LineNo | (ArgNo << 24))));
|
||||||
Elts.push_back(Ty);
|
Elts.push_back(Ty);
|
||||||
Elts.append(Addr, Addr+NumAddr);
|
Elts.append(Addr.begin(), Addr.end());
|
||||||
|
|
||||||
return DIVariable(MDNode::get(VMContext, Elts));
|
return DIVariable(MDNode::get(VMContext, Elts));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user