Phase 2 of making the Decl class more lightweight...

Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl.

Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41934 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp
index 86604f9..64fa549 100644
--- a/CodeGen/CGExpr.cpp
+++ b/CodeGen/CGExpr.cpp
@@ -261,7 +261,7 @@
 
 
 LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
-  const Decl *D = E->getDecl();
+  const ValueDecl *D = E->getDecl();
   if (isa<BlockVarDecl>(D) || isa<ParmVarDecl>(D)) {
     llvm::Value *V = LocalDeclMap[D];
     assert(V && "BlockVarDecl not entered in LocalDeclMap?");
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index a26e129..e14b738 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -27,7 +27,7 @@
 CodeGenModule::CodeGenModule(ASTContext &C, llvm::Module &M)
   : Context(C), TheModule(M), Types(C, M), CFConstantStringClassRef(0) {}
 
-llvm::Constant *CodeGenModule::GetAddrOfGlobalDecl(const Decl *D) {
+llvm::Constant *CodeGenModule::GetAddrOfGlobalDecl(const ValueDecl *D) {
   // See if it is already in the map.
   llvm::Constant *&Entry = GlobalDeclMap[D];
   if (Entry) return Entry;
diff --git a/CodeGen/CodeGenModule.h b/CodeGen/CodeGenModule.h
index af2db80..d94f54a 100644
--- a/CodeGen/CodeGenModule.h
+++ b/CodeGen/CodeGenModule.h
@@ -28,6 +28,7 @@
   class ASTContext;
   class FunctionDecl;
   class Decl;
+  class ValueDecl;
   class FileVarDecl;
     
 namespace CodeGen {
@@ -53,7 +54,7 @@
   llvm::Module &getModule() const { return TheModule; }
   CodeGenTypes &getTypes() { return Types; }
   
-  llvm::Constant *GetAddrOfGlobalDecl(const Decl *D);
+  llvm::Constant *GetAddrOfGlobalDecl(const ValueDecl *D);
   
   /// getBuiltinLibFunction - Given a builtin id for a function like
   /// "__builtin_fabsf", return a Function* for "fabsf".