This is an archive of the discontinued LLVM Phabricator instance.

ASTImporter: expressions, pt.2
AbandonedPublic

Authored by khazem on Sep 23 2016, 12:45 PM.

Details

Reviewers
sepavloff
spyffe
Summary

This patch implements some expression-related AST node import (patch #2).

ArrayTypeTraitExpr
ExpressionTraitExpr
OpaqueValueExpr
ArraySubscriptExpr
ExplicitCastExpr
ImplicitValueInitExpr
OffsetOfExpr
CXXThisExpr
CXXThrowExpr
CXXNoexceptExpr
CXXDefaultArgExpr
CXXScalarValueInitExpr
CXXBindTemporaryExpr
CXXTemporaryObjectExpr
MaterializeTemporaryExpr
ExprWithCleanups
StaticAssertDecl
FriendDecl
DecayedType

Diff Detail

Event Timeline

khazem abandoned this revision.Sep 23 2016, 12:45 PM
khazem updated this revision to Diff 72327.
khazem retitled this revision from to ASTImporter: expressions, pt.2.
khazem updated this object.
khazem added reviewers: spyffe, sepavloff.
khazem added subscribers: phosek, khazem, NoQ and 2 others.
khazem reclaimed this revision.Sep 23 2016, 1:05 PM

This diff is a continuation of https://reviews.llvm.org/D14326, which was accepted for inclusion but has not been merged in for the past couple of months.

I added a small patch so that it rebases cleanly onto master:

--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -2309,16 +2309,9 @@ bool ASTNodeImporter::ImportDefinition(EnumDecl *From, EnumDecl *To,
 
 TemplateParameterList *ASTNodeImporter::ImportTemplateParameterList(
                                                 TemplateParameterList *Params) {
-  SmallVector<NamedDecl *, 4> ToParams;
-  ToParams.reserve(Params->size());
-  for (TemplateParameterList::iterator P = Params->begin(), 
-                                    PEnd = Params->end();
-       P != PEnd; ++P) {
-    Decl *To = Importer.Import(*P);
-    if (!To)
-      return nullptr;
-    ToParams.push_back(cast<NamedDecl>(To));
-  }
+  SmallVector<NamedDecl *, 4> ToParams(Params->size());
+  if (ImportContainerChecked(*Params, ToParams))
+    return nullptr;
 
   Expr *ToRequiresClause;
   if (Expr *const R = Params->getRequiresClause()) {

One of the tests is currently failing with this patch. Specifically, there is a segfault at line 130 of test/ASTMerge/Inputs/exprs3.cpp. I'm working on getting this fixed now.

The referenced patch was commited. Could you close/abandon this one?

khazem abandoned this revision.Oct 3 2016, 8:14 AM