Browse Source

* add "readonly" attribute for constant pointer parameters on LLVM

git-svn-id: trunk@43089 -
Jonas Maebe 5 years ago
parent
commit
49026e1261
1 changed files with 7 additions and 4 deletions
  1. 7 4
      compiler/llvm/llvmdef.pas

+ 7 - 4
compiler/llvm/llvmdef.pas

@@ -755,15 +755,18 @@ implementation
                     vs_value,
                     vs_const:
                       begin
-                        encodedstr:=encodedstr+' dereferenceable('
+                        encodedstr:=encodedstr+' readonly dereferenceable('
                       end;
                     vs_var,
-                    vs_out,
-                    vs_constref:
+                    vs_out:
                       begin
                         { while normally these are not nil, it is technically possible
                           to pass nil via ptrtype(nil)^ }
-                        encodedstr:=encodedstr+' dereferenceable_or_null('
+                        encodedstr:=encodedstr+' dereferenceable_or_null(';
+                      end;
+                    vs_constref:
+                      begin
+                        encodedstr:=encodedstr+' readonly dereferenceable_or_null(';
                       end;
                     else
                       internalerror(2018120801);