/// EmitFunctionStart - Constructs the debug code for entering a function -
/// "llvm.dbg.func.start.".
-void CGDebugInfo::EmitFunctionStart(const char *Name, QualType ReturnType,
+void CGDebugInfo::EmitFunctionStart(const char *Name, QualType FnType,
llvm::Function *Fn,
CGBuilderTy &Builder) {
const char *LinkageName = Name;
llvm::DISubprogram SP =
DebugFactory.CreateSubprogram(Unit, Name, Name, LinkageName, Unit, LineNo,
- getOrCreateType(ReturnType, Unit),
+ getOrCreateType(FnType, Unit),
Fn->hasInternalLinkage(), true/*definition*/);
#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
/// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate
/// start of a new function.
- void EmitFunctionStart(const char *Name, QualType ReturnType,
+ void EmitFunctionStart(const char *Name, QualType FnType,
llvm::Function *Fn, CGBuilderTy &Builder);
/// EmitRegionStart - Emit a call to llvm.dbg.region.start to indicate start
Builder.SetInsertPoint(EntryBB);
+ QualType FnType = getContext().getFunctionType(RetTy, 0, 0, false, 0);
+
// Emit subprogram debug descriptor.
// FIXME: The cast here is a huge hack.
if (CGDebugInfo *DI = getDebugInfo()) {
DI->setLocation(StartLoc);
if (isa<FunctionDecl>(D)) {
- DI->EmitFunctionStart(CGM.getMangledName(GD), RetTy, CurFn, Builder);
+ DI->EmitFunctionStart(CGM.getMangledName(GD), FnType, CurFn, Builder);
} else {
// Just use LLVM function name.
// FIXME: Remove unnecessary conversion to std::string when API settles.
DI->EmitFunctionStart(std::string(Fn->getName()).c_str(),
- RetTy, CurFn, Builder);
+ FnType, CurFn, Builder);
}
}
-// 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
void convert(void) {
struct { typeof(0) f0; } v0;
}
+
// PR2784
struct OPAQUE;
typedef struct OPAQUE *PTR;
return a0->p;
}
+
// PR3134
char xpto[];
+
// PR3427
struct foo {
int a;
};
struct foo bar;
+
// PR4143
struct foo2 {
enum bar *bar;
};
struct foo2 foo2;
+
+
+// CHECK: "barfoo"
+typedef int barfoo;
+barfoo foo() {
+}