Commit Graph

1260 Commits

Author SHA1 Message Date
Adrian Prantl 5df831d387 Remove all uses of DIFlagBlockByrefStruct
This patch removes the last reason why DIFlagBlockByrefStruct from
Clang by directly implementing the drilling into the member type done
in DwarfDebug::DbgVariable::getType() into the frontend.

rdar://problem/31629055

Differential Revision: https://reviews.llvm.org/D51807

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341842 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-10 16:14:28 +00:00
Sam McCall ee2b0839d5 Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"
This reverts commit r341519, which generates debug info that causes
backend crashes. (with -split-dwarf-file)

Details in https://reviews.llvm.org/D50495

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341549 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 14:27:40 +00:00
Hsiangkai Wang 84c42fee1b [DebugInfo] Generate debug information for labels. (Fix PR37395)
Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

After fixing PR37395.
After fixing problems in LiveDebugVariables.

Differential Revision: https://reviews.llvm.org/D45045

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341519 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 06:03:36 +00:00
Alexey Bataev 3413bef1da [DEBUGINFO] Add support for emission of the debug directives only.
Summary:
Added option -gline-directives-only to support emission of the debug directives
only. It behaves very similar to -gline-tables-only, except that it sets
llvm debug info emission kind to
llvm::DICompileUnit::DebugDirectivesOnly.

Reviewers: echristo

Subscribers: aprantl, fedor.sergeev, JDevlieghere, cfe-commits

Differential Revision: https://reviews.llvm.org/D51177

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341212 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 13:56:14 +00:00
David Blaikie 6eed53ab5d DebugInfo: Add the ability to disable DWARF name tables entirely
This changes the current default behavior (from emitting pubnames by
default, to not emitting them by default) & moves to matching GCC's
behavior* with one significant difference: -gno(-gnu)-pubnames disables
pubnames even in the presence of -gsplit-dwarf (though -gsplit-dwarf
still by default enables -ggnu-pubnames). This allows users to disable
pubnames (& the new DWARF5 accelerated access tables) when they might
not be worth the size overhead.

* GCC's behavior is that -ggnu-pubnames and -gpubnames override each
other, and that -gno-gnu-pubnames and -gno-pubnames act as synonyms and
disable either kind of pubnames if they come last. (eg: -gpubnames
-gno-gnu-pubnames causes no pubnames (neither gnu or standard) to be
emitted)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340206 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 20:14:08 +00:00
Reid Kleckner fbc78a8687 Update comments in CGDebugInfo to reflect changes in the MS mangler, NFC
I've tried to elaborate on the purpose of these type identifiers and why
and when clang uses them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340080 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 20:59:52 +00:00
David Blaikie 18639d8d29 Disable pubnames in NVPTX debug info using metadata
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339968 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 23:56:32 +00:00
David Blaikie 0701588514 Update for LLVM API change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339941 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 21:30:24 +00:00
Scott Linder a7898a0043 [DebugInfo][OpenCL] Address post-commit review for r338299
NFC refactor of code to generate debug info for OpenCL 2.X blocks.

Differential Revision: https://reviews.llvm.org/D50099


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339265 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 15:56:12 +00:00
Hsiangkai Wang 9dc8f63d49 Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"
Build failed in
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/27258

In lib/CodeGen/LiveDebugVariables.cpp:589, it uses std::prev(MBBI) to
get DebugValue's SlotIndex. however, the previous instruction may be
also a debug instruction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338992 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-06 07:07:18 +00:00
Hsiangkai Wang 2ec63f235e [DebugInfo] Generate debug information for labels. (Fix PR37395)
Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

After fixing PR37395.

Differential Revision: https://reviews.llvm.org/D45045

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-06 05:58:59 +00:00
Eric Christopher deb3f2e473 Revert "Add a definition for FieldSize that seems to make sense here."
This reverts commit r338327, the problem was previously fixed in r338321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338328 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 23:21:51 +00:00
Eric Christopher b999e4b0b8 Add a definition for FieldSize that seems to make sense here.
This could be sunk out of the if statements, but fix the warning for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338327 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 23:17:27 +00:00
Scott Linder b7709b0bcd Fix use of uninitialized variable in r338299
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338321 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 22:52:07 +00:00
Scott Linder 75e59153ea [DebugInfo][OpenCL] Generate correct block literal debug info for OpenCL
OpenCL block literal structs have different fields which are now correctly
identified in the debug info.

Differential Revision: https://reviews.llvm.org/D49930


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338299 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 20:31:11 +00:00
Shiva Chen 03e4db7ebd Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"
This reverts commit 4288dd3bf0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337803 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-24 02:57:11 +00:00
Shiva Chen 4288dd3bf0 [DebugInfo] Generate debug information for labels. (Fix PR37395)
Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

