aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-03-20 17:49:48 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-03-20 17:49:48 +0000
commit3fac43d8b4111feca59d77941ac2ebd1f858dd33 (patch)
tree67a4f7003b51300eaefce49a9faefcc526454a59 /lib
parent980b5140ffb2e410b9e9981794ed0b52573a716e (diff)
DIBuilder: allow linkage name to be specified for global variables
Patch by Kai Nacke (kai@redstar.de) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/DIBuilder.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 48238e940f..05f6c32cab 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/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::