mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #2510 from jbj/getTempVariable-perf
C++: Fix getTempVariable join order in IR
This commit is contained in:
@@ -684,9 +684,17 @@ abstract class TranslatedElement extends TTranslatedElement {
|
||||
* Gets the temporary variable generated by this element with tag `tag`.
|
||||
*/
|
||||
final IRTempVariable getTempVariable(TempVariableTag tag) {
|
||||
result.getAST() = getAST() and
|
||||
result.getTag() = tag and
|
||||
hasTempVariable(tag, _)
|
||||
exists(Locatable ast |
|
||||
result.getAST() = ast and
|
||||
result.getTag() = tag and
|
||||
hasTempVariableAndAST(tag, ast)
|
||||
)
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
private predicate hasTempVariableAndAST(TempVariableTag tag, Locatable ast) {
|
||||
hasTempVariable(tag, _) and
|
||||
ast = getAST()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user