[cfe-dev] Use of '\01' prefix' in symbols ?

Nat! via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 14 03:59:46 PDT 2016


Some of the linker strings are apparently prefixed with \01. I assume 
this is some sort of escaping mechanism to prevent mangling or demangling.

```
void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc,
                                    QualType FnType) {
...
   // the mangled name of the enclosing function.
   if (!name.empty() && name[0] == '\01')
     name = name.substr(1);
```


So is it harmless to prefix everything (non C++) with '\01' or are there
reasons not to ? For example in CGObjCMac.cpp everything starting with 
"l_OBJC_" is prefixed with '\01' where as symbols prefixed with 'OBJC_' 
are not.

Ciao
    Nat!



More information about the cfe-dev mailing list