]> granicus.if.org Git - clang/commitdiff
Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
authorKen Dyck <ken.dyck@onsemi.com>
Tue, 22 Dec 2009 14:23:30 +0000 (14:23 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Tue, 22 Dec 2009 14:23:30 +0000 (14:23 +0000)
avoid #including CharUnits.h in ASTContext.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91903 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTContext.h
lib/AST/ASTContext.cpp
lib/CodeGen/CGDecl.cpp

index 617a019baf1e94515b1ce077b8508826749fac96..0a9fe2aba194017f26548a532529ae3a03810dc6 100644 (file)
@@ -18,7 +18,6 @@
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/OperatorKinds.h"
 #include "clang/AST/Attr.h"
-#include "clang/AST/CharUnits.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/PrettyPrinter.h"
@@ -39,6 +38,7 @@ namespace clang {
   class FileManager;
   class ASTRecordLayout;
   class BlockExpr;
+  class CharUnits;
   class Expr;
   class ExternalASTSource;
   class IdentifierTable;
@@ -820,12 +820,8 @@ public:
   
   /// getTypeSizeInChars - Return the size of the specified type, in characters.
   /// This method does not work on incomplete types.
-  CharUnits getTypeSizeInChars(QualType T) {
-    return CharUnits::fromRaw(getTypeSize(T) / getCharWidth());
-  }
-  CharUnits getTypeSizeInChars(const Type *T) {
-    return CharUnits::fromRaw(getTypeSize(T) / getCharWidth());
-  }
+  CharUnits getTypeSizeInChars(QualType T);
+  CharUnits getTypeSizeInChars(const Type *T);
 
   /// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
   /// This method does not work on incomplete types.
index cc7055dc68b850214b40388b69545fbf4185b3a6..0e36a0ad1cf9107b5ba6cd8397dc09ed49d05094 100644 (file)
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/AST/ASTContext.h"
+#include "clang/AST/CharUnits.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclTemplate.h"
@@ -818,6 +819,15 @@ ASTContext::getTypeInfo(const Type *T) {
   return std::make_pair(Width, Align);
 }
 
+/// getTypeSizeInChars - Return the size of the specified type, in characters.
+/// This method does not work on incomplete types.
+CharUnits ASTContext::getTypeSizeInChars(QualType T) {
+  return CharUnits::fromRaw(getTypeSize(T) / getCharWidth());
+}
+CharUnits ASTContext::getTypeSizeInChars(const Type *T) {
+  return CharUnits::fromRaw(getTypeSize(T) / getCharWidth());
+}
+
 /// getPreferredTypeAlign - Return the "preferred" alignment of the specified
 /// type for the current target in bits.  This can be different than the ABI
 /// alignment in cases where it is beneficial for performance to overalign
index 72dc8373ca189f78d322fe36488ab49ba0678199..23af59c2b42bf31004d12c260de624fdc30a1b20 100644 (file)
@@ -15,6 +15,7 @@
 #include "CodeGenFunction.h"
 #include "CodeGenModule.h"
 #include "clang/AST/ASTContext.h"
+#include "clang/AST/CharUnits.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/Basic/SourceManager.h"