@@ -352,6 +352,12 @@ public enum ArgumentConvention : CustomStringConvertible {
352352 /// convention used by mutable captures in @noescape closures.
353353 case indirectInoutAliasable
354354
355+ /// This argument is passed indirectly, i.e. by directly passing the address
356+ /// of an object in memory. The callee may modify, but does not destroy the
357+ /// object. This corresponds to the parameter-passing convention of the
358+ /// Itanium C++ ABI, which is used ubiquitously on non-Windows targets.
359+ case indirectInCXX
360+
355361 /// This argument represents an indirect return value address. The callee stores
356362 /// the returned value to this argument. At the time when the function is called,
357363 /// the memory location referenced by the argument is uninitialized.
@@ -407,8 +413,9 @@ public enum ArgumentConvention : CustomStringConvertible {
407413 public var isIndirect : Bool {
408414 switch self {
409415 case . indirectIn, . indirectInGuaranteed,
410- . indirectInout, . indirectInoutAliasable, . indirectOut,
411- . packOut, . packInout, . packOwned, . packGuaranteed:
416+ . indirectInout, . indirectInoutAliasable, . indirectInCXX,
417+ . indirectOut, . packOut, . packInout, . packOwned,
418+ . packGuaranteed:
412419 return true
413420 case . directOwned, . directUnowned, . directGuaranteed:
414421 return false
@@ -417,11 +424,12 @@ public enum ArgumentConvention : CustomStringConvertible {
417424
418425 public var isIndirectIn : Bool {
419426 switch self {
420- case . indirectIn, . indirectInGuaranteed,
427+ case . indirectIn, . indirectInGuaranteed, . indirectInCXX ,
421428 . packOwned, . packGuaranteed:
422429 return true
423430 case . directOwned, . directUnowned, . directGuaranteed,
424- . indirectInout, . indirectInoutAliasable, . indirectOut,
431+ . indirectInout, . indirectInoutAliasable,
432+ . indirectOut,
425433 . packOut, . packInout:
426434 return false
427435 }
@@ -433,7 +441,7 @@ public enum ArgumentConvention : CustomStringConvertible {
433441 return true
434442 case . indirectInGuaranteed, . directGuaranteed, . packGuaranteed,
435443 . indirectIn, . directOwned, . directUnowned,
436- . indirectInout, . indirectInoutAliasable,
444+ . indirectInout, . indirectInoutAliasable, . indirectInCXX ,
437445 . packInout, . packOwned:
438446 return false
439447 }
@@ -444,15 +452,15 @@ public enum ArgumentConvention : CustomStringConvertible {
444452 case . indirectInGuaranteed, . directGuaranteed, . packGuaranteed:
445453 return true
446454 case . indirectIn, . directOwned, . directUnowned,
447- . indirectInout, . indirectInoutAliasable, . indirectOut ,
448- . packOut, . packInout, . packOwned:
455+ . indirectInout, . indirectInoutAliasable, . indirectInCXX ,
456+ . indirectOut , . packOut, . packInout, . packOwned:
449457 return false
450458 }
451459 }
452460
453461 public var isConsumed : Bool {
454462 switch self {
455- case . indirectIn, . directOwned, . packOwned:
463+ case . indirectIn, . indirectInCXX , . directOwned, . packOwned:
456464 return true
457465 case . indirectInGuaranteed, . directGuaranteed, . packGuaranteed,
458466 . indirectInout, . indirectInoutAliasable, . indirectOut,
@@ -467,6 +475,7 @@ public enum ArgumentConvention : CustomStringConvertible {
467475 . indirectOut,
468476 . indirectInGuaranteed,
469477 . indirectInout,
478+ . indirectInCXX,
470479 . packOut,
471480 . packInout,
472481 . packOwned,
@@ -491,6 +500,7 @@ public enum ArgumentConvention : CustomStringConvertible {
491500 case . indirectIn,
492501 . indirectOut,
493502 . indirectInGuaranteed,
503+ . indirectInCXX,
494504 . directUnowned,
495505 . directGuaranteed,
496506 . directOwned,
@@ -511,6 +521,8 @@ public enum ArgumentConvention : CustomStringConvertible {
511521 return " indirectInout "
512522 case . indirectInoutAliasable:
513523 return " indirectInoutAliasable "
524+ case . indirectInCXX:
525+ return " indirectInCXX "
514526 case . indirectOut:
515527 return " indirectOut "
516528 case . directOwned:
@@ -545,6 +557,7 @@ extension BridgedArgumentConvention {
545557 case . Indirect_In_Guaranteed: return . indirectInGuaranteed
546558 case . Indirect_Inout: return . indirectInout
547559 case . Indirect_InoutAliasable: return . indirectInoutAliasable
560+ case . Indirect_In_CXX: return . indirectInCXX
548561 case . Indirect_Out: return . indirectOut
549562 case . Direct_Owned: return . directOwned
550563 case . Direct_Unowned: return . directUnowned
@@ -566,6 +579,7 @@ extension ArgumentConvention {
566579 case . indirectInGuaranteed: return . Indirect_In_Guaranteed
567580 case . indirectInout: return . Indirect_Inout
568581 case . indirectInoutAliasable: return . Indirect_InoutAliasable
582+ case . indirectInCXX: return . Indirect_In_CXX
569583 case . indirectOut: return . Indirect_Out
570584 case . directOwned: return . Direct_Owned
571585 case . directUnowned: return . Direct_Unowned
0 commit comments