source info block with a single location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84970
91177308-0d34-0410-b5e6-
96231b3b80d8
/// should be calculated based on the type.
DeclaratorInfo *CreateDeclaratorInfo(QualType T, unsigned Size = 0);
+ /// \brief Allocate a DeclaratorInfo where all locations have been
+ /// initialized to a given location, which defaults to the empty
+ /// location.
+ DeclaratorInfo *
+ getTrivialDeclaratorInfo(QualType T, SourceLocation Loc = SourceLocation());
+
private:
ASTContext(const ASTContext&); // DO NOT IMPLEMENT
void operator=(const ASTContext&); // DO NOT IMPLEMENT
return DInfo;
}
+DeclaratorInfo *ASTContext::getTrivialDeclaratorInfo(QualType T,
+ SourceLocation L) {
+ DeclaratorInfo *DI = CreateDeclaratorInfo(T);
+ DI->getTypeLoc().initialize(L);
+ return DI;
+}
+
/// getInterfaceLayoutImpl - Get or compute information about the
/// layout of the given interface.
///