Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick bugfixes #36

Merged
merged 2 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,11 @@ void CGDebugInfo::CreateCompileUnit() {
// file to determine the real absolute path for the file.
std::string MainFileDir;
if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) {
MainFileDir = remapDIPath(MainFile->getDir()->getName());
if (MainFileDir != ".") {
MainFileDir = MainFile->getDir()->getName();
if (!llvm::sys::path::is_absolute(MainFileName)) {
llvm::SmallString<1024> MainFileDirSS(MainFileDir);
llvm::sys::path::append(MainFileDirSS, MainFileName);
MainFileName = MainFileDirSS.str();
MainFileName = llvm::sys::path::remove_leading_dotslash(MainFileDirSS);
}
// If the main file name provided is identical to the input file name, and
// if the input file is a preprocessed source, use the module name for
Expand Down
1 change: 0 additions & 1 deletion clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3400,7 +3400,6 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
Args.getLastArg(options::OPT_ggnu_pubnames, options::OPT_gno_gnu_pubnames,
options::OPT_gpubnames, options::OPT_gno_pubnames);
if (DwarfFission != DwarfFissionKind::None ||
DebuggerTuning == llvm::DebuggerKind::LLDB ||
(PubnamesArg && checkDebugInfoOption(PubnamesArg, Args, D, TC)))
if (!PubnamesArg ||
(!PubnamesArg->getOption().matches(options::OPT_gno_gnu_pubnames) &&
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/debug-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
//
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=GPUB %s
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
//
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
Expand Down
22 changes: 22 additions & 0 deletions clang/test/PCH/debug-info-pch-container-path.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// REQUIRES: asserts

// Modules:
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cd %t

// RUN: %clang_cc1 -fmodule-format=obj -emit-pch \
// RUN: -triple %itanium_abi_triple \
// RUN: -fdebug-prefix-map=%t=BUILD \
// RUN: -fdebug-prefix-map=%S=SOURCE \
// RUN: -o %t/prefix.ll %S/debug-info-limited-struct.h \
// RUN: -mllvm -debug-only=pchcontainer &>%t-container.ll
// RUN: cat %t-container.ll | FileCheck %s

// CHECK: distinct !DICompileUnit(
// CHECK-SAME: language: DW_LANG_C99,
// CHECK-SAME: file: ![[FILE:[0-9]+]],
// CHECK: ![[FILE]] = !DIFile(
// CHECK-SAME: filename: "SOURCE/debug-info-limited-struct.h",
// CHECK-SAME: directory: "BUILD"