forked from OSchip/llvm-project
Do not emit stop point for CXXDefaultArgExpr. It results in suboptimial user experience.
21 int main() { 22 A a; For example, here user would expect to stop at line 22, even if A's constructor leads to a call through CXXDefaultArgExpr. This fixes ostream-defined.exp regression from gdb testsuite. llvm-svn: 127164
This commit is contained in:
parent
cd526fa15e
commit
e65982c8c8
|
@ -1937,7 +1937,7 @@ LValue CodeGenFunction::EmitOpaqueValueLValue(const OpaqueValueExpr *e) {
|
||||||
|
|
||||||
RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
|
RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
|
||||||
ReturnValueSlot ReturnValue) {
|
ReturnValueSlot ReturnValue) {
|
||||||
if (CGDebugInfo *DI = getDebugInfo()) {
|
if (CGDebugInfo *DI = CGM.getDebugInfo()) {
|
||||||
DI->setLocation(E->getLocStart());
|
DI->setLocation(E->getLocStart());
|
||||||
DI->UpdateLineDirectiveRegion(Builder);
|
DI->UpdateLineDirectiveRegion(Builder);
|
||||||
DI->EmitStopPoint(Builder);
|
DI->EmitStopPoint(Builder);
|
||||||
|
|
|
@ -2567,8 +2567,13 @@ Value *CodeGenFunction::EmitScalarExpr(const Expr *E, bool IgnoreResultAssign) {
|
||||||
assert(E && !hasAggregateLLVMType(E->getType()) &&
|
assert(E && !hasAggregateLLVMType(E->getType()) &&
|
||||||
"Invalid scalar expression to emit");
|
"Invalid scalar expression to emit");
|
||||||
|
|
||||||
return ScalarExprEmitter(*this, IgnoreResultAssign)
|
if (isa<CXXDefaultArgExpr>(E))
|
||||||
|
CGM.disableDebugInfo();
|
||||||
|
Value *V = ScalarExprEmitter(*this, IgnoreResultAssign)
|
||||||
.Visit(const_cast<Expr*>(E));
|
.Visit(const_cast<Expr*>(E));
|
||||||
|
if (isa<CXXDefaultArgExpr>(E))
|
||||||
|
CGM.enableDebugInfo();
|
||||||
|
return V;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitScalarConversion - Emit a conversion from the specified type to the
|
/// EmitScalarConversion - Emit a conversion from the specified type to the
|
||||||
|
|
|
@ -64,7 +64,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
|
||||||
ABI(createCXXABI(*this)),
|
ABI(createCXXABI(*this)),
|
||||||
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo(), ABI),
|
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo(), ABI),
|
||||||
TBAA(0),
|
TBAA(0),
|
||||||
VTables(*this), Runtime(0),
|
VTables(*this), Runtime(0), DisableDebugInfo(false),
|
||||||
CFConstantStringClassRef(0), ConstantStringClassRef(0),
|
CFConstantStringClassRef(0), ConstantStringClassRef(0),
|
||||||
VMContext(M.getContext()),
|
VMContext(M.getContext()),
|
||||||
NSConcreteGlobalBlockDecl(0), NSConcreteStackBlockDecl(0),
|
NSConcreteGlobalBlockDecl(0), NSConcreteStackBlockDecl(0),
|
||||||
|
|
|
@ -152,6 +152,7 @@ class CodeGenModule : public CodeGenTypeCache {
|
||||||
|
|
||||||
CGObjCRuntime* Runtime;
|
CGObjCRuntime* Runtime;
|
||||||
CGDebugInfo* DebugInfo;
|
CGDebugInfo* DebugInfo;
|
||||||
|
bool DisableDebugInfo;
|
||||||
|
|
||||||
// WeakRefReferences - A set of references that have only been seen via
|
// WeakRefReferences - A set of references that have only been seen via
|
||||||
// a weakref so far. This is used to remove the weak of the reference if we ever
|
// a weakref so far. This is used to remove the weak of the reference if we ever
|
||||||
|
@ -281,7 +282,14 @@ public:
|
||||||
StaticLocalDeclMap[D] = GV;
|
StaticLocalDeclMap[D] = GV;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGDebugInfo *getDebugInfo() { return DebugInfo; }
|
CGDebugInfo *getDebugInfo() {
|
||||||
|
if (DisableDebugInfo)
|
||||||
|
return NULL;
|
||||||
|
return DebugInfo;
|
||||||
|
}
|
||||||
|
void disableDebugInfo() { DisableDebugInfo = true; }
|
||||||
|
void enableDebugInfo() { DisableDebugInfo = false; }
|
||||||
|
|
||||||
ASTContext &getContext() const { return Context; }
|
ASTContext &getContext() const { return Context; }
|
||||||
const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
|
const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
|
||||||
const LangOptions &getLangOptions() const { return Features; }
|
const LangOptions &getLangOptions() const { return Features; }
|
||||||
|
|
Loading…
Reference in New Issue