compiler: don't set btype_ too early for alias type
[official-gcc.git] / gcc / go / gofrontend / go-encode-id.h
blobec81b63a1821e3757baa01ea4a855804c716016b
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.
7 #ifndef GO_ENCODE_ID_H
8 #define GO_ENCODE_ID_H
10 #include "backend.h"
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.
15 extern bool
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.
20 extern std::string
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.
25 extern std::string
26 go_selectively_encode_id(const std::string &id);
28 // Encodes a struct tag that appears in a type literal encoding.
29 extern std::string
30 go_mangle_struct_tag(const std::string& tag);
32 #endif // !defined(GO_ENCODE_ID_H)