[cfe-commits] r58704 - in /cfe/trunk: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h lib/AST/Decl.cpp lib/AST/DeclCXX.cpp lib/CodeGen/CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Tue Nov 4 08:51:51 PST 2008


Author: lattner
Date: Tue Nov  4 10:51:42 2008
New Revision: 58704

URL: http://llvm.org/viewvc/llvm-project?rev=58704&view=rev
Log:
LinkageSpecDecl is c++ specific, move it to DeclCXX

Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/include/clang/AST/DeclCXX.h
    cfe/trunk/lib/AST/Decl.cpp
    cfe/trunk/lib/AST/DeclCXX.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=58704&r1=58703&r2=58704&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Tue Nov  4 10:51:42 2008
@@ -958,44 +958,6 @@
   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 }

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=58704&r1=58703&r2=58704&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Tue Nov  4 10:51:42 2008
@@ -573,6 +573,46 @@
     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
 

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=58704&r1=58703&r2=58704&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Nov  4 10:51:42 2008
@@ -129,13 +129,6 @@
   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
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=58704&r1=58703&r2=58704&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Tue Nov  4 10:51:42 2008
@@ -189,3 +189,11 @@
   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);
+}
+

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=58704&r1=58703&r2=58704&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Nov  4 10:51:42 2008
@@ -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"





More information about the cfe-commits mailing list