diff --git a/clang/CodeGen/CGExprScalar.cpp b/clang/CodeGen/CGExprScalar.cpp index a72a4e98cfba..012cb69c3290 100644 --- a/clang/CodeGen/CGExprScalar.cpp +++ b/clang/CodeGen/CGExprScalar.cpp @@ -536,7 +536,8 @@ Value *ScalarExprEmitter::EmitSizeAlignOf(QualType TypeToSize, assert(RetType->isIntegerType() && "Result type must be an integer!"); - unsigned ResultWidth = static_cast(CGF.getContext().getTypeSize(RetType,SourceLocation())); + uint32_t ResultWidth = static_cast( + CGF.getContext().getTypeSize(RetType, SourceLocation())); return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Val)); } diff --git a/clang/CodeGen/CodeGenFunction.h b/clang/CodeGen/CodeGenFunction.h index abb03ab9c09b..3e08461efa09 100644 --- a/clang/CodeGen/CodeGenFunction.h +++ b/clang/CodeGen/CodeGenFunction.h @@ -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 diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index e14b738a3141..8cb138ebff53 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/CodeGen/CodeGenModule.cpp @@ -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( + llvm::APSInt Value(static_cast( getContext().getTypeSize(D->getInit()->getType(), SourceLocation()))); if (D->getInit()->isIntegerConstantExpr(Value, Context)) Init = llvm::ConstantInt::get(Value); diff --git a/clang/Driver/SerializationTest.cpp b/clang/Driver/SerializationTest.cpp index a18bd222f8df..19015914208d 100644 --- a/clang/Driver/SerializationTest.cpp +++ b/clang/Driver/SerializationTest.cpp @@ -196,29 +196,32 @@ IntrospectionTrait::Flags : public IntrospectionPrimitivesFlags {}; template<> -struct IntrospectionTrait::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 { + + 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 + 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 -struct IntrospectionTrait::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<> diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h index 25a6b94e7240..e94d50519ffc 100644 --- a/clang/include/clang/Basic/IdentifierTable.h +++ b/clang/include/clang/Basic/IdentifierTable.h @@ -23,7 +23,7 @@ namespace llvm { - template class IntrospectionTrait; + template struct IntrospectionTrait; template 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 friend class /*llvm::*/IntrospectionTrait; +#else template 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 friend class /*llvm::*/IntrospectionTrait; +#else template friend class llvm::IntrospectionTrait; +#endif private: void AddKeywords(const LangOptions &LangOpts); }; diff --git a/clang/win32/clangDriver/clangDriver.vcproj b/clang/win32/clangDriver/clangDriver.vcproj index 957d2f6a35c3..af35f28ae1bd 100644 --- a/clang/win32/clangDriver/clangDriver.vcproj +++ b/clang/win32/clangDriver/clangDriver.vcproj @@ -205,6 +205,14 @@ RelativePath="..\..\Driver\PrintPreprocessedOutput.cpp" > + + + +