| 680 | } |
| 681 | |
| 682 | void llvm::json::OStream::attributeBegin(llvm::StringRef Key) { |
| 683 | assert(Stack.back().Ctx == Object); |
| 684 | if (Stack.back().HasValue) |
| 685 | OS << ','; |
| 686 | newline(); |
| 687 | Stack.back().HasValue = true; |
| 688 | Stack.emplace_back(); |
| 689 | Stack.back().Ctx = Singleton; |
| 690 | if (LLVM_LIKELY(isUTF8(Key))) { |
| 691 | quote(OS, Key); |
| 692 | } else { |
| 693 | assert(false && "Invalid UTF-8 in attribute key"); |
| 694 | quote(OS, fixUTF8(Key)); |
| 695 | } |
| 696 | OS.write(':'); |
| 697 | if (IndentSize) |
| 698 | OS.write(' '); |
| 699 | } |
| 700 | |
| 701 | void llvm::json::OStream::attributeEnd() { |
| 702 | assert(Stack.back().Ctx == Singleton); |