Commit Graph

490 Commits

Author SHA1 Message Date
Anna Zaks
e36839ca8a [IRGen] Eliminate calls to SILLocation() from IRGen.
Here, the location information does not have to always be available. Use Optional instead of creating an empty location.

Swift SVN r8055
2013-09-09 22:34:01 +00:00
Anna Zaks
cb43f56edb [SIL] Remove more dependancies on SILLocation(), specifically from debugging related code.
Swift SVN r8019
2013-09-06 23:57:30 +00:00
Anna Zaks
369a948248 [SIL] Minor auto-generated SILLocation API rename/refactor.
Swift SVN r8018
2013-09-06 23:57:27 +00:00
Adrian Prantl
07da340eef Move Dwarf constant definitions from lib/IrGen to include/basic.
Swift SVN r7850
2013-09-03 18:09:51 +00:00
Adrian Prantl
9bc6220ee1 Debug info: forgot to zero-terminate string.
Swift SVN r7769
2013-08-30 00:17:08 +00:00
Adrian Prantl
31c926660f Extend SerializedModuleLoader to load modules from a bitstream.
Add tools/lldb-moduleimport-test, which simulates LLDB importing modules
from the __apple_ast section in Mach-O files and use it to regression-test
the new API.

Swift SVN r7709
2013-08-29 00:57:05 +00:00
Adrian Prantl
9cacf75a8f Revert "Debug info: Class are passed by reference, make class args and local"
This reverts commit r7639.
Greg found out that we should not be doing this after all, since _all_ classes are references by definition.

Swift SVN r7692
2013-08-28 21:58:25 +00:00
Adrian Prantl
c4d53aadd3 Debug Info: Make sure that top_level_code has a decl_file/decl_line.
Swift SVN r7675
2013-08-28 18:38:59 +00:00
Adrian Prantl
2524f76e85 Debug Info: Rename builtin types. [cosmetic]
Swift SVN r7670
2013-08-28 17:25:38 +00:00
Adrian Prantl
821fbb11db Debug info: Class are passed by reference, make class args and local
variables use a DW_op_deref expr.
Fixes <rdar://problem/14849106>

Swift SVN r7641
2013-08-27 22:48:26 +00:00
Anna Zaks
440631f86a [SIL] Add the SILLocation hierarchy.
Now we should be ready to start using these.

Swift SVN r7632
2013-08-27 22:16:18 +00:00
Adrian Prantl
cf4e28a70a Debug Info: Change the type caching to be based on the Type instead of
DebugTypeInfo. This is based off the observation that no two types that
share the same canonical type can have different storage and alignment
and has the benefit of being able to locate the debug info for a type
described by a meta type.

Swift SVN r7578
2013-08-26 17:55:14 +00:00
Adrian Prantl
e96a3f64c6 Debug Info: Set the scope line of a subprogram to the beginning of a
function, except for pipeclosures.
Fixes rdar://problem/14798676.

Swift SVN r7529
2013-08-23 21:46:27 +00:00
Adrian Prantl
e62fa5c07b Debug info: represent union types as union types instead of base types.
Swift SVN r7491
2013-08-22 23:26:15 +00:00
Adrian Prantl
966e9a1fa6 Update a comment.
Swift SVN r7469
2013-08-22 18:36:07 +00:00
Adrian Prantl
f808746917 Debug info: Remove an unneeded and wrong RAUW.
Swift SVN r7466
2013-08-22 18:35:59 +00:00
Adrian Prantl
6f7048c75a Debug Info: Reorganized and generalized the layout of the __apple_ast
section based on feedback from Greg.

Swift SVN r7443
2013-08-22 00:49:15 +00:00
Adrian Prantl
5993c92d14 Debug Info: Fix a bits vs bytes error.
Swift SVN r7423
2013-08-21 20:24:54 +00:00
Adrian Prantl
661315763a Debug Info: This patch implements the "emit modules when compiling -g"
proposal.
When compiling with debug info, build a swiftmodule that contains all the
type decls referenced by DWARF and emit it into a special __apple_swiftast
section in the .o file.

Swift SVN r7398
2013-08-21 01:07:30 +00:00
Adrian Prantl
7d759cc605 Debug Info: ignore property members that do not have any storage in the offset calculation.
Swift SVN r7371
2013-08-20 21:26:50 +00:00
Adrian Prantl
d1c1f4deee Debug info: Emit the appropriate encoding for builtin types.
Swift SVN r7232
2013-08-14 17:27:46 +00:00
Dmitri Hrybenko
13070a31bd SourceManager: make findBufferContainingLoc() always succeed.
Every valid source location corresponds to a source buffer.  There should be no
cases where we create a source location for a random string.  Thus,
findBufferContainingLoc() always succeeds.


Swift SVN r7120
2013-08-10 01:48:04 +00:00
Dmitri Hrybenko
8f7a437d44 Wrap a few functions from LLVM SourceMgr in preparation of making
SourceLoc::Value private


Swift SVN r7114
2013-08-09 23:15:59 +00:00
Adrian Prantl
aa11e4be55 Debug info: Add a swift -g test that runs the metadata verification in
LLVM and a bug uncovered by verifyer: Tuple elements should be member types.

Swift SVN r7113
2013-08-09 22:53:25 +00:00
Adrian Prantl
d00fe7e7dd Replace Twine with StringRef.
Swift SVN r7112
2013-08-09 22:53:24 +00:00
Dmitri Hrybenko
de59d8dcd4 Remove unneeded llvm:: qualifier for llvm::StringRef and llvm::SmallVector
Swift SVN r7089
2013-08-09 18:41:46 +00:00
Adrian Prantl
5e98accde4 Debug info: Rename createFunction -> emitFunction for consistency.
Swift SVN r7054
2013-08-08 21:20:07 +00:00
Adrian Prantl
5831c1b1a3 Debug info: support chained typealiases.
Swift SVN r7026
2013-08-07 23:50:29 +00:00
Adrian Prantl
bf436fd3cf Debug info: The age of DietDebugInfo(TM) is over. Here come sugared types!
Type aliases are represented as DW_TAG_typedef.

Swift SVN r6959
2013-08-06 22:50:18 +00:00
Adrian Prantl
a55b10ddbe Debug info: now with columns! This will be important since Swift is far
more compact and closures are ubiquitous.

Swift SVN r6944
2013-08-06 18:12:20 +00:00
Adrian Prantl
b5f8c40f45 Debug info: Add a testcase for closures. Ensure that closures are not
artificial.

Swift SVN r6928
2013-08-06 00:56:32 +00:00
Adrian Prantl
14c02dad7b Forgot to add the testcase for r6913.
Swift SVN r6920
2013-08-05 21:33:47 +00:00
Adrian Prantl
492a603560 Debug info: purge implicit closures from the linetable.
rdar://problem/14627460

Swift SVN r6915
2013-08-05 21:01:07 +00:00
Adrian Prantl
f416d78e68 Debug info: top_level_code is not an artificial function.
Swift SVN r6914
2013-08-05 21:01:04 +00:00
Adrian Prantl
e96e256b01 Debug Info: Include Pattern in the list of things that have a location.
Swift SVN r6874
2013-08-03 02:14:42 +00:00
Joe Groff
4316239f5d Kill Builtin.OpaquePointer.
It's not needed by SIL anymore.

Swift SVN r6873
2013-08-03 01:56:06 +00:00
Adrian Prantl
8305b0229d Debug info: Emit the list of imported modules into DWARF. (They used to be
elided by the backend because they had no namespaces anchoring them).

Swift SVN r6858
2013-08-02 22:06:04 +00:00
Jordan Rose
c92fa28833 Have ImportDecl vend a separate "module path" and "decl path".
This makes it very clean to reason about which part should be used
to find a module to load, and which part should be used to filter
lookup within that module.

This breaks the old "import swift.print" syntax in favor of the new
"import func swift.print", but the new syntax is currently ignored.

Swift SVN r6849
2013-08-02 21:00:22 +00:00
Dmitri Hrybenko
e1c4ae3174 Wrap llvm::SourceMgr in swift::SourceManager so that we can add new members
to the source manager.


Swift SVN r6815
2013-08-01 20:39:22 +00:00
Adrian Prantl
37ca2c3903 Debug info: Emit all imports into the IR.
Swift SVN r6813
2013-08-01 18:47:59 +00:00
Adrian Prantl
2332517e36 Debug info: Fix an invalid pointer deref.
Swift SVN r6812
2013-08-01 18:47:58 +00:00
Jordan Rose
674a03b085 Replace "oneof" with "union"...everywhere.
We haven't fully updated references to union cases, and enums still are not
their own thing yet, but "oneof" is gone. Long live "union"!

Swift SVN r6783
2013-07-31 21:33:33 +00:00
Adrian Prantl
3313f8acbc Debug info: emit command line options.
Swift SVN r6778
2013-07-31 18:48:59 +00:00
Adrian Prantl
5abfdb74b7 Debug Info: Handle metatypes a little better.
Swift SVN r6777
2013-07-31 18:08:40 +00:00
Adrian Prantl
13d43602ba Debug info: Correct Bits vs Byte and add the bitsize to the testcases.
Swift SVN r6776
2013-07-31 18:08:39 +00:00
Adrian Prantl
aecfb851cd Wire clang::TargetInfo into swift::IRGenDebugInfo so we have access to
the target size of types, which may be different from the LLVM storage size.

Swift SVN r6774
2013-07-31 18:08:38 +00:00
Adrian Prantl
be3ba262b5 Debug info: Emit the human-readable name of a constructor as "constructor".
rdar://problem/14583186

Swift SVN r6748
2013-07-30 20:05:51 +00:00
Adrian Prantl
2c2ec20b3a Debug Info: Push the current location before we create a new function,
because we often emit functions while in the middle of another function.

Swift SVN r6744
2013-07-30 18:21:06 +00:00
Adrian Prantl
2306563aa2 Debug info: emit the module name for types declare in a swiftmodule.
Swift SVN r6734
2013-07-30 01:17:02 +00:00
Adrian Prantl
5b5ba6d78a Name mangling: Add a "_Tt" prefix to all type names that are output in
the debug info, to aid the debugger in figuring out the implementation
language of a given type in multi-language environments.
FYI, where applicable, we also emit the
DW_AT_APPLE_runtime_class(DW_AT_lang_Swift) attribute.
The demangler accepts type names with the "_Tt" prefix without the --type
switch.

Swift SVN r6714
2013-07-29 22:03:15 +00:00