File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 25
25
#include " Program.h"
26
26
#include " clang/AST/ASTDumperUtils.h"
27
27
#include " clang/AST/DeclCXX.h"
28
+ #include " clang/AST/ExprCXX.h"
28
29
#include " llvm/Support/Compiler.h"
29
30
#include " llvm/Support/Format.h"
30
31
@@ -154,6 +155,19 @@ LLVM_DUMP_METHOD void Program::dump(llvm::raw_ostream &OS) const {
154
155
OS << (GP.isInitialized () ? " initialized " : " uninitialized " );
155
156
}
156
157
Desc->dump (OS);
158
+
159
+ if (Desc->IsTemporary ) {
160
+ if (const auto *MTE =
161
+ dyn_cast_if_present<MaterializeTemporaryExpr>(Desc->asExpr ());
162
+ MTE && MTE->getLifetimeExtendedTemporaryDecl ()) {
163
+ const APValue *V = MTE->getLifetimeExtendedTemporaryDecl ()->getValue ();
164
+ if (V->isInt ())
165
+ OS << " (global temporary value: " << V->getInt () << " )" ;
166
+ else
167
+ OS << " (huh?)" ;
168
+ }
169
+ }
170
+
157
171
OS << " \n " ;
158
172
if (GP.isInitialized () && Desc->isPrimitive () && !Desc->isDummy ()) {
159
173
OS << " " ;
You can’t perform that action at this time.
0 commit comments