summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorAmjad Aboud <amjad.aboud@intel.com>2016-12-14 20:24:54 +0000
committerAmjad Aboud <amjad.aboud@intel.com>2016-12-14 20:24:54 +0000
commit43c8b6b7b2277e1ae07ca86ee58859a5aab6acc1 (patch)
tree423dfb9b91765b0ad1696cf04ba9fc3716e1e3f3 /llvm/lib/IR/DIBuilder.cpp
parentfa9a17ee80eb7ca6f3b74411f5a4b7d4d578e300 (diff)
downloadbcm5719-llvm-43c8b6b7b2277e1ae07ca86ee58859a5aab6acc1.tar.gz
bcm5719-llvm-43c8b6b7b2277e1ae07ca86ee58859a5aab6acc1.zip
[DebugInfo] Changed DIBuilder::createCompileUnit() to take DIFile instead of FileName and Directory.
This way it will be easier to expand DIFile (e.g., to contain checksum) without the need to modify the createCompileUnit() API. Reviewers: llvm-commits, rnk Differential Revision: https://reviews.llvm.org/D27762 llvm-svn: 289702
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 650a255b6df..dfca6895590 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -109,22 +109,20 @@ static DIScope *getNonCompileUnitScope(DIScope *N) {
}
DICompileUnit *DIBuilder::createCompileUnit(
- unsigned Lang, StringRef Filename, StringRef Directory, StringRef Producer,
- bool isOptimized, StringRef Flags, unsigned RunTimeVer, StringRef SplitName,
+ unsigned Lang, DIFile *File, StringRef Producer, bool isOptimized,
+ StringRef Flags, unsigned RunTimeVer, StringRef SplitName,
DICompileUnit::DebugEmissionKind Kind, uint64_t DWOId,
bool SplitDebugInlining) {
assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) ||
(Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) &&
"Invalid Language tag");
- assert(!Filename.empty() &&
- "Unable to create compile unit without filename");
assert(!CUNode && "Can only make one compile unit per DIBuilder instance");
CUNode = DICompileUnit::getDistinct(
- VMContext, Lang, DIFile::get(VMContext, Filename, Directory), Producer,
- isOptimized, Flags, RunTimeVer, SplitName, Kind, nullptr, nullptr,
- nullptr, nullptr, nullptr, DWOId, SplitDebugInlining);
+ VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer,
+ SplitName, Kind, nullptr, nullptr, nullptr, nullptr, nullptr, DWOId,
+ SplitDebugInlining);
// Create a named metadata so that it is easier to find cu in a module.
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
OpenPOWER on IntegriCloud