Browse Source

* handle already quoted symbol names for LLVM (like for Objective-C)

git-svn-id: trunk@35045 -
Jonas Maebe 8 years ago
parent
commit
8c167f4e40
1 changed files with 8 additions and 1 deletions
  1. 8 1
      compiler/llvm/llvmdef.pas

+ 8 - 1
compiler/llvm/llvmdef.pas

@@ -264,7 +264,14 @@ implementation
   function llvmmangledname(const s: TSymStr): TSymStr;
   function llvmmangledname(const s: TSymStr): TSymStr;
     begin
     begin
       if copy(s,1,length('llvm.'))<>'llvm.' then
       if copy(s,1,length('llvm.'))<>'llvm.' then
-        result:='@"\01'+s+'"'
+        if s[1]<>'"' then
+          result:='@"\01'+s+'"'
+        else
+          begin
+            { already quoted -> insert \01 and prepend @ }
+            result:='@'+s;
+            insert('\01',result,3);
+          end
       else
       else
         result:='@'+s
         result:='@'+s
     end;
     end;