]> granicus.if.org Git - clang/commitdiff
move some APValue methods out of line.
authorChris Lattner <sabre@nondot.org>
Sun, 16 Nov 2008 07:35:53 +0000 (07:35 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 16 Nov 2008 07:35:53 +0000 (07:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59410 91177308-0d34-0410-b5e6-96231b3b80d8

clang.xcodeproj/project.pbxproj
include/clang/AST/APValue.h

index 6a3f9e8a97f4b7b3a82c7891f00db32ca2814028..88312be4b70a21b037cbf2dede37363201e67dbf 100644 (file)
                DE85CDAC0D838C120070E26E /* PPMacroExpansion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */; };
                DE85CDB00D838C390070E26E /* PPDirectives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDAF0D838C390070E26E /* PPDirectives.cpp */; };
                DE85CDB60D839BAE0070E26E /* PPLexerChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */; };
+               DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8823CA0ED0046600CBC30A /* APValue.cpp */; };
                DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B120C05659200231DA4 /* ModuleBuilder.cpp */; };
                DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */; };
                DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B7C0C0A615100231DA4 /* CodeGenModule.h */; };
                DE85CDAF0D838C390070E26E /* PPDirectives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPDirectives.cpp; sourceTree = "<group>"; };
                DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPLexerChange.cpp; sourceTree = "<group>"; };
                DE8822350EC80C0A00CBC30A /* CGBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGBuilder.h; path = lib/CodeGen/CGBuilder.h; sourceTree = "<group>"; };
+               DE8823CA0ED0046600CBC30A /* APValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = APValue.cpp; path = lib/AST/APValue.cpp; sourceTree = "<group>"; };
                DE928B120C05659200231DA4 /* ModuleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleBuilder.cpp; path = lib/CodeGen/ModuleBuilder.cpp; sourceTree = "<group>"; tabWidth = 2; };
                DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ModuleBuilder.h; path = clang/CodeGen/ModuleBuilder.h; sourceTree = "<group>"; };
                DE928B7C0C0A615100231DA4 /* CodeGenModule.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenModule.h; path = lib/CodeGen/CodeGenModule.h; sourceTree = "<group>"; tabWidth = 2; };
                DEC8D9920A9433F400353FCA /* AST */ = {
                        isa = PBXGroup;
                        children = (
+                               DE8823CA0ED0046600CBC30A /* APValue.cpp */,
                                35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */,
                                DE1732FF0B068B700080B521 /* ASTContext.cpp */,
                                DED677C80B6C854100AAD4A3 /* Builtins.cpp */,
                                35E1946A0ECB82FB00F21733 /* SemaNamedCast.cpp in Sources */,
                                35E1946D0ECB83C100F21733 /* PTHLexer.cpp in Sources */,
                                3537AA0E0ECD08A4008F7CDC /* PreprocessorLexer.cpp in Sources */,
+                               DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 2360473c556c91e04567bae618d7b108a93995c2..eac97a613edd35fdbc9db63e08b394e96c1d68ed 100644 (file)
@@ -173,47 +173,10 @@ public:
     ((LV*)(void*)Data)->Offset = O;
   }
   
-  const APValue &operator=(const APValue &RHS) {
-    if (Kind != RHS.Kind) {
-      MakeUninit();
-      if (RHS.isInt())
-        MakeInt();
-      else if (RHS.isFloat())
-        MakeFloat();
-      else if (RHS.isComplexInt())
-        MakeComplexInt();
-      else if (RHS.isComplexFloat())
-        MakeComplexFloat();
-      else if (RHS.isLValue())
-        MakeLValue();
-    }
-    if (isInt())
-      setInt(RHS.getInt());
-    else if (isFloat())
-      setFloat(RHS.getFloat());
-    else if (isComplexInt())
-      setComplexInt(RHS.getComplexIntReal(), RHS.getComplexIntImag());
-    else if (isComplexFloat())
-      setComplexFloat(RHS.getComplexFloatReal(), RHS.getComplexFloatImag());
-    else if (isLValue())
-      setLValue(RHS.getLValueBase(), RHS.getLValueOffset());
-    return *this;
-  }
+  const APValue &operator=(const APValue &RHS);
   
 private:
-  void MakeUninit() {
-    if (Kind == Int)
-      ((APSInt*)(void*)Data)->~APSInt();
-    else if (Kind == Float)
-      ((APFloat*)(void*)Data)->~APFloat();
-    else if (Kind == ComplexInt)
-      ((ComplexAPSInt*)(void*)Data)->~ComplexAPSInt();
-    else if (Kind == ComplexFloat)
-      ((ComplexAPFloat*)(void*)Data)->~ComplexAPFloat();
-    else if (Kind == LValue) {
-      ((LV*)(void*)Data)->~LV();
-    }
-  }
+  void MakeUninit();
   void MakeInt() {
     assert(isUninit() && "Bad state change");
     new ((void*)Data) APSInt(1);