Move Sema::ActOnLinkageSpec to SemaDeclCXX.

llvm-svn: 61125
This commit is contained in:
Chris Lattner 2008-12-17 07:09:26 +00:00
parent 0cdf52310a
commit 3b024a3c9e
2 changed files with 19 additions and 18 deletions

View File

@ -3414,24 +3414,6 @@ Sema::DeclTy* Sema::ActOnLinkageSpec(SourceLocation Loc,
(Decl **)Decls, NumDecls);
}
Sema::DeclTy* Sema::ActOnLinkageSpec(SourceLocation Loc,
const char *Lang, unsigned StrSize,
DeclTy *D) {
LinkageSpecDecl::LanguageIDs Language;
Decl *dcl = static_cast<Decl *>(D);
if (strncmp(Lang, "\"C\"", StrSize) == 0)
Language = LinkageSpecDecl::lang_c;
else if (strncmp(Lang, "\"C++\"", StrSize) == 0)
Language = LinkageSpecDecl::lang_cxx;
else {
Diag(Loc, diag::err_bad_language);
return 0;
}
// FIXME: Add all the various semantics of linkage specifications
return LinkageSpecDecl::Create(Context, Loc, Language, dcl);
}
void Sema::ActOnPragmaPack(PragmaPackKind Kind, IdentifierInfo *Name,
ExprTy *alignment, SourceLocation PragmaLoc,
SourceLocation LParenLoc, SourceLocation RParenLoc) {

View File

@ -1979,3 +1979,22 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
return false;
}
Sema::DeclTy *Sema::ActOnLinkageSpec(SourceLocation Loc,
const char *Lang, unsigned StrSize,
DeclTy *D) {
LinkageSpecDecl::LanguageIDs Language;
Decl *dcl = static_cast<Decl *>(D);
if (strncmp(Lang, "\"C\"", StrSize) == 0)
Language = LinkageSpecDecl::lang_c;
else if (strncmp(Lang, "\"C++\"", StrSize) == 0)
Language = LinkageSpecDecl::lang_cxx;
else {
Diag(Loc, diag::err_bad_language);
return 0;
}
// FIXME: Add all the various semantics of linkage specifications
return LinkageSpecDecl::Create(Context, Loc, Language, dcl);
}