With this change, most 'g' options are rejected by CompilerInvocation.
They remain only as Driver options. The new way to request debug info
from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}"
and "-dwarf-version={2|3|4}". In the absence of a command-line option
to specify Dwarf version, the Toolchain decides it, rather than placing
Toolchain-specific logic in CompilerInvocation.
Also fix a bug in the Windows compatibility argument parsing
in which the "rightmost argument wins" principle failed.
Differential Revision: http://reviews.llvm.org/D13221
llvm-svn: 249655
31 lines
855 B
C++
31 lines
855 B
C++
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
|
|
// Test that the line table info for Foo<T>::bar() is pointing to the
|
|
// right header file.
|
|
// CHECK: define{{.*}}bar
|
|
// CHECK-NOT: define
|
|
// CHECK: ret {{.*}}, !dbg [[DBG:.*]]
|
|
// CHECK: [[HPP:.*]] = !DIFile(filename: "./template.hpp",
|
|
// CHECK: [[SP:.*]] = distinct !DISubprogram(name: "bar",
|
|
// CHECK-SAME: file: [[HPP]], line: 22
|
|
// CHECK-SAME: isDefinition: true
|
|
// We shouldn't need a lexical block for this function.
|
|
// CHECK: [[DBG]] = !DILocation(line: 23, scope: [[SP]])
|
|
|
|
|
|
# 1 "./template.h" 1
|
|
template <typename T>
|
|
class Foo {
|
|
public:
|
|
int bar();
|
|
};
|
|
# 21 "./template.hpp"
|
|
template <typename T>
|
|
int Foo<T>::bar() {
|
|
return 23;
|
|
}
|
|
int main (int argc, const char * argv[])
|
|
{
|
|
Foo<int> f;
|
|
return f.bar();
|
|
}
|