1 // go-encode-id.h -- Go identifier encoding utilities -*- C++ -*-
3 // Copyright 2016 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
12 // Given an identifier that will appear in assembly code, this helper
13 // returns TRUE if the identifier needs special encoding to be used as
14 // an ASM name, FALSE if the name is OK as is.
16 go_id_needs_encoding(const std::string
& str
);
18 // Encodes the specified identifier for ASM name safety, returning a
19 // string with the encoded value.
21 go_encode_id(const std::string
&id
);
23 // Returns the empty string if the specified name needs encoding,
24 // otherwise invokes go_encode_id on the name and returns the result.
26 go_selectively_encode_id(const std::string
&id
);
28 // Encodes a struct tag that appears in a type literal encoding.
30 go_mangle_struct_tag(const std::string
& tag
);
32 #endif // !defined(GO_ENCODE_ID_H)