[PATCH] D57766: [opaque pointer types] Cleanup CGBuilder's Create*GEP.

James Y Knight via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 5 09:31:16 PST 2019


jyknight created this revision.
jyknight added a reviewer: dblaikie.
Herald added subscribers: cfe-commits, fedor.sergeev, kbarton, nhaehnle, jvesely, nemanjai, dschuff.
Herald added a project: clang.

Some of these functions take some extraneous arguments, e.g. EltSize,
Offset, which are computable from the Type and DataLayout.

Add some asserts to ensure that the computed values are consistent
with the passed-in values, in preparation for eliminating the
extraneous arguments. This also asserts that the Type is an Array for
the calls named "Array" and a Struct for the calls named "Struct".

Then, correct a couple of errors:

1. Using CreateStructGEP on an array type. (this causes the majority of the test differences, as struct GEPs are created with i32 indices, while array GEPs are created with i64 indices)

2. Passing the wrong Offset to CreateStructGEP in TargetInfo.cpp on x86-64 NACL (which uses 32-bit pointers).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D57766

Files:
  clang/lib/CodeGen/CGBuilder.h
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/builtins.c
  clang/test/CodeGen/exceptions-seh-finally.c
  clang/test/CodeGen/ms-setjmp.c
  clang/test/CodeGen/mult-alt-generic.c
  clang/test/CodeGen/object-size.c
  clang/test/CodeGen/ppc64-dwarf.c
  clang/test/CodeGen/sparcv9-dwarf.c
  clang/test/CodeGenCXX/2011-12-19-init-list-ctor.cpp
  clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp
  clang/test/CodeGenCXX/builtins.cpp
  clang/test/CodeGenCXX/const-init-cxx11.cpp
  clang/test/CodeGenCXX/cxx11-user-defined-literal.cpp
  clang/test/CodeGenCXX/for-range.cpp
  clang/test/CodeGenObjC/encode-test-6.m
  clang/test/CodeGenObjC/property-array-type.m
  clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
  clang/test/CodeGenOpenCL/amdgpu-alignment.cl
  clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
  clang/test/CodeGenOpenCL/constant-addr-space-globals.cl
  clang/test/Modules/templates.mm
  clang/test/OpenMP/target_depend_codegen.cpp
  clang/test/OpenMP/target_enter_data_depend_codegen.cpp
  clang/test/OpenMP/target_exit_data_depend_codegen.cpp
  clang/test/OpenMP/target_parallel_depend_codegen.cpp
  clang/test/OpenMP/target_parallel_for_depend_codegen.cpp
  clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
  clang/test/OpenMP/target_simd_depend_codegen.cpp
  clang/test/OpenMP/target_teams_depend_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
  clang/test/OpenMP/target_update_depend_codegen.cpp
  clang/test/OpenMP/task_codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57766.185334.patch
Type: text/x-patch
Size: 158074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190205/29af485f/attachment-0001.bin>


More information about the cfe-commits mailing list