From 22dcc9a6513bf7fbf649bd9ac8f4f37b716dcd2b Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Fri, 21 Nov 2014 16:37:47 +0300 Subject: [PATCH] Tracking LLVM trunk: SmallPtrSet changes --- cbackend.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cbackend.cpp b/cbackend.cpp index 9a95f58c..a17bb03b 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -2762,14 +2762,22 @@ void CWriter::printContainedStructs(llvm::Type *Ty, if (llvm::StructType *ST = llvm::dyn_cast(Ty)) { // Check to see if we have already printed this struct. +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) // LLVM 3.6+ + if (!Printed.insert(Ty).second) return; +#else if (!Printed.insert(Ty)) return; +#endif // Print structure type out. printType(Out, ST, false, getStructName(ST), true); Out << ";\n\n"; } if (llvm::ArrayType *AT = llvm::dyn_cast(Ty)) { +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) // LLVM 3.6+ + if (!Printed.insert(Ty).second) return; +#else if (!Printed.insert(Ty)) return; +#endif printType(Out, AT, false, getArrayName(AT), true); Out << ";\n\n"; @@ -2778,8 +2786,13 @@ void CWriter::printContainedStructs(llvm::Type *Ty, void CWriter::printContainedArrays(llvm::ArrayType *ATy, llvm::SmallPtrSet &Printed) { +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) // LLVM 3.6+ + if (!Printed.insert(ATy).second) + return; +#else if (!Printed.insert(ATy)) return; +#endif llvm::ArrayType *ChildTy = llvm::dyn_cast(ATy->getElementType()); if (ChildTy != NULL)