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));
}
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);
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<>
namespace llvm {
- template<typename T> class IntrospectionTrait;
+ template <typename T> struct IntrospectionTrait;
template <typename T> struct DenseMapInfo;
}
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
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);
};