[PATCH] multiple inlining scopes for a single source location

Adrian Prantl aprantl at apple.com
Tue Mar 12 11:39:32 PDT 2013

On Mar 6, 2013, at 1:15 PM, Eric Christopher <echristo at gmail.com> wrote:
> Sorry for the delay, I'm wondering if there's a way to look at the location in the backend - even without the column information to make a determination here. I'll probably look into it before putting this in though.

To summarize the problem:
LexicalScopes::getOrCreateInlinedScope() uses the DebugLoc as an index into InlinedLexicalScopeMap.
DebugLoc::getFromDILocation(MDNode *N) builds a new DebugLoc from LineNumber, ColumnNumber, Scope, and OrigLocation of InlinedAt. In my test case, Line, Scope and OrigLocation are all identical for two inlined calls to the same function at the same line.

Based on this I think (but I may be wrong) that we need to emit a distinct location already in the frontend (in CodeGenFunction::EmitCallExpr). The backend relies on the DebugLoc to create the lexical scope. 

Do you see another way that you would prefer?


More information about the cfe-commits mailing list