]> granicus.if.org Git - clang/commitdiff
LinkageSpecDecl is c++ specific, move it to DeclCXX
authorChris Lattner <sabre@nondot.org>
Tue, 4 Nov 2008 16:51:42 +0000 (16:51 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 4 Nov 2008 16:51:42 +0000 (16:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58704 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
include/clang/AST/DeclCXX.h
lib/AST/Decl.cpp
lib/AST/DeclCXX.cpp
lib/CodeGen/CodeGenModule.cpp

index 2a4d201e5adeae3e3c2541370c46415f3f397e49..e23b4d84199ab5a9f74eda0c074590fecbb6d44e 100644 (file)
@@ -958,44 +958,6 @@ protected:
   friend Decl* Decl::Create(llvm::Deserializer& D, ASTContext& C);
 };
 
-/// LinkageSpecDecl - This represents a linkage specification.  For example:
-///   extern "C" void foo();
-///
-class LinkageSpecDecl : public Decl {
-public:
-  /// LanguageIDs - Used to represent the language in a linkage
-  /// specification.  The values are part of the serialization abi for
-  /// ASTs and cannot be changed without altering that abi.  To help
-  /// ensure a stable abi for this, we choose the DW_LANG_ encodings
-  /// from the dwarf standard.
-  enum LanguageIDs { lang_c = /* DW_LANG_C */ 0x0002,
-                     lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004 };
-private:
-  /// Language - The language for this linkage specification.
-  LanguageIDs Language;
-  /// D - This is the Decl of the linkage specification.
-  Decl *D;
-  
-  LinkageSpecDecl(SourceLocation L, LanguageIDs lang, Decl *d)
-   : Decl(LinkageSpec, L), Language(lang), D(d) {}
-public:
-  static LinkageSpecDecl *Create(ASTContext &C, SourceLocation L,
-                                 LanguageIDs Lang, Decl *D);
-
-  LanguageIDs getLanguage() const { return Language; }
-  const Decl *getDecl() const { return D; }
-  Decl *getDecl() { return D; }
-    
-  static bool classof(const Decl *D) {
-    return D->getKind() == LinkageSpec;
-  }
-  static bool classof(const LinkageSpecDecl *D) { return true; }
-  
-protected:
-  void EmitInRec(llvm::Serializer& S) const;
-  void ReadInRec(llvm::Deserializer& D, ASTContext& C);
-};
-
 /// BlockDecl - This represents a block literal declaration, which is like an
 /// unnamed FunctionDecl.  For example:
 /// ^{ statement-body }   or   ^(int arg1, float arg2){ statement-body }
index 9595a78021fac9cd9c7aa4dccbeee9181e698e8a..7a0bce8f83f99a3af299de06e9a3dd3d84ac2230 100644 (file)
@@ -573,6 +573,46 @@ public:
     return isa<CXXFieldDecl>(D);
   }
 };
+  
+/// LinkageSpecDecl - This represents a linkage specification.  For example:
+///   extern "C" void foo();
+///
+class LinkageSpecDecl : public Decl {
+public:
+  /// LanguageIDs - Used to represent the language in a linkage
+  /// specification.  The values are part of the serialization abi for
+  /// ASTs and cannot be changed without altering that abi.  To help
+  /// ensure a stable abi for this, we choose the DW_LANG_ encodings
+  /// from the dwarf standard.
+  enum LanguageIDs { lang_c = /* DW_LANG_C */ 0x0002,
+  lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004 };
+private:
+  /// Language - The language for this linkage specification.
+  LanguageIDs Language;
+  /// D - This is the Decl of the linkage specification.
+  Decl *D;
+  
+  LinkageSpecDecl(SourceLocation L, LanguageIDs lang, Decl *d)
+  : Decl(LinkageSpec, L), Language(lang), D(d) {}
+public:
+  static LinkageSpecDecl *Create(ASTContext &C, SourceLocation L,
+                                 LanguageIDs Lang, Decl *D);
+  
+  LanguageIDs getLanguage() const { return Language; }
+  const Decl *getDecl() const { return D; }
+  Decl *getDecl() { return D; }
+  
+  static bool classof(const Decl *D) {
+    return D->getKind() == LinkageSpec;
+  }
+  static bool classof(const LinkageSpecDecl *D) { return true; }
+  
+protected:
+  void EmitInRec(llvm::Serializer& S) const;
+  void ReadInRec(llvm::Deserializer& D, ASTContext& C);
+};
+
+  
 
 } // end namespace clang
 
index dbc92f414fc731d3967e4ee9ce4d83d90435b115..81fe766ff016fe907057f77d4194d95c1bb2dcc6 100644 (file)
@@ -129,13 +129,6 @@ FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C,
   return new (Mem) FileScopeAsmDecl(L, Str);
 }
 
-LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C,
-                                         SourceLocation L,
-                                         LanguageIDs Lang, Decl *D) {
-  void *Mem = C.getAllocator().Allocate<LinkageSpecDecl>();
-  return new (Mem) LinkageSpecDecl(L, Lang, D);
-}
-
 //===----------------------------------------------------------------------===//
 // NamedDecl Implementation
 //===----------------------------------------------------------------------===//
index fa4f35be7ad9f76f58321b48c7a188b4c831dbb8..21701461e617efd8fa275d8fb88f04ffb063a5df 100644 (file)
@@ -189,3 +189,11 @@ OverloadedFunctionDecl::Create(ASTContext &C, DeclContext *DC,
   void *Mem = C.getAllocator().Allocate<OverloadedFunctionDecl>();
   return new (Mem) OverloadedFunctionDecl(DC, Id);
 }
+
+LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C,
+                                         SourceLocation L,
+                                         LanguageIDs Lang, Decl *D) {
+  void *Mem = C.getAllocator().Allocate<LinkageSpecDecl>();
+  return new (Mem) LinkageSpecDecl(L, Lang, D);
+}
+
index 2ca893fb41fe51842d640764511d448cab690555..3555ccd53a593c748a26b17d4fe37756ee7a5765 100644 (file)
@@ -18,6 +18,7 @@
 #include "CGObjCRuntime.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclObjC.h"
+#include "clang/AST/DeclCXX.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"