After fixing PR37395.

Differential Revision: https://reviews.llvm.org/D45045

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337800 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-24 02:23:59 +00:00
Aaron Smith 7ce68dd9c0 [CodeGen] Record if a C++ record is a trivial type
Summary: This has a dependence on D45122

Reviewers: rnk, zturner, llvm-commits, aleksandr.urakov

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D45124

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337736 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 20:49:07 +00:00
Reid Kleckner 906cfe1bf3 [codeview] Don't emit variable templates as class members
MSVC doesn't, so neither should we.

Fixes PR38004, which is a crash that happens when we try to emit debug
info for a still-dependent partial variable template specialization.

As a follow-up, we should review what we're doing for function and class
member templates. It looks like we don't filter those out, but I can't
seem to get clang to emit any.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337616 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:55:00 +00:00
Jonas Devlieghere 1107c5c9c8 [DebugInfo] Follow-up commit to improve consistency. NFC
Follow-up commit for r335757 to address some inconsistencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335834 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28 10:56:40 +00:00
Jonas Devlieghere baa2648969 [DebugInfo] Emit ObjC methods as part of interface
As brought up during the discussion of the DWARF5 accelerator tables,
there is currently no way to associate Objective-C methods with the
interface they belong to, other than the .apple_objc accelerator table.

After due consideration we came to the conclusion that it makes more
sense to follow Pavel's suggestion of just emitting this information in
the .debug_info section. One concern was that categories were
emitted in the .apple_names as well, but it turns out that LLDB doesn't
rely on the accelerator tables for this information.

This patch changes the codegen behavior to emit subprograms for
structure types, like we do for C++. This will result in the
DW_TAG_subprogram being nested as a child under its
DW_TAG_structure_type. This behavior is only enabled for DWARF5 and
later, so we can have a unique code path in LLDB with regards to
obtaining the class methods.

This was tested on the LLDB side and doesn't lead to a regression.
There's already code in place to deal with member functions in C++,
which deals with this transparently.

For more background please refer to the discussion on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-June/123986.html

Differential revision: https://reviews.llvm.org/D48241

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335757 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-27 17:31:59 +00:00
Tobias Edler von Koch 8246e43147 Re-land "[LTO] Enable module summary emission by default for regular LTO"
Since we are now producing a summary also for regular LTO builds, we
need to run the NameAnonGlobals pass in those cases as well (the
summary cannot handle anonymous globals).

See https://reviews.llvm.org/D34156 for details on the original change.

This reverts commit 6c9ee4a4a438a8059aacc809b2dd57128fccd6b3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335385 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 20:23:21 +00:00
Tobias Edler von Koch 16a4b69313 Revert "[LTO] Enable module summary emission by default for regular LTO"
This is breaking a couple of buildbots. We need to run the
NameAnonGlobal pass for regular LTO now as well (since we're producing a
summary). I'll post a separate patch for review to make this happen and
then re-commit.

This reverts commit c0759b7b1f4a81ff9021b952aa38a222d5fa4dfd.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335291 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21 21:24:30 +00:00
Tobias Edler von Koch 044f47d77b [LTO] Enable module summary emission by default for regular LTO
Summary:
With D33921, we gained the ability to have module summaries in regular
LTO modules without triggering ThinLTO compilation. Module summaries in
regular LTO allow garbage collection (dead stripping) before LTO
compilation and thus open up additional optimization opportunities.

This patch enables summary emission in regular LTO for all targets
except ld64-based ones (which use the legacy LTO API).

Reviewers: pcc, tejohnson, mehdi_amini

Subscribers: inglorion, eraman, cfe-commits

Differential Revision: https://reviews.llvm.org/D34156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335284 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21 20:20:41 +00:00
Leonard Chan 6f0d77d277 [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents
This diff includes changes for the remaining _Fract and _Sat fixed point types.

```
signed short _Fract s_short_fract;
signed _Fract s_fract;
signed long _Fract s_long_fract;
unsigned short _Fract u_short_fract;
unsigned _Fract u_fract;
unsigned long _Fract u_long_fract;

// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;
short _Fract short_fract;
_Fract fract;
long _Fract long_fract;

// Saturated fixed point types
_Sat signed short _Accum sat_s_short_accum;
_Sat signed _Accum sat_s_accum;
_Sat signed long _Accum sat_s_long_accum;
_Sat unsigned short _Accum sat_u_short_accum;
_Sat unsigned _Accum sat_u_accum;
_Sat unsigned long _Accum sat_u_long_accum;
_Sat signed short _Fract sat_s_short_fract;
_Sat signed _Fract sat_s_fract;
_Sat signed long _Fract sat_s_long_fract;
_Sat unsigned short _Fract sat_u_short_fract;
_Sat unsigned _Fract sat_u_fract;
_Sat unsigned long _Fract sat_u_long_fract;

// Aliased saturated fixed point types
_Sat short _Accum sat_short_accum;
_Sat _Accum sat_accum;
_Sat long _Accum sat_long_accum;
_Sat short _Fract sat_short_fract;
_Sat _Fract sat_fract;
_Sat long _Fract sat_long_fract;
```

This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches.

Differential Revision: https://reviews.llvm.org/D46911

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334718 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14 14:53:51 +00:00
Leonard Chan e59be5df58 This diff includes changes for supporting the following types.
// Primary fixed point types
signed short _Accum s_short_accum;
signed _Accum s_accum;
signed long _Accum s_long_accum;
unsigned short _Accum u_short_accum;
unsigned _Accum u_accum;
unsigned long _Accum u_long_accum;

// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;
This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches.

The tests included are for asserting that we can declare these types.

Fixed the test that was failing by not checking for dso_local on some
targets.

Differential Revision: https://reviews.llvm.org/D46084

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333923 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-04 16:07:52 +00:00
Leonard Chan a07c88c0e8 Revert "This diff includes changes for supporting the following types."
This reverts commit r333814, which fails for a test checking the bit
width on ubuntu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333815 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-02 03:27:13 +00:00
Leonard Chan d10551520b This diff includes changes for supporting the following types.
```

// Primary fixed point types
signed short _Accum s_short_accum;
signed _Accum s_accum;
signed long _Accum s_long_accum;
unsigned short _Accum u_short_accum;
unsigned _Accum u_accum;
unsigned long _Accum u_long_accum;

// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;

```

This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches.

The tests included are for asserting that we can declare these types.

Differential Revision: https://reviews.llvm.org/D46084

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333814 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-02 02:58:51 +00:00
Paul Robinson 401f26547f Revert "[DebugInfo] Don't bother with MD5 checksums of preprocessed files."
This reverts commit d734f2aa3f76fbf355ecd2bbe081d0c1f49867ab.
Also known as r333311.  A very small but nonzero number of bots fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333319 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 22:35:59 +00:00
Paul Robinson 6ce4c55a72 [DebugInfo] Don't bother with MD5 checksums of preprocessed files.
The checksum will not reflect the real source, so there's no clear
reason to include them in the debug info.  Also this was causing a
crash on the DWARF side.

Differential Revision: https://reviews.llvm.org/D47260

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333311 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 20:59:29 +00:00
Brock Wyma 8fff739f77 [CodeView] Enable debugging of captured variables within C++ lambdas
This change will help Visual Studio resolve forward references to C++ lambda
routines used by captured variables.

Differential Revision: https://reviews.llvm.org/D45438



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332975 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22 12:41:19 +00:00
Brock Wyma 1ac7096910 [CodeView] Improve debugging of virtual base class member variables
Initial support for passing the virtual base pointer offset to CodeViewDebug.

https://reviews.llvm.org/D46271



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332296 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 21:21:22 +00:00
Hans Wennborg 308bae98df Revert r331843 "[DebugInfo] Generate debug information for labels."
It broke the Chromium build (see reply on the review).

> Generate DILabel metadata and call llvm.dbg.label after label
> statement to associate the metadata with the label.
>
> Differential Revision: https://reviews.llvm.org/D45045
>
> Patch by Hsiangkai Wang.

This doesn't revert the change to backend-unsupported-error.ll
that seems to correspond to an llvm-side change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331861 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 09:29:58 +00:00
Shiva Chen dc29e8eb7e [DebugInfo] Generate debug information for labels.
Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

Differential Revision: https://reviews.llvm.org/D45045

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331843 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 02:41:56 +00:00
Richard Smith 9067f8fb74 Implement P0482R2, support for char8_t type.
This is not yet part of any C++ working draft, and so is controlled by the flag
-fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a
flag with the same name.)

This implementation is experimental, and will be removed or revised
substantially to match the proposal as it makes its way through the C++
committee.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331244 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 05:02:45 +00:00
Mikhail Maltsev 53b59bc247 [CodeGen] Reland r330442: Add an option to suppress output of llvm.ident
The test case in the original patch was overly contrained and
failed on PPC targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330575 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 10:08:46 +00:00
Mikhail Maltsev 052902970a Revert r330442, CodeGen/no-ident-version.c is failing on PPC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330451 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 17:14:39 +00:00
Mikhail Maltsev 2889dbd841 [CodeGen] Add an option to suppress output of llvm.ident
Summary:
By default Clang outputs its version (including git commit hash, in
case of trunk builds) into object and assembly files. It might be
useful to have an option to disable this, especially for debugging
purposes.
This patch implements new command line flags -Qn and -Qy (the names
are chosen for compatibility with GCC). -Qn disables output of
the 'llvm.ident' metadata string and the 'producer' debug info. -Qy
(enabled by default) does the opposite.

Reviewers: faisalv, echristo, aprantl

Reviewed By: aprantl

Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01

Differential Revision: https://reviews.llvm.org/D45255

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330442 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 16:29:03 +00:00
Brock Wyma adf8ae4536 [CodeView] Initial support for emitting S_THUNK32 symbols for compiler...
When emitting CodeView debug information, compiler-generated thunk routines
should be emitted using S_THUNK32 symbols instead of S_GPROC32_ID symbols so
Visual Studio can properly step into the user code.  This initial support only
handles standard thunk ordinals.

Differential Revision: https://reviews.llvm.org/D43838



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-16 16:53:57 +00:00
Alexander Kornienko b8b9458165 Fix typos in clang
Found via codespell -q 3 -I ../clang-whitelist.txt
Where whitelist consists of:

  archtype
  cas
  classs
  checkk
  compres
  definit
  frome
  iff
  inteval
  ith
  lod
  methode
  nd
  optin
  ot
  pres
  statics
  te
  thru

Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few
files that have dubious fixes reverted.)

Differential revision: https://reviews.llvm.org/D44188

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-06 15:14:32 +00:00
Artem Belevich 0ac472786f Revert "Set calling convention for CUDA kernel"
This reverts r328795 which introduced an issue with referencing __global__
function templates. More details in the original review D44747.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329099 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 18:29:31 +00:00
Reid Kleckner ba6d4973fc Fix some DenseMap use-after-rehash bugs and hoist MethodVFTableLocation
This re-lands r328845 with fixes for crbug.com/827810.

The initial motiviation was to hoist MethodVFTableLocation to global
scope so it could be forward declared.

In this patch, I noticed that MicrosoftVTableContext uses some risky
patterns. It has methods that return references to data stored in
DenseMaps. I've made some of them return by value for trivial structs
and I've moved some things into separate allocations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329007 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 20:00:39 +00:00
Nico Weber c1ef03f930 Revert r328845, it caused crbug.com/827810.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328922 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-31 18:26:25 +00:00
Reid Kleckner af48a14243 Hoist MethodVFTableLocation out of MicrosoftVTableContext, NFC
This allows forward declaring it so that we can add it to
MicrosoftMangleContext::mangleVirtualMemPtrThunk without including
VTableBuilder.h. That saves a hashtable lookup when emitting virtual
member pointer functions.

It also shortens a really long type name. This struct has "VFtable" in
the name, so it seems pretty unlikely that someone will assume it is
generally useful for non-MS C++ ABI stuff.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328845 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 22:42:24 +00:00
Yaxun Liu 96325393f6 Set calling convention for CUDA kernel
This patch sets target specific calling convention for CUDA kernels in IR.

Patch by Greg Rodgers.
Revised and lit test added by Yaxun Liu.

Differential Revision: https://reviews.llvm.org/D44747


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328795 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 15:02:08 +00:00
Jonas Devlieghere eee26f22fc [CodeGen] Emit DWARF "constructor" calling convention
Now that LLVM has support for emitting calling conventions in DWARF (see
r328191) have clang emit them.

Patch by: Adrien Guinet

Differential revision: https://reviews.llvm.org/D42351

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328196 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 13:53:30 +00:00
George Burgess IV f6b7996bf6 Remove redundant casts. NFC
So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and
`dyn_cast`s for fun. This is a portion of what it found for clang; I
plan to do similar cleanups in LLVM and other subprojects when I find
time.

Because of the volume of changes, I explicitly avoided making any change
that wasn't highly local and obviously correct to me (e.g. we still have
a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading
is a thing and the cast<Bar> did actually change the type -- just up the
class hierarchy).

I also tried to leave the types we were cast<>ing to somewhere nearby,
in cases where it wasn't locally obvious what we were dealing with
before.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-01 05:43:23 +00:00
Scott Linder 7fab66ed2f [DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. This vendor extension to DWARF v5 allows source text to be
embedded directly in the line tables of the debug line section.

Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates
that source should be passed through to LLVM during CodeGen.

Differential Revision: https://reviews.llvm.org/D42766


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326102 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26 17:32:31 +00:00
Scott Linder cf3546e69e [CodeGen][DebugInfo] Refactor duplicated code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326099 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26 16:31:08 +00:00
Erich Keane 789b385fd1 Implement function attribute artificial
Added support in clang for GCC function attribute 'artificial'. This attribute 
is used to control stepping behavior of debugger with respect to inline 
functions.

Patch By: Elizabeth Andrews (eandrews)

Differential Revision: https://reviews.llvm.org/D43259



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325081 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-14 00:14:07 +00:00