search for: s1ty

Displaying 7 results from an estimated 7 matches for "s1ty".

2004 Oct 12
5
[LLVMdev] set_intersect and Visual C compiler
...on this! :) > > > One thing that the compiler absolutely does not understand is the > > definition of set_intersect in include/llvm/ADT/SetOperations.h, and I > > am having a hard time understanding it myself. > > > > template <template<class S1ElTy> class S1Ty, class ETy, class S2Ty> > > void set_intersect(S1Ty<ETy> &S1, const S2Ty &S2) { > > for (typename S1Ty<ETy>::iterator I = S1.begin(); I != S1.end();) { > > const ETy &E = *I; > > ++I; > > if (!S2.count(E)) S1.erase(E); //...
2004 Oct 13
0
[LLVMdev] set_intersect and Visual C compiler
Both are working well on VC. Just tested. template<class STy> void set_intersect(STy &S1, const STy &S2) { for(STy::iterator I = S1.begin(), E = S1.end(); I != E; ) if (S2.count(*I)) S1.erase(*I++); else ++I; } template <class S1Ty, class S2Ty> void set_intersect(S1Ty &S1, const S2Ty &S2) { for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) { const S1Ty::key_type &E = *I; ++I; if (!S2.count(E)) S1.erase(E); // Erase element if not in S2 } } --- Paolo Invernizzi
2004 Oct 13
2
[LLVMdev] set_intersect and Visual C compiler
...on VC. Just tested. > > template<class STy> > void set_intersect(STy &S1, const STy &S2) { > for(STy::iterator I = S1.begin(), E = S1.end(); I != E; ) > if (S2.count(*I)) > S1.erase(*I++); > else > ++I; > } > > template <class S1Ty, class S2Ty> > void set_intersect(S1Ty &S1, const S2Ty &S2) { > for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) { > const S1Ty::key_type &E = *I; > ++I; > if (!S2.count(E)) S1.erase(E); // Erase element if not in S2 > } > } &gt...
2004 Oct 12
3
[LLVMdev] set_intersect and Visual C compiler
...Paolo and have started to work on fixing some of the problems. One thing that the compiler absolutely does not understand is the definition of set_intersect in include/llvm/ADT/SetOperations.h, and I am having a hard time understanding it myself. template <template<class S1ElTy> class S1Ty, class ETy, class S2Ty> void set_intersect(S1Ty<ETy> &S1, const S2Ty &S2) { for (typename S1Ty<ETy>::iterator I = S1.begin(); I != S1.end();) { const ETy &E = *I; ++I; if (!S2.count(E)) S1.erase(E); // Erase element if not in S2 } } it's only u...
2004 Oct 12
0
[LLVMdev] set_intersect and Visual C compiler
...e're all working together on this! :) > One thing that the compiler absolutely does not understand is the > definition of set_intersect in include/llvm/ADT/SetOperations.h, and I > am having a hard time understanding it myself. > > template <template<class S1ElTy> class S1Ty, class ETy, class S2Ty> > void set_intersect(S1Ty<ETy> &S1, const S2Ty &S2) { > for (typename S1Ty<ETy>::iterator I = S1.begin(); I != S1.end();) { > const ETy &E = *I; > ++I; > if (!S2.count(E)) S1.erase(E); // Erase element if not in S...
2012 Jul 04
2
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
...function, which has a signature of (i32, i8*, i8*, i32). The code is below. void addAnnotation( BasicBlock *block, Function *F) { string foo = "foo"; string bar = "barr"; Type *charTy = Type::getInt8Ty(block->getContext()); ArrayType *s1Ty = ArrayType::get(charTy, foo.size()+1); ArrayType *s2Ty = ArrayType::get(charTy, bar.size()+1); Constant *ar1 = ConstantArray::get(block->getContext(), foo); Constant *ar2 = ConstantArray::get(block->getContext(), bar); GlobalVariable *g1 = NULL; GlobalVariable...
2012 Jul 04
0
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
...i8*, i32). The code is below. > > void addAnnotation( BasicBlock *block, Function *F) > { > string foo = "foo"; > string bar = "barr"; > > Type *charTy = Type::getInt8Ty(block->getContext()); > > ArrayType *s1Ty = ArrayType::get(charTy, foo.size()+1); > ArrayType *s2Ty = ArrayType::get(charTy, bar.size()+1); > > Constant *ar1 = ConstantArray::get(block->getContext(), foo); > Constant *ar2 = ConstantArray::get(block->getContext(), bar); > > GlobalVariable...