Add a LangOptions member to IdentifierResolver.

Make Sema pass the LangOptions to IdentifierResolver's constructor.

llvm-svn: 56015
This commit is contained in:
Argyrios Kyrtzidis 2008-09-09 21:32:02 +00:00
parent 5b144d5cc4
commit f4b92e6924
3 changed files with 8 additions and 3 deletions

View File

@ -134,7 +134,9 @@ void IdentifierResolver::IdDeclInfo::RemoveDecl(NamedDecl *D) {
// IdentifierResolver Implementation
//===----------------------------------------------------------------------===//
IdentifierResolver::IdentifierResolver() : IdDeclInfos(new IdDeclInfoMap) {}
IdentifierResolver::IdentifierResolver(const LangOptions &langOpt)
: LangOpt(langOpt), IdDeclInfos(new IdDeclInfoMap) {
}
IdentifierResolver::~IdentifierResolver() {
delete IdDeclInfos;
}

View File

@ -221,10 +221,12 @@ public:
/// The decl must already be part of the decl chain.
void RemoveDecl(NamedDecl *D);
IdentifierResolver();
explicit IdentifierResolver(const LangOptions &LangOpt);
~IdentifierResolver();
private:
const LangOptions &LangOpt;
class IdDeclInfoMap;
IdDeclInfoMap *IdDeclInfos;

View File

@ -81,7 +81,8 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
}
Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer)
: PP(pp), Context(ctxt), Consumer(consumer), CurContext(0), CurBlock(0) {
: PP(pp), Context(ctxt), Consumer(consumer), CurContext(0), CurBlock(0),
IdResolver(pp.getLangOptions()) {
// Get IdentifierInfo objects for known functions for which we
// do extra checking.