llvm.org GIT mirror llvm / 219c790
Apply a patch from Mahadevan R, with minor formatting changes, to workaround a GCC 3.3 bug observed on OpenBSD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54002 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
135135 ///
136136 template
137137 Ty *getInfo() {
138 if (!MFInfo) MFInfo = new (Allocator.Allocate()) Ty(*this);
138 if (!MFInfo) {
139 // This should be just `new (Allocator.Allocate()) Ty(*this)', but
140 // that apparently breaks GCC 3.3.
141 Ty *Loc = static_cast(Allocator.Allocate(sizeof(Ty),
142 AlignOf::Alignment));
143 MFInfo = new (Loc) Ty(*this);
144 }
139145
140146 assert((void*)dynamic_cast(MFInfo) == (void*)MFInfo &&
141147 "Invalid concrete type or multiple inheritence for getInfo");