aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-03-17 21:13:55 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-03-17 21:13:55 +0000
commitb4cf0ab22b5a3ebb720f0b7287fdccfb465b6b7c (patch)
treeaf1cc4625e835e531afb2946538a2e29baaa8496 /lib/IR/DIBuilder.cpp
parent14de1a87ce2be1a2e9258ea6c8437482cdb480ec (diff)
downloadexternal_llvm-b4cf0ab22b5a3ebb720f0b7287fdccfb465b6b7c.zip
external_llvm-b4cf0ab22b5a3ebb720f0b7287fdccfb465b6b7c.tar.gz
external_llvm-b4cf0ab22b5a3ebb720f0b7287fdccfb465b6b7c.tar.bz2
Split out filename & directory from DIFile to start generalizing over DIScopes
This is the first step to making all DIScopes have a common metadata prefix (so that things (using directives, for example) that can appear in any scope can be added to that common prefix). DIFile is itself a DIScope so the common prefix of all DIScopes cannot be a DIFile - instead it's the raw filename/directory name pair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r--lib/IR/DIBuilder.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 5a82ed0..0622b90 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -117,11 +117,14 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
/// for a file.
DIFile DIBuilder::createFile(StringRef Filename, StringRef Directory) {
assert(!Filename.empty() && "Unable to create file without name");
- Value *Elts[] = {
- GetTagConstant(VMContext, dwarf::DW_TAG_file_type),
+ Value *Pair[] {
MDString::get(VMContext, Filename),
MDString::get(VMContext, Directory),
};
+ Value *Elts[] = {
+ GetTagConstant(VMContext, dwarf::DW_TAG_file_type),
+ MDNode::get(VMContext, Pair)
+ };
return DIFile(MDNode::get(VMContext, Elts));
}