Make CreateComplexVariable independent of SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114439 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-09-21 16:00:03 +00:00
parent f165806655
commit 28b4afc103
2 changed files with 9 additions and 11 deletions

View File

@ -726,10 +726,9 @@ namespace llvm {
/// CreateComplexVariable - Create a new descriptor for the specified /// CreateComplexVariable - Create a new descriptor for the specified
/// variable which has a complex address expression for its address. /// variable which has a complex address expression for its address.
DIVariable CreateComplexVariable(unsigned Tag, DIDescriptor Context, DIVariable CreateComplexVariable(unsigned Tag, DIDescriptor Context,
const std::string &Name, StringRef Name, DIFile F, unsigned LineNo,
DIFile F, unsigned LineNo, DIType Ty, Value *const *Addr,
DIType Ty, unsigned NumAddr);
SmallVector<Value *, 9> &addr);
/// CreateLexicalBlock - This creates a descriptor for a lexical block /// CreateLexicalBlock - This creates a descriptor for a lexical block
/// with the specified parent context. /// with the specified parent context.

View File

@ -1181,21 +1181,20 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
/// CreateComplexVariable - Create a new descriptor for the specified variable /// CreateComplexVariable - Create a new descriptor for the specified variable
/// which has a complex address expression for its address. /// which has a complex address expression for its address.
DIVariable DIFactory::CreateComplexVariable(unsigned Tag, DIDescriptor Context, DIVariable DIFactory::CreateComplexVariable(unsigned Tag, DIDescriptor Context,
const std::string &Name, StringRef Name, DIFile F,
DIFile F,
unsigned LineNo, unsigned LineNo,
DIType Ty, DIType Ty, Value *const *Addr,
SmallVector<Value *, 9> &addr) { unsigned NumAddr) {
SmallVector<Value *, 9> Elts; SmallVector<Value *, 15> Elts;
Elts.push_back(GetTagConstant(Tag)); Elts.push_back(GetTagConstant(Tag));
Elts.push_back(Context); Elts.push_back(Context);
Elts.push_back(MDString::get(VMContext, Name)); Elts.push_back(MDString::get(VMContext, Name));
Elts.push_back(F); Elts.push_back(F);
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)); Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), LineNo));
Elts.push_back(Ty); Elts.push_back(Ty);
Elts.insert(Elts.end(), addr.begin(), addr.end()); Elts.append(Addr, Addr+NumAddr);
return DIVariable(MDNode::get(VMContext, &Elts[0], 6+addr.size())); return DIVariable(MDNode::get(VMContext, Elts.data(), Elts.size()));
} }