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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127164
91177308-0d34-0410-b5e6-
96231b3b80d8
RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
ReturnValueSlot ReturnValue) {
- if (CGDebugInfo *DI = getDebugInfo()) {
+ if (CGDebugInfo *DI = CGM.getDebugInfo()) {
DI->setLocation(E->getLocStart());
DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
assert(E && !hasAggregateLLVMType(E->getType()) &&
"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));
+ if (isa<CXXDefaultArgExpr>(E))
+ CGM.enableDebugInfo();
+ return V;
}
/// EmitScalarConversion - Emit a conversion from the specified type to the
ABI(createCXXABI(*this)),
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo(), ABI),
TBAA(0),
- VTables(*this), Runtime(0),
+ VTables(*this), Runtime(0), DisableDebugInfo(false),
CFConstantStringClassRef(0), ConstantStringClassRef(0),
VMContext(M.getContext()),
NSConcreteGlobalBlockDecl(0), NSConcreteStackBlockDecl(0),
CGObjCRuntime* Runtime;
CGDebugInfo* DebugInfo;
+ bool DisableDebugInfo;
// 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
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; }
const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
const LangOptions &getLangOptions() const { return Features; }