Переглянути джерело

* LLVM 11.0 support

git-svn-id: trunk@47121 -
Jonas Maebe 4 роки тому
батько
коміт
080d8c28f7
2 змінених файлів з 14 додано та 8 видалено
  1. 5 3
      compiler/llvm/agllvm.pas
  2. 9 5
      compiler/llvm/llvminfo.pas

+ 5 - 3
compiler/llvm/agllvm.pas

@@ -1004,8 +1004,8 @@ implementation
              (pd.mangledname=(target_info.cprefix+'setjmp')) then
             writer.AsmWrite(' returns_twice');
           if po_inline in pd.procoptions then
-            writer.AsmWrite(' inlinehint');
-          if (po_noinline in pd.procoptions) or
+            writer.AsmWrite(' inlinehint')
+          else if (po_noinline in pd.procoptions) or
              (pio_inline_forbidden in pd.implprocoptions) then
             writer.AsmWrite(' noinline');
           { ensure that functions that happen to have the same name as a
@@ -1019,7 +1019,9 @@ implementation
           if pio_thunk in pd.implprocoptions then
             writer.AsmWrite(' "thunk"');
           if llvmflag_null_pointer_valid in llvmversion_properties[current_settings.llvmversion] then
-            writer.AsmWrite(' "null-pointer-is-valid"="true"');
+            writer.AsmWrite(' "null-pointer-is-valid"="true"')
+          else if llvmflag_null_pointer_valid_new in llvmversion_properties[current_settings.llvmversion] then
+            writer.AsmWrite(' null_pointer_is_valid');
           if not(pio_fastmath in pd.implprocoptions) then
             writer.AsmWrite(' strictfp');
         end;

+ 9 - 5
compiler/llvm/llvminfo.pas

@@ -43,16 +43,18 @@ Type
        llvmver_8_0,
        llvmver_xc_11,
        llvmver_9_0,
-       llvmver_10_0
+       llvmver_10_0,
+       llvmver_11_0
       );
 
 type
    tllvmversionflag = (
      llvmflag_memcpy_indiv_align,           { memcpy intrinsic supports separate alignment for source and dest }
-     llvmflag_null_pointer_valid,           { supports "llvmflag_null_pointer_valid" attribute, which indicates access to nil should not be optimized as undefined behaviour }
+     llvmflag_null_pointer_valid,           { supports "null-pointer-is-valid" attribute, which indicates access to nil should not be optimized as undefined behaviour }
      llvmflag_constrained_fptrunc_fpext,    { supports constrained fptrunc and fpext intrinsics }
      llvmflag_constrained_fptoi_itofp,      { supports constrained fptosi/fptoui/uitofp/sitofp instrinsics }
-     llvmflag_generic_constrained_si64tofp  { supports sitofp for 64 bit signed integers on all targets }
+     llvmflag_generic_constrained_si64tofp, { supports sitofp for 64 bit signed integers on all targets }
+     llvmflag_null_pointer_valid_new        { new syntax for the null pointer valid attribute: null_pointer_is_valid }
    );
    tllvmversionflags = set of tllvmversionflag;
 
@@ -66,7 +68,8 @@ Const
      '8.0',
      'Xcode-11.0',
      '9.0',
-     '10.0'
+     '10.0',
+     '11.0'
    );
 
    llvmversion_properties: array[tllvmversion] of tllvmversionflags =
@@ -79,7 +82,8 @@ Const
        { llvmver_8_0     } [llvmflag_memcpy_indiv_align,llvmflag_null_pointer_valid],
        { llvmver_xc_11   } [llvmflag_memcpy_indiv_align,llvmflag_null_pointer_valid],
        { llvmver_9_0     } [llvmflag_memcpy_indiv_align,llvmflag_null_pointer_valid,llvmflag_constrained_fptrunc_fpext],
-       { llvmver_10_0    } [llvmflag_memcpy_indiv_align,llvmflag_null_pointer_valid,llvmflag_constrained_fptrunc_fpext,llvmflag_constrained_fptoi_itofp]
+       { llvmver_10_0    } [llvmflag_memcpy_indiv_align,llvmflag_null_pointer_valid,llvmflag_constrained_fptrunc_fpext,llvmflag_constrained_fptoi_itofp],
+       { llvmver_11_0    } [llvmflag_memcpy_indiv_align,llvmflag_null_pointer_valid_new,llvmflag_constrained_fptrunc_fpext,llvmflag_constrained_fptoi_itofp]
      );
 
    { Supported optimizations, only used for information }