From eec22e8aafb7ecc2d569a18556e5cd6270b14ec9 Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Thu, 3 Mar 2022 14:14:02 -0800 Subject: [PATCH] Partially revert 692f026: Emit related types within wrapper namespace There are a lot of internal users depending on the old behavior of the libclang-based generator. PiperOrigin-RevId: 432281224 Change-Id: If82333fc3001f52de59e57a874f28bf8815d0877 --- sandboxed_api/tools/clang_generator/emitter.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sandboxed_api/tools/clang_generator/emitter.cc b/sandboxed_api/tools/clang_generator/emitter.cc index 388fa90..79484a2 100644 --- a/sandboxed_api/tools/clang_generator/emitter.cc +++ b/sandboxed_api/tools/clang_generator/emitter.cc @@ -331,6 +331,12 @@ absl::StatusOr EmitHeader( absl::StrAppendFormat(&out, kEmbedInclude, include_file); } + // If specified, wrap the generated API in a namespace + if (options.has_namespace()) { + absl::StrAppendFormat(&out, kNamespaceBeginTemplate, + options.namespace_name); + } + // Emit type dependencies if (!rendered_types.empty()) { absl::StrAppend(&out, "// Types this API depends on\n"); @@ -347,12 +353,6 @@ absl::StatusOr EmitHeader( } } - // If specified, wrap the generated API in a namespace - if (options.has_namespace()) { - absl::StrAppendFormat(&out, kNamespaceBeginTemplate, - options.namespace_name); - } - // Optionally emit a default sandbox that instantiates an embedded sandboxee if (!options.embed_name.empty()) { // TODO(cblichmann): Make the "Sandbox" suffix configurable.