]> granicus.if.org Git - clang/commit
Change the representation of GNU ?: expressions to use a different expression
authorJohn McCall <rjmccall@apple.com>
Thu, 17 Feb 2011 10:25:35 +0000 (10:25 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 17 Feb 2011 10:25:35 +0000 (10:25 +0000)
commit56ca35d396d8692c384c785f9aeebcf22563fe1e
treecd52281e952ff00244a59c5d47e34459c22fd7c0
parent05c699e97aea64ee8cea1faaca900a39f977350c
Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr.  This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait;  or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here.  In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125744 91177308-0d34-0410-b5e6-96231b3b80d8
40 files changed:
include/clang/AST/Expr.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/Analysis/Visitors/CFGStmtVisitor.h
include/clang/Basic/StmtNodes.td
include/clang/Sema/Sema.h
include/clang/Serialization/ASTBitCodes.h
include/clang/Serialization/ASTReader.h
include/clang/Serialization/ASTWriter.h
lib/AST/Expr.cpp
lib/AST/ExprClassification.cpp
lib/AST/ExprConstant.cpp
lib/AST/ItaniumMangle.cpp
lib/AST/StmtDumper.cpp
lib/AST/StmtPrinter.cpp
lib/AST/StmtProfile.cpp
lib/Analysis/CFG.cpp
lib/Analysis/ReachableCode.cpp
lib/Analysis/UninitializedValues.cpp
lib/CodeGen/CGException.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprAgg.cpp
lib/CodeGen/CGExprComplex.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
lib/Rewrite/RewriteObjC.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
lib/StaticAnalyzer/Checkers/ExprEngine.cpp
lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/CoreEngine.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
test/Analysis/temp-obj-dtors-cfg-output.cpp
test/CodeGenCXX/gnu-conditional-scalar-ext.cpp
tools/libclang/CXCursor.cpp