[cfe-dev] Debug Info Generation in Clang.

Cédric Venet cedric.venet at laposte.net
Fri Apr 25 11:37:46 PDT 2008


> Llvm-gcc uses TreeToLLVM class to generate code for a function.
> The Emit(tree exp, const MemRef *DestLoc) method of that class handles
> code generation for expressions and also emits the stoppoint intrinsics
> as the first thing.
> 
> I see that the corresponding place in clang is
> CodeGenFunction::EmitScalarExpr (const Expr *E).
> We can get the getExprLoc() from the Expr and use it to set the
> SourceLocation (File, Line) of the CodeGenDebugInfo instance everytime
> we emit an intrinsic.
> 
> Am I looking at the right places? Opinions welcome.
> 
> - Sanjiv
> 

I may be wrong, but shouldn't you better put it in
CodeGenFunction::EmitStmt. ScalarExpr is only one Expr on scalar type which
is one kind of Stmt. You would miss a lot of interesting stoppoint.
Also, for expression, you probably don't wan't to put a stoppoint for each
operation. I don't know what would be the best granularity for this...

Regards,

-- 
Cédric





More information about the cfe-dev mailing list