Skip to content

Commit 533e1ca

Browse files
Comments
1 parent bb04cde commit 533e1ca

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clang/lib/3C/DeclRewriter.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,8 @@ DeclRewriter::buildItypeDecl(PVConstraint *Defn, DeclaratorDecl *Decl,
107107
// translation units.
108108
if (isa_and_nonnull<ParmVarDecl>(Decl) && !DeclName.empty())
109109
Type = qtyToStr(Decl->getType(), DeclName);
110-
else {
111-
// FIXME: This assert will probably fail. Need to handle field and global
112-
// decls, function returns and param decls without names.
113-
assert(!NeedsFreshLowerBound);
110+
else
114111
Type = Defn->getOriginalTypeWithName();
115-
}
116112
}
117113

118114
std::string IType = " : itype(" +
@@ -482,7 +478,6 @@ void DeclRewriter::rewriteMultiDecl(MultiDeclInfo &MDI, RSet &ToRewrite) {
482478
// type does not to be rewritten.
483479
IsFirst = false;
484480
if (Replacement) {
485-
SourceRange SR(DL->getBeginLoc(), DL->getEndLoc());
486481
doDeclRewrite(ReplaceSR, Replacement);
487482
}
488483
} else {
@@ -672,6 +667,9 @@ bool FunctionDeclBuilder::VisitFunctionDecl(FunctionDecl *FD) {
672667
&& !FD->isGenericFunction() && !FD->isItypeGenericFunction())
673668
RewriteGeneric = true;
674669

670+
// This will keep track of the supplementary declarations that are required by
671+
// function parameters. The new declarations will be emitted inside the
672+
// function body in the order of function parameters that generated them.
675673
std::vector<std::string> SDecls;
676674
bool GenerateSDecls = FD->isThisDeclarationADefinition();
677675

0 commit comments

Comments
 (0)