OLD | NEW |
1 //===------- ItaniumCXXABI.cpp - Emit LLVM Code from ASTs for a Module ----===// | 1 //===------- ItaniumCXXABI.cpp - Emit LLVM Code from ASTs for a Module ----===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This provides C++ code generation targeting the Itanium C++ ABI. The class | 10 // This provides C++ code generation targeting the Itanium C++ ABI. The class |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 case TargetCXXABI::iOS64: | 332 case TargetCXXABI::iOS64: |
333 return new iOS64CXXABI(CGM); | 333 return new iOS64CXXABI(CGM); |
334 | 334 |
335 // Note that AArch64 uses the generic ItaniumCXXABI class since it doesn't | 335 // Note that AArch64 uses the generic ItaniumCXXABI class since it doesn't |
336 // include the other 32-bit ARM oddities: constructor/destructor return values | 336 // include the other 32-bit ARM oddities: constructor/destructor return values |
337 // and array cookies. | 337 // and array cookies. |
338 case TargetCXXABI::GenericAArch64: | 338 case TargetCXXABI::GenericAArch64: |
339 return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true, | 339 return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true, |
340 /* UseARMGuardVarABI = */ true); | 340 /* UseARMGuardVarABI = */ true); |
341 | 341 |
| 342 // @LOCALMOD-START Emscripten |
| 343 case TargetCXXABI::Emscripten: |
| 344 // Use ARM-style method pointers so that generated code does not assume |
| 345 // anything about the alignment of function pointers. |
| 346 return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true, |
| 347 /* UseARMGuardVarABI = */ false); |
| 348 // @LOCALMOD-END Emscripten |
| 349 |
342 case TargetCXXABI::GenericItanium: | 350 case TargetCXXABI::GenericItanium: |
343 if (CGM.getContext().getTargetInfo().getTriple().getArch() | 351 if (CGM.getContext().getTargetInfo().getTriple().getArch() |
344 == llvm::Triple::le32) { | 352 == llvm::Triple::le32) { |
345 // For PNaCl, use ARM-style method pointers so that PNaCl code | 353 // For PNaCl, use ARM-style method pointers so that PNaCl code |
346 // does not assume anything about the alignment of function | 354 // does not assume anything about the alignment of function |
347 // pointers. | 355 // pointers. |
348 return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true, | 356 return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true, |
349 /* UseARMGuardVarABI = */ false); | 357 /* UseARMGuardVarABI = */ false); |
350 } | 358 } |
351 return new ItaniumCXXABI(CGM); | 359 return new ItaniumCXXABI(CGM); |
(...skipping 2844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3196 SmallString<256> Buffer; | 3204 SmallString<256> Buffer; |
3197 llvm::raw_svector_ostream Out(Buffer); | 3205 llvm::raw_svector_ostream Out(Buffer); |
3198 if (DD) | 3206 if (DD) |
3199 getMangleContext().mangleCXXDtorComdat(DD, Out); | 3207 getMangleContext().mangleCXXDtorComdat(DD, Out); |
3200 else | 3208 else |
3201 getMangleContext().mangleCXXCtorComdat(CD, Out); | 3209 getMangleContext().mangleCXXCtorComdat(CD, Out); |
3202 llvm::Comdat *C = CGM.getModule().getOrInsertComdat(Out.str()); | 3210 llvm::Comdat *C = CGM.getModule().getOrInsertComdat(Out.str()); |
3203 Fn->setComdat(C); | 3211 Fn->setComdat(C); |
3204 } | 3212 } |
3205 } | 3213 } |
OLD | NEW |