parent
dbe4424c37
commit
ae2559a221
|
@ -888,7 +888,7 @@ llvm::DIType CGDebugInfo::CreateTypeNode(QualType Ty,
|
||||||
|
|
||||||
/// EmitFunctionStart - Constructs the debug code for entering a function -
|
/// EmitFunctionStart - Constructs the debug code for entering a function -
|
||||||
/// "llvm.dbg.func.start.".
|
/// "llvm.dbg.func.start.".
|
||||||
void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
|
void CGDebugInfo::EmitFunctionStart(const char *Name, QualType FnType,
|
||||||
llvm::Function *Fn,
|
llvm::Function *Fn,
|
||||||
CGBuilderTy &Builder) {
|
CGBuilderTy &Builder) {
|
||||||
const char *LinkageName = Name;
|
const char *LinkageName = Name;
|
||||||
|
@ -906,7 +906,7 @@ void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
|
||||||
|
|
||||||
llvm::DISubprogram SP =
|
llvm::DISubprogram SP =
|
||||||
DebugFactory.CreateSubprogram(Unit, Name, Name, LinkageName, Unit, LineNo,
|
DebugFactory.CreateSubprogram(Unit, Name, Name, LinkageName, Unit, LineNo,
|
||||||
getOrCreateType(ReturnType, Unit),
|
getOrCreateType(FnType, Unit),
|
||||||
Fn->hasInternalLinkage(), true/*definition*/);
|
Fn->hasInternalLinkage(), true/*definition*/);
|
||||||
|
|
||||||
#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
|
#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
|
|
||||||
/// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate
|
/// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate
|
||||||
/// start of a new function.
|
/// start of a new function.
|
||||||
void EmitFunctionStart(const char *Name, QualType ReturnType,
|
void EmitFunctionStart(const char *Name, QualType FnType,
|
||||||
llvm::Function *Fn, CGBuilderTy &Builder);
|
llvm::Function *Fn, CGBuilderTy &Builder);
|
||||||
|
|
||||||
/// EmitRegionStart - Emit a call to llvm.dbg.region.start to indicate start
|
/// EmitRegionStart - Emit a call to llvm.dbg.region.start to indicate start
|
||||||
|
|
|
@ -167,18 +167,20 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
|
||||||
|
|
||||||
Builder.SetInsertPoint(EntryBB);
|
Builder.SetInsertPoint(EntryBB);
|
||||||
|
|
||||||
|
QualType FnType = getContext().getFunctionType(RetTy, 0, 0, false, 0);
|
||||||
|
|
||||||
// Emit subprogram debug descriptor.
|
// Emit subprogram debug descriptor.
|
||||||
// FIXME: The cast here is a huge hack.
|
// FIXME: The cast here is a huge hack.
|
||||||
if (CGDebugInfo *DI = getDebugInfo()) {
|
if (CGDebugInfo *DI = getDebugInfo()) {
|
||||||
DI->setLocation(StartLoc);
|
DI->setLocation(StartLoc);
|
||||||
if (isa<FunctionDecl>(D)) {
|
if (isa<FunctionDecl>(D)) {
|
||||||
DI->EmitFunctionStart(CGM.getMangledName(GD), RetTy, CurFn, Builder);
|
DI->EmitFunctionStart(CGM.getMangledName(GD), FnType, CurFn, Builder);
|
||||||
} else {
|
} else {
|
||||||
// Just use LLVM function name.
|
// Just use LLVM function name.
|
||||||
|
|
||||||
// FIXME: Remove unnecessary conversion to std::string when API settles.
|
// FIXME: Remove unnecessary conversion to std::string when API settles.
|
||||||
DI->EmitFunctionStart(std::string(Fn->getName()).c_str(),
|
DI->EmitFunctionStart(std::string(Fn->getName()).c_str(),
|
||||||
RetTy, CurFn, Builder);
|
FnType, CurFn, Builder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
// RUN: clang-cc -o %t --emit-llvm -g %s
|
// RUN: clang-cc -o %t --emit-llvm -g %s &&
|
||||||
|
// RUN: FileCheck --input-file=%t %s
|
||||||
|
|
||||||
// PR3023
|
// PR3023
|
||||||
void convert(void) {
|
void convert(void) {
|
||||||
struct { typeof(0) f0; } v0;
|
struct { typeof(0) f0; } v0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// PR2784
|
// PR2784
|
||||||
struct OPAQUE;
|
struct OPAQUE;
|
||||||
typedef struct OPAQUE *PTR;
|
typedef struct OPAQUE *PTR;
|
||||||
|
@ -19,9 +21,11 @@ struct s0 *f0(struct s0 *a0) {
|
||||||
return a0->p;
|
return a0->p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// PR3134
|
// PR3134
|
||||||
char xpto[];
|
char xpto[];
|
||||||
|
|
||||||
|
|
||||||
// PR3427
|
// PR3427
|
||||||
struct foo {
|
struct foo {
|
||||||
int a;
|
int a;
|
||||||
|
@ -29,9 +33,16 @@ struct foo {
|
||||||
};
|
};
|
||||||
struct foo bar;
|
struct foo bar;
|
||||||
|
|
||||||
|
|
||||||
// PR4143
|
// PR4143
|
||||||
struct foo2 {
|
struct foo2 {
|
||||||
enum bar *bar;
|
enum bar *bar;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct foo2 foo2;
|
struct foo2 foo2;
|
||||||
|
|
||||||
|
|
||||||
|
// CHECK: "barfoo"
|
||||||
|
typedef int barfoo;
|
||||||
|
barfoo foo() {
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue