[cfe-commits] r43074 - in /cfe/trunk: CodeGen/CGExprScalar.cpp CodeGen/CodeGenFunction.h CodeGen/CodeGenModule.cpp Driver/SerializationTest.cpp include/clang/Basic/IdentifierTable.h win32/clangDriver/clangDriver.vcproj
Hartmut Kaiser
hartmut.kaiser at gmail.com
Wed Oct 17 08:00:17 PDT 2007
Author: hkaiser
Date: Wed Oct 17 10:00:17 2007
New Revision: 43074
URL: http://llvm.org/viewvc/llvm-project?rev=43074&view=rev
Log:
Updated VC++ build system.
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?
Modified:
cfe/trunk/CodeGen/CGExprScalar.cpp
cfe/trunk/CodeGen/CodeGenFunction.h
cfe/trunk/CodeGen/CodeGenModule.cpp
cfe/trunk/Driver/SerializationTest.cpp
cfe/trunk/include/clang/Basic/IdentifierTable.h
cfe/trunk/win32/clangDriver/clangDriver.vcproj
Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=43074&r1=43073&r2=43074&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Wed Oct 17 10:00:17 2007
@@ -536,7 +536,8 @@
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));
}
Modified: cfe/trunk/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenFunction.h?rev=43074&r1=43073&r2=43074&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/CodeGen/CodeGenFunction.h Wed Oct 17 10:00:17 2007
@@ -219,7 +219,7 @@
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
Modified: cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=43074&r1=43073&r2=43074&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenModule.cpp Wed Oct 17 10:00:17 2007
@@ -67,7 +67,7 @@
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);
Modified: cfe/trunk/Driver/SerializationTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/SerializationTest.cpp?rev=43074&r1=43073&r2=43074&view=diff
==============================================================================
--- cfe/trunk/Driver/SerializationTest.cpp (original)
+++ cfe/trunk/Driver/SerializationTest.cpp Wed Oct 17 10:00:17 2007
@@ -196,29 +196,32 @@
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<>
Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=43074&r1=43073&r2=43074&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Wed Oct 17 10:00:17 2007
@@ -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 @@
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 @@
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);
};
Modified: cfe/trunk/win32/clangDriver/clangDriver.vcproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/win32/clangDriver/clangDriver.vcproj?rev=43074&r1=43073&r2=43074&view=diff
==============================================================================
--- cfe/trunk/win32/clangDriver/clangDriver.vcproj (original)
+++ cfe/trunk/win32/clangDriver/clangDriver.vcproj Wed Oct 17 10:00:17 2007
@@ -206,6 +206,14 @@
>
</File>
<File
+ RelativePath="..\..\Driver\RewriteTest.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Driver\SerializationTest.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\Driver\Targets.cpp"
>
</File>
More information about the cfe-commits
mailing list