]> granicus.if.org Git - clang/commitdiff
Updated VC++ build system.
authorHartmut Kaiser <hartmut.kaiser@gmail.com>
Wed, 17 Oct 2007 15:00:17 +0000 (15:00 +0000)
committerHartmut Kaiser <hartmut.kaiser@gmail.com>
Wed, 17 Oct 2007 15:00:17 +0000 (15:00 +0000)
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?

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

CodeGen/CGExprScalar.cpp
CodeGen/CodeGenFunction.h
CodeGen/CodeGenModule.cpp
Driver/SerializationTest.cpp
include/clang/Basic/IdentifierTable.h
win32/clangDriver/clangDriver.vcproj

index a72a4e98cfbaf3153d9206d9c8d33250f42cfc91..012cb69c3290d1272bb1fdbc282dd40c3de8113c 100644 (file)
@@ -536,7 +536,8 @@ Value *ScalarExprEmitter::EmitSizeAlignOf(QualType TypeToSize,
   
   assert(RetType->isIntegerType() && "Result type must be an integer!");
   
-  unsigned ResultWidth = static_cast<unsigned>(CGF.getContext().getTypeSize(RetType,SourceLocation()));
+  uint32_t ResultWidth = static_cast<uint32_t>(
+    CGF.getContext().getTypeSize(RetType, SourceLocation()));
   return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Val));
 }
 
index abb03ab9c09b42e4d43121c106f47cb2a76b131a..3e08461efa090002a6b46429f2b699deb63c2d2c 100644 (file)
@@ -219,7 +219,7 @@ public:
   llvm::Instruction *AllocaInsertPt;
   
   const llvm::Type *LLVMIntTy;
-  unsigned LLVMPointerWidth;
+  uint32_t LLVMPointerWidth;
   
 private:
   /// LocalDeclMap - This keeps track of the LLVM allocas or globals for local C
index e14b738a3141221647c326c8cd1bba3966f5b7a6..8cb138ebff536c6205ba74447a2fe60079f21284 100644 (file)
@@ -67,7 +67,7 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) {
   if (D->getInit() == 0) {
     Init = llvm::Constant::getNullValue(GV->getType()->getElementType());
   } else if (D->getType()->isIntegerType()) {
-    llvm::APSInt Value(static_cast<unsigned>(
+    llvm::APSInt Value(static_cast<uint32_t>(
       getContext().getTypeSize(D->getInit()->getType(), SourceLocation())));
     if (D->getInit()->isIntegerConstantExpr(Value, Context))
       Init = llvm::ConstantInt::get(Value);
index a18bd222f8df1427e41460941efd6463b0b0dca8..19015914208d22f894385c53a0184164ebe233cc 100644 (file)
@@ -196,29 +196,32 @@ IntrospectionTrait<short>::Flags : public IntrospectionPrimitivesFlags {};
 
 
 template<> 
-struct IntrospectionTrait<clang::IdentifierInfo>::Flags {
-  enum { isPod = false,  // Cannot copy via memcpy.  Must use copy-ctor.    
-         hasUniqueInstances = true, // Two pointers with different
-                                    // addreses point to objects
-                                    // that are not equal to each other.    
-         hasUniqueReferences = true // Two (non-temporary) pointers                                    
-                                    // will point to distinct instances.
+struct IntrospectionTrait<clang::IdentifierInfo> {
+
+  struct Flags { 
+    enum { isPod = false,  // Cannot copy via memcpy.  Must use copy-ctor.    
+           hasUniqueInstances = true, // Two pointers with different
+                                      // addreses point to objects
+                                      // that are not equal to each other.    
+           hasUniqueReferences = true // Two (non-temporary) pointers                                    
+                                      // will point to distinct instances.
+    };
+  };
+
+  template<typename Introspector>
+  struct Ops {
+    static void Introspect(clang::IdentifierInfo& X, Introspector& I) {
+  //    I(X.getTokenID());
+      I(X.getBuiltinID(),9); // FIXME: do 9 bit specialization.
+  //    I(X.getObjCKeywordID());
+      I(X.hasMacroDefinition());
+      I(X.isExtensionToken());
+      I(X.isPoisoned());
+      I(X.isOtherTargetMacro());
+      I(X.isCPlusPlusOperatorKeyword());
+      I(X.isNonPortableBuiltin());
+    }
   };
-};
-  
-template<> template<typename Introspector>
-struct IntrospectionTrait<clang::IdentifierInfo>::Ops<Introspector> {
-  static void Introspect(clang::IdentifierInfo& X, Introspector& I) {
-//    I(X.getTokenID());
-    I(X.getBuiltinID(),9); // FIXME: do 9 bit specialization.
-//    I(X.getObjCKeywordID());
-    I(X.hasMacroDefinition());
-    I(X.isExtensionToken());
-    I(X.isPoisoned());
-    I(X.isOtherTargetMacro());
-    I(X.isCPlusPlusOperatorKeyword());
-    I(X.isNonPortableBuiltin());
-  }
 };
   
 template<> template<>
index 25a6b94e7240f429f1bdc511241d36ecc6a2a05d..e94d50519ffc91c42e843fd0e11cf7ee40bb4932 100644 (file)
@@ -23,7 +23,7 @@
 
 
 namespace llvm {
-  template<typename T> class IntrospectionTrait;
+  template <typename T> struct IntrospectionTrait;
   template <typename T> struct DenseMapInfo;
 }
 
@@ -140,7 +140,11 @@ public:
   void setFETokenInfo(void *T) { FETokenInfo = T; }
   
   // For serialization and profiling.
+#if defined(_MSC_VER) && _MSC_VER <= 1400   // workaround for VC++ upto V8.0
+  template<typename T> friend class /*llvm::*/IntrospectionTrait;
+#else
   template<typename T> friend class llvm::IntrospectionTrait;
+#endif
 };
 
 /// IdentifierTable - This table implements an efficient mapping from strings to
@@ -183,7 +187,11 @@ public:
   void PrintStats() const;
   
   // For serialization and profiling.
+#if defined(_MSC_VER) && _MSC_VER <= 1400   // workaround for VC++ upto V8.0
+  template<typename T> friend class /*llvm::*/IntrospectionTrait;
+#else
   template<typename T> friend class llvm::IntrospectionTrait;
+#endif
 private:
   void AddKeywords(const LangOptions &LangOpts);
 };
index 957d2f6a35c3037c5239978262b79af1155d05b8..af35f28ae1bdb2241def80fd0740155cecebb57d 100644 (file)
                                RelativePath="..\..\Driver\PrintPreprocessedOutput.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\Driver\RewriteTest.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\Driver\SerializationTest.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\Driver\Targets.cpp"\r
                                >\r