Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f34c78

Browse files
author
Dave Bartolomeo
committed
Fix formatting
1 parent 0b2acff commit 2f34c78

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ private predicate ignoreLoad(Expr expr) {
256256
private predicate needsLoadForParentExpr(Expr expr) {
257257
exists(CrementOperation crement | expr = crement.getOperand().getFullyConverted())
258258
or
259-
exists(AssignOperation ao | expr = ao.getLValue().getFullyConverted()) or
259+
exists(AssignOperation ao | expr = ao.getLValue().getFullyConverted())
260+
or
260261
// For arguments that are passed by value but require a constructor call, the extractor emits a
261262
// `TemporaryObjectExpr` as the argument, and marks it as a glvalue. This is roughly how a code-
262263
// generating compiler would implement this, passing the address of the temporary so that the

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,11 +2051,12 @@ class TranslatedBinaryConditionalExpr extends TranslatedConditionalExpr {
20512051

20522052
/**
20532053
* IR translation of the materialization of a temporary object.
2054-
*
2054+
*
20552055
* This translation allocates a temporary variable, and initializes it treating `expr.getExpr()` as
20562056
* its initializer.
20572057
*/
2058-
class TranslatedTemporaryObjectExpr extends TranslatedNonConstantExpr, TranslatedVariableInitialization {
2058+
class TranslatedTemporaryObjectExpr extends TranslatedNonConstantExpr,
2059+
TranslatedVariableInitialization {
20592060
override TemporaryObjectExpr expr;
20602061

20612062
final override predicate hasTempVariable(TempVariableTag tag, CppType type) {
@@ -2069,15 +2070,15 @@ class TranslatedTemporaryObjectExpr extends TranslatedNonConstantExpr, Translate
20692070
result = getTranslatedInitialization(expr.getExpr())
20702071
}
20712072

2072-
final override IRVariable getIRVariable() { result = getIRTempVariable(expr, TempObjectTempVar()) }
2073+
final override IRVariable getIRVariable() {
2074+
result = getIRTempVariable(expr, TempObjectTempVar())
2075+
}
20732076

20742077
final override Instruction getInitializationSuccessor() {
20752078
result = getParent().getChildSuccessor(this)
20762079
}
20772080

2078-
final override Instruction getResult() {
2079-
result = getTargetAddress()
2080-
}
2081+
final override Instruction getResult() { result = getTargetAddress() }
20812082
}
20822083

20832084
/**

0 commit comments

Comments
 (0)