summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable support for __float128 in ClangNemanja Ivanovic2016-04-131-0/+6
| | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D15120 It adds support for the __float128 keyword, literals and a target feature to enable it. This support is disabled by default on all targets and any target that has support for this type is free to add it. Based on feedback that I've received from target maintainers, this appears to be the right thing for most targets. I have not heard from the maintainers of X86 which I believe supports this type. I will subsequently investigate the impact of enabling this on X86. llvm-svn: 266186
* [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader2016-04-131-1/+1
| | | | | | | | | | Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header". This fixes the modules build. Differential revision: http://reviews.llvm.org/D18954 Reviewers: Richard Smith, Vassil Vassilev. llvm-svn: 266180
* Add a fixme for an old patch I had lying around that I'm not going to finish ↵David Blaikie2016-04-121-0/+5
| | | | | | any time so n llvm-svn: 266127
* Use NoDebug compile units to mark debug metadata used only for sample-basedAdrian Prantl2016-04-081-5/+16
| | | | | | | | | | profiling and optimization remarks and indicate that no debug info shall be emitted for these compile units. http://reviews.llvm.org/D18808 <rdar://problem/25427165> llvm-svn: 265862
* revert SVN r265702, r265640Saleem Abdulrasool2016-04-081-1/+1
| | | | | | | | | | | Revert the two changes to thread CodeGenOptions into the TargetInfo allocation and to fix the layering violation by moving CodeGenOptions into Basic. Code Generation is arguably not particularly "basic". This addresses Richard's post-commit review comments. This change purely does the mechanical revert and will be followed up with an alternate approach to thread the desired information into TargetInfo. llvm-svn: 265806
* [OpenCL] Complete image types support.Alexey Bader2016-04-081-33/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I. Current implementation of images is not conformant to spec in the following points: 1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine: void write_image(write_only image2d_t img); kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code which is disallowed according to s6.13.14. 2. It discards access qualifier on generated code, which leads to generated code for the above example: call void @write_image(%opencl.image2d_t* %img); In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images. Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently. 3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names. 4. Default access qualifier read_only is to be added if not provided explicitly. II. This patch corrects the above points as follows: 1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type. 2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers). 3. Improves testing of images in Clang. Author: Anastasia Stulova Reviewers: bader, mgrang. Subscribers: pxli168, pekka.jaaskelainen, yaxunl. Differential Revision: http://reviews.llvm.org/D17821 llvm-svn: 265783
* Basic: move CodeGenOptions from FrontendSaleem Abdulrasool2016-04-071-1/+1
| | | | | | | | This is a mechanical move of CodeGenOptions from libFrontend to libBasic. This fixes the layering violation introduced earlier by threading CodeGenOptions into TargetInfo. It should also fix the modules based self-hosting builds. NFC. llvm-svn: 265702
* Adapt to LLVM API change in r265077.Adrian Prantl2016-03-311-3/+3
| | | | | | | | | EmissionKind moved from DIBuilder to DICompileUnit. <rdar://problem/25427165> llvm-svn: 265078
* Revert "Recommitted r263425 "Supporting all entities declared in lexical ↵Reid Kleckner2016-03-241-34/+7
| | | | | | | | | | | scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)." This reverts commit r264281. This change breaks building Chromium for iOS. We'll upload a reproducer to the PR soon. llvm-svn: 264333
* Recommitted r263425 "Supporting all entities declared in lexical scope in ↵Amjad Aboud2016-03-241-7/+34
| | | | | | | | | | LLVM debug info." After fixing PR26942 (the fix is included in this commit). Differential Revision: http://reviews.llvm.org/D18350 llvm-svn: 264281
* Revert "Recommitted r261634 "Supporting all entities declared in lexical ↵Benjamin Kramer2016-03-141-34/+7
| | | | | | | | scope in LLVM debug info." After fixing PR26715 at r263379." This reverts commit r263425. Breaks self-host. llvm-svn: 263436
* Recommitted r261634 "Supporting all entities declared in lexical scope in ↵Amjad Aboud2016-03-141-7/+34
| | | | | | | | LLVM debug info." After fixing PR26715 at r263379. llvm-svn: 263425
* Reapply r261657.Adrian Prantl2016-02-231-11/+9
| | | | | | | | | | | | | | | | | | | | | | Remove an unnecessary workaround introduced in r259975. (NFC) Now that LLVM r259973 allows replacing a temporary type with another temporary we can rely on the original implementation. It is possible for enums to be created as part of their own declcontext. In this case a FwdDecl will be created twice. This doesn't cause a problem because both FwdDecls are entered into the ReplaceMap: finalize() will replace the first FwdDecl with the second and then replace the second with complete type. Thanks to echristo for pointing this out. # Conflicts: # lib/CodeGen/CGDebugInfo.cpp llvm-svn: 261673
* Revert r261634 "Supporting all entities declared in lexical scope in LLVM ↵Hans Wennborg2016-02-231-42/+17
| | | | | | | | debug info." and r261657 r261634 and r261633 seems to have caused PR26715. r261657 depends on the former two. llvm-svn: 261670
* Remove an unnecessary workaround introduced in r259975. (NFC)Adrian Prantl2016-02-231-12/+9
| | | | | | | | | | | | | | | | Now that LLVM r259973 allows replacing a temporary type with another temporary we can rely on the original implementation. It is possible for enums to be created as part of their own declcontext. In this case a FwdDecl will be created twice. This doesn't cause a problem because both FwdDecls are entered into the ReplaceMap: finalize() will replace the first FwdDecl with the second and then replace the second with complete type. Thanks to echristo for pointing this out. llvm-svn: 261657
* Supporting all entities declared in lexical scope in LLVM debug info.Amjad Aboud2016-02-231-7/+35
| | | | | | Differential Revision: http://reviews.llvm.org/D15977 llvm-svn: 261634
* Use llvm::TempDIScope instead of manually deleting a temporary MDNode.Adrian Prantl2016-02-081-5/+4
| | | | llvm-svn: 260113
* Add a missing call to MDNode::deleteTemporary().Adrian Prantl2016-02-061-3/+4
| | | | | | | | Follow-up to r259975. Kudos to the ASAN bots! <rdar://problem/24493203> llvm-svn: 260002
* Fix a crash when emitting dbeug info for forward-declared scoped enums.Adrian Prantl2016-02-061-1/+13
| | | | | | | | | | It is possible for enums to be created as part of their own declcontext. We need to cache a placeholder to avoid the type being created twice before hitting the cache. <rdar://problem/24493203> llvm-svn: 259975
* Move DebugInfoKind into its own header to cut the cyclic dependency edge ↵Benjamin Kramer2016-02-021-33/+31
| | | | | | from Driver to Frontend. llvm-svn: 259489
* Class Property: handle class properties.Manman Ren2016-01-271-2/+2
| | | | | | | | At places where we handle instance properties, if necessary. rdar://23891898 llvm-svn: 258979
* Use instance_properties instead of properties. NFC.Manman Ren2016-01-261-2/+2
| | | | | | | | | | | All current properties are instance properties. This is the second patch in a series of patches to support class properties in addition to instance properties in objective-c. rdar://23891898 llvm-svn: 258824
* Module debugging: Create a parent DIModule with the PCH name for typesAdrian Prantl2016-01-221-0/+4
| | | | | | | | | emitted into a precompiled header to mirror the debug info emitted for object files importing the PCH. rdar://problem/24290667 llvm-svn: 258555
* Fix the build by using the correct suffix for 64 bit literalsAdrian Prantl2016-01-221-1/+1
| | | | llvm-svn: 258531
* Fix a typo in r258507 and change the PCH dwoid constant to ~1UL.Adrian Prantl2016-01-221-1/+1
| | | | | | rdar://problem/24290667 llvm-svn: 258519
* Module Debugging: Use a nonzero DWO id for precompiled headers.Adrian Prantl2016-01-221-1/+4
| | | | | | | | | | | | | PCH files don't have a module signature and LLVM uses a nonzero DWO id as an indicator for skeleton / module CUs. This change pins the DWO id for PCH files to a known constant value. The correct long-term solution here is to implement a module signature that is an actual dterministic hash (at the moment module signatures are just random nonzero numbers) and then enable this for PCH files as well. <rdar://problem/24290667> llvm-svn: 258507
* Module Debugging: Fine-tune the condition that determines whether a typeAdrian Prantl2016-01-201-1/+1
| | | | | | | | | | | | | can be found in a module. There are externally visible anonymous types that can be found: typedef struct { } s; // I can be found via the typedef. There are anonymous internal types that can be found: namespace { struct s {}; } // I can be found by name. rdar://problem/24199640 llvm-svn: 258272
* Module Debugging: Don't emit external type references to anonymous types.Adrian Prantl2016-01-191-2/+3
| | | | | | | | Even if they exist in the module, they can't be matched with the forward declaration in the object file. <rdar://problem/24199640> llvm-svn: 258251
* Update for LLVM function name change.Rui Ueyama2016-01-141-2/+1
| | | | llvm-svn: 257802
* [OpenCL] Pipe type supportXiuli Pan2016-01-091-0/+8
| | | | | | | | | | | | | | | Summary: Support for OpenCL 2.0 pipe type. This is a bug-fix version for bader's patch reviews.llvm.org/D14441 Reviewers: pekka.jaaskelainen, Anastasia Subscribers: bader, Anastasia, cfe-commits Differential Revision: http://reviews.llvm.org/D15603 llvm-svn: 257254
* Fix an unused variable warning from r256012.Chad Rosier2015-12-181-1/+1
| | | | llvm-svn: 256023
* Add a defensive check for a nullptr.Adrian Prantl2015-12-181-5/+7
| | | | llvm-svn: 256012
* Print qualified display names when emitting CodeViewReid Kleckner2015-12-161-11/+20
| | | | | | This is what debuggers expect. Words towards fixing PR21528. llvm-svn: 255744
* Do not generate DW_TAG_imported_module for anonymous namespaces (even ↵Ekaterina Romanova2015-12-101-4/+8
| | | | | | | | | | nested) for all the platforms except PS4. For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute. Differential Revision: http://reviews.llvm.org/D12624 llvm-svn: 255281
* Small follow-up to 254750 to get the test added there passing...Nico Weber2015-12-041-5/+5
| | | | llvm-svn: 254754
* Fix debug info for Objective-C properties from class extensions after r251874Nico Weber2015-12-041-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After r251874, properties from class extensions no longer show up in ObjCInterfaceDecl::properties(). Make debug info emission explicitly look for properties in class extensions before looking at direct properties. Also add a test that checks for this. There are three interesting cases: 1. A property is only declared in a class extension, and the @implementation is in a different file. This used to generated a DIObjcProperty before r251874 and does again with this fix. 2. A property is declared as readonly in the class itself and redeclared as readwrite in a class extension. clang before r251874 put the DIObjcProperty on the first declaration. clang after r251874 didn't emit any DIObjcProperty, and clang with this fix puts it on the readwrite redeclaration (which is what lookup finds). This seems like a progression. 3. Like 2, but with an @implementation in the same file. In this case, the property debug info gets generated a second time through the ivar from the definition. In this case, lookup and declaration code need to agree on the line number so that the DIObjcProperty isn't emitted twice. In this case, clang before r251874 emitted one DIObjcProperty on the first declaration, clang with r251874 emitted one on the second declaration, and clang with this patch still does the latter. llvm-svn: 254750
* [DebugInfo] Look through type sugar on union types when castingReid Kleckner2015-11-201-1/+1
| | | | | | Fixes PR25584. llvm-svn: 253680
* [CGDebugInfo] Set the size and align for reference typesKeno Fischer2015-11-161-6/+7
| | | | | | | | | | In r253186, I changed the DIBuilder API to now take size and align for reference types as well. This was done in preparation for upcoming changes to the Verifier that will validate that sizes match between DI types and IR values that are declared as having those types. This updates clang to actually pass the information through. llvm-svn: 253190
* CodeGen: Update for debug info API change.Peter Collingbourne2015-11-051-6/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D14266 llvm-svn: 252220
* Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.Douglas Gregor2015-11-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'readonly' Objective-C property declared in the primary class can effectively be shadowed by a 'readwrite' property declared within an extension of that class, so long as the types and attributes of the two property declarations are compatible. Previously, this functionality was implemented by back-patching the original 'readonly' property to make it 'readwrite', destroying source information and causing some hideously redundant, incorrect code. Simplify the implementation to express how this should actually be modeled: as a separate property declaration in the extension that shadows (via the name lookup rules) the declaration in the primary class. While here, correct some broken Fix-Its, eliminate a pile of redundant code, clean up the ARC migrator's handling of properties declared in extensions, and fix debug info's naming of methods that come from categories. A wonderous side effect of doing this write is that it eliminates the "AddedObjCPropertyInClassExtension" method from the AST mutation listener, which in turn eliminates the last place where we rewrite entire declarations in a chained PCH file or a module file. This change (which fixes rdar://problem/18475765) will allow us to eliminate the rewritten-decls logic from the serialization library, and fixes a crash (rdar://problem/23247794) illustrated by the test/PCH/chain-categories.m example. llvm-svn: 251874
* [CodeGen] Remove dead code. NFC.Benjamin Kramer2015-10-151-24/+0
| | | | llvm-svn: 250418
* Update clang for DIBuilder::createSubroutineType API change.Eric Christopher2015-10-151-7/+6
| | | | | | Patch by Amaury Sechet! llvm-svn: 250373
* Support Debug Info path remappingSaleem Abdulrasool2015-10-121-8/+20
| | | | | | | | | | | | | | | | Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
* Module Debugging: Emit (ObjC) function declarations in the module scopeAdrian Prantl2015-10-041-1/+1
| | | | | | when building a module. llvm-svn: 249282
* Module debugging: Don't emit forward declarations in module scopes.Adrian Prantl2015-10-021-0/+3
| | | | | | A forward declaration inside a module header does not belong to the module. llvm-svn: 249157
* Remove unused variable.Adrian Prantl2015-10-021-1/+0
| | | | llvm-svn: 249155
* Module debugging: Also emit Objective-C interfaces forward declarationsAdrian Prantl2015-10-011-2/+3
| | | | | | in their module scope when building a clang module. llvm-svn: 249031
* Module debugging: Emit Objective-C interfaces in their module scope whenAdrian Prantl2015-10-011-2/+3
| | | | | | building a clang module. llvm-svn: 248974
* CGDebugInfo: Don't reuse a reference into a DenseMap if the DenseMap mayAdrian Prantl2015-09-291-4/+4
| | | | | | be modified in between. (NFC) llvm-svn: 248826
* Module Debugging: Emit submodules as nested DW_TAG_modules.Adrian Prantl2015-09-241-5/+10
| | | | llvm-svn: 248511
OpenPOWER on IntegriCloud