Move the other Sema::ActOnLinkageSpec to SemaDeclCXX.
Move Sema::ActOnDefs to SemaDeclObjC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61126 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 7a2d72d..29605b6 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -1980,6 +1980,32 @@
return false;
}
+/// ActOnLinkageSpec - Parsed a C++ linkage-specification that
+/// contained braces. Lang/StrSize contains the language string that
+/// was parsed at location Loc. Decls/NumDecls provides the
+/// declarations parsed inside the linkage specification.
+Sema::DeclTy *Sema::ActOnLinkageSpec(SourceLocation Loc,
+ SourceLocation LBrace,
+ SourceLocation RBrace,
+ const char *Lang,
+ unsigned StrSize,
+ DeclTy **Decls, unsigned NumDecls) {
+ LinkageSpecDecl::LanguageIDs Language;
+ 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,
+ (Decl **)Decls, NumDecls);
+}
+
Sema::DeclTy *Sema::ActOnLinkageSpec(SourceLocation Loc,
const char *Lang, unsigned StrSize,
DeclTy *D) {