diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-03-20 17:49:48 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-03-20 17:49:48 +0000 |
commit | 62f1fea4c5ecd56792354b97cecdb7e09c2bf70c (patch) | |
tree | 9169bd170fb38c57efcbe48f06d062f500fdcd5c /llvm/lib/IR | |
parent | 5e026f55e9e557d7370a640375407239b0f16e7e (diff) | |
download | bcm5719-llvm-62f1fea4c5ecd56792354b97cecdb7e09c2bf70c.tar.gz bcm5719-llvm-62f1fea4c5ecd56792354b97cecdb7e09c2bf70c.zip |
DIBuilder: allow linkage name to be specified for global variables
Patch by Kai Nacke (kai@redstar.de)
llvm-svn: 177547
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 48238e940f4..05f6c32cabd 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -773,17 +773,18 @@ DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Count) { return DISubrange(MDNode::get(VMContext, Elts)); } -/// createGlobalVariable - Create a new descriptor for the specified global. +/// \brief Create a new descriptor for the specified global. DIGlobalVariable DIBuilder:: -createGlobalVariable(StringRef Name, DIFile F, unsigned LineNumber, - DIType Ty, bool isLocalToUnit, Value *Val) { +createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile F, + unsigned LineNumber, DIType Ty, bool isLocalToUnit, + Value *Val) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_variable), Constant::getNullValue(Type::getInt32Ty(VMContext)), NULL, // TheCU, MDString::get(VMContext, Name), MDString::get(VMContext, Name), - MDString::get(VMContext, Name), + MDString::get(VMContext, LinkageName), F, ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), Ty, @@ -797,6 +798,14 @@ createGlobalVariable(StringRef Name, DIFile F, unsigned LineNumber, return DIGlobalVariable(Node); } +/// \brief Create a new descriptor for the specified global. +DIGlobalVariable DIBuilder:: +createGlobalVariable(StringRef Name, DIFile F, unsigned LineNumber, + DIType Ty, bool isLocalToUnit, Value *Val) { + return createGlobalVariable(Name, Name, F, LineNumber, Ty, isLocalToUnit, + Val); +} + /// createStaticVariable - Create a new descriptor for the specified static /// variable. DIGlobalVariable DIBuilder:: |