Commit Graph

1132 Commits

Author SHA1 Message Date
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Saleem Abdulrasool
1aecddbdef Adjust for SVN r290153
DIGlobalVariable had the associated expression separated into a
DIGlobalVariableExpression which ties the DIGlobalVariable and the
DIExpression together.
2017-01-03 14:30:55 -08:00
Saleem Abdulrasool
6d47571baf Adjust for SVN r289702
The File and Directory parameters to CreateCompileUnit have been changed to a
single DIFile parameter to permit future expansion.
2017-01-03 14:30:07 -08:00
Bob Wilson
78b28243ff Merge remote-tracking branch 'origin/master' into master-next 2017-01-03 14:22:59 -08:00
Saleem Abdulrasool
27bf54328f IRGen: adjust DI for SVN r288683
The original implementation of DW_OP_bit_piece was using the wrong base for the
offset.  To accommodate a fix for that, the old operation was renamed.  Use the
new migration name.

(cherry picked from commit 100eaf889e)
2016-12-21 09:11:37 -08:00
Slava Pestov
2c6b9f71b6 AST: Change TypeAliasDecls to store an interface type as their underlying type
- TypeAliasDecl::getAliasType() is gone. Now, getDeclaredInterfaceType()
  always returns the NameAliasType.

- NameAliasTypes now always desugar to the underlying type as an
  interface type.

- The NameAliasType of a generic type alias no longer desugars to an
  UnboundGenericType; call TypeAliasDecl::getUnboundGenericType() if you
  want that.

- The "lazy mapTypeOutOfContext()" hack for deserialized TypeAliasDecls
  is gone.

- The process of constructing a synthesized TypeAliasDecl is much simpler
  now; instead of calling computeType(), setInterfaceType() and then
  setting the recursive properties in the right order, just call
  setUnderlyingType(), passing it either an interface type or a
  contextual type.

  In particular, many places weren't setting the recursive properties,
  such as the ClangImporter and deserialization. This meant that queries
  such as hasArchetype() or hasTypeParameter() would return incorrect
  results on NameAliasTypes, which caused various subtle problems.

- Finally, add some more tests for generic typealiases, most of which
  fail because they're still pretty broken.
2016-12-15 22:46:15 -08:00
Slava Pestov
a384b2a677 Don't call VarDecl::getType() on deserialized VarDecls 2016-12-15 22:46:15 -08:00
Erik Eckstein
ad8a6d2a00 Mangling: remove unnecessary size check in assert condition 2016-12-15 14:08:11 -08:00
Saleem Abdulrasool
100eaf889e IRGen: adjust DI for SVN r288683
The original implementation of DW_OP_bit_piece was using the wrong base for the
offset.  To accommodate a fix for that, the old operation was renamed.  Use the
new migration name.
2016-12-13 14:43:35 -08:00
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Erik Eckstein
d218c92f24 Mangling: fix assert in IRGenDebugInfo to support new mangling prefix 2016-12-09 09:05:16 -08:00
Slava Pestov
f3c72d8941 AST: Remove SubstitutedType 2016-12-07 17:03:07 -08:00
Michael Gottesman
59c6a64f5a [gardening] 0 => nullptr. Fixed with clang-tidy. 2016-12-06 23:14:13 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
Slava Pestov
52b91ad910 AST: Remove AssociatedTypeType 2016-12-01 14:53:31 -08:00
Slava Pestov
9caaad442b AST: Don't call hasType()/getType()/setType() on TypeDecls 2016-12-01 13:00:19 -08:00
Slava Pestov
2d83a79c2c AST: Remove TypeDecl::getDeclaredType()
A pointless use of polymorphism -- the result values are not
interchangeable in any practical sense:

- For GenericTypeParamDecls, this returned getDeclaredInterfaceType(),
  which is an interface type.

- For AssociatedTypeDecls, this returned the sugared AssociatedTypeType,
  which desugars to an archetype.

- For TypeAliasDecls, this returned TypeAliasDecl::getAliasType(),
  which desugars to a type containing archetypes.

- For NominalTypeDecls, this returned NominalTypeDecl::getDeclaredType(),
  which is the unbound generic type, a special case used for inferring
  generic arguments when they're not written in source.
2016-12-01 13:00:18 -08:00
Slava Pestov
835472b14f AST: Remove PolymorphicFunctionType 2016-11-29 03:05:35 -07:00
Slava Pestov
cb539bc766 IRGen: Remove unnecessary hasType() check 2016-11-29 03:05:29 -07:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Bob Wilson
a4e5bb6d3f Fix debug info to build with llvm r284678.
This is likely not the full solution, since it does not add the
alignment for DIVariables.
2016-10-28 12:09:57 -07:00
Jordan Rose
26be9369d5 [IRGen] Fix lifetime extension issue with StringRef.
Similar to 4960ad1.
2016-10-20 20:17:00 -07:00
Bob Wilson
123865cef5 Use llvm::DINode::DIFlags typed enum to match llvm r280700 2016-10-15 11:02:19 -07:00
Bob Wilson
3fd92f82e8 Use StringRef in more places to match recent llvm changes.
llvm r283043 and possibly other recent changes switch to use StringRef
instead of char* pointers. Update Swift to match. In some cases, this is
a clear improvement. It would be good to assess the impact on memory use,
particularly for the Filename component of source locations.

Note that the change to SILLocation::isNull fixes an apparent bug where
the location was treated as null when the filename was *not* null.
2016-10-15 11:02:07 -07:00
Adrian Prantl
f904bfa7e6 Debug Info: Use the main module as scope for top-level closures.
This works around a compiler crash when a top-level closure is inlined
into a different compile unit. The top-level-code function is only
generated once so the parent cannot be resolved in any other CU.
This change is NFC as far as the generated DWARF is concerned.

Fixes SR-2725.
2016-10-03 13:57:17 -07:00
Adrian Prantl
f42dcb9551 Revert "Debug Info: Assert that the main source file name is non-empty."
This reverts commit 3fd5afc6d0.
while investigating buildbot breakage.
rdar://problem/28457719
2016-09-23 16:54:10 -07:00
adrian-prantl
489e80546e Merge pull request #4963 from adrian-prantl/25130236
Assert that the main source file name is non-empty.
2016-09-23 15:36:45 -07:00
Adrian Prantl
3fd5afc6d0 Debug Info: Assert that the main source file name is non-empty.
The Darwin linker won't process the debug info if the source file name
is invalid so there is no point in having a fallback implemented there.

<rdar://problem/25130236>
2016-09-23 10:30:59 -07:00
Adrian Prantl
fa28b5e16b Debug Info: Insert dbg.value intrinsics immediately after the instruction
they describe.

This improves the live ranges of local variables during debugging.

<rdar://problem/26627376>
2016-09-23 10:14:56 -07:00
Adrian Prantl
c198611091 Simplify code. NFC 2016-09-22 11:30:09 -07:00
Mishal Shah
870b785219 Merge pull request #4893 from adrian-prantl/D20147
Update for LLVM API change D20147.
2016-09-20 19:16:32 -07:00
Adrian Prantl
0e9c8e9db4 Update for LLVM API change D20147. 2016-09-20 18:14:03 -07:00
Graydon Hoare
8970d44675 Add "-swift-version <n>" that sets LangOpts.EffectiveLanguageVersion.
This flag switches the "effective language version" of the compiler,
at least to any version supported (as of this change: "3" or "3.0").

At the moment nothing uses it except the language version build
configuration statements (#if swift(...)) and various other places
that report, encode, or otherwise check version numbers.

In the future, it's intended as scaffolding for backwards compatibility.

Fixes SR-2582
2016-09-20 15:11:37 -07:00
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00
Adrian Prantl
73ac8296c4 Cleanup: Don't store VarDecls in DebugTypeInfo. 2016-07-22 09:42:15 -07:00
Adrian Prantl
3b3e308ed3 IRGenDebugInfo: Pass in the VarDecl separatly when emitting variables. (NFC) 2016-07-21 16:03:49 -07:00
Mark Lacey
1c00ac4c6d Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/IRGen/IRGen.cpp
	test/DebugInfo/parent-scope.swift
2016-07-15 19:23:53 -07:00
Adrian Prantl
3ffaa762bc Don't emit line table entries for SIL functions marked as thunks.
rdar://problem/26221951
2016-07-07 19:03:28 -07:00
Adrian Prantl
361beff9c0 Emit pointer-sized structs only when -gdwarf-types is specified.
rdar://problem/25498103
2016-07-05 17:03:10 -07:00
Adrian Prantl
0847225962 Only emit DWARF types for enums when -gdwarf-types is specified. 2016-07-05 16:00:09 -07:00
Adrian Prantl
33ac7eb351 Only emit DWARF types for tuple types under -gdwarf-types. 2016-07-05 15:18:05 -07:00
Adrian Prantl
5504a188a3 Only emit DWARF types for structs when -gdwarf-types is specified. 2016-07-05 15:17:37 -07:00
Adrian Prantl
e2f05f046b Only emit DWARF types for function pointers when -gdwarf-types is specified. 2016-07-05 15:16:42 -07:00
Adrian Prantl
6b1263bf5a [Driver] Add a -gdwarf-types option and set it up as an alias for -g (NFC-ish)
Background
----------

Now that Swift AST type support in LLDB has matured, we can stop emitting DWARF
type information by default to reduce compile time and ibject file size.
A future commit will change -g to emit only AST type references.

The full set of debug options will be
-gnone
-gline-tables-only
-g                 // AST types (= everything that LLDB needs)
-gdwarf-types      // AST types + DWARF types (for legacy debuggers)
2016-07-05 12:06:23 -07:00
Michael Gottesman
3c603ab18b Merge remote-tracking branch 'origin/master' into master-next 2016-07-01 18:44:21 -07:00
Adrian Prantl
b4d3059051 Debug Info: Unique forward declarations generated for scopes and types.
This is mostly a cleanup and results slightly more efficient debug info.

rdar://problem/25965038
2016-07-01 12:03:39 -07:00
Adrian Prantl
6cb7d56500 Cache the previous result of IRGenDebugInfo::createInlinedAt().
This saves ~4 seconds of a -r --no-assertions stdlib build and lowers
the contribution of llvm::SourceMgr::getLineAndColumn() to the total
runtime from 6% to 2%.

<rdar://problem/27016577>
2016-06-29 15:57:47 -07:00
Adrian Prantl
022a8b1345 Fix a bug that prevented setting a DebugLoc if the first SILInstruction
in the function is setup code for a closure and re-enable the assertions
that caught this on the bots.

rdar://problem/26955467
2016-06-29 10:47:11 -07:00
Adrian Prantl
75e10a66cc This fixes a bot failure in the LLDB testsuite.
This removes an assertion that no longer serves its purpose and
relaxes the IRBuilder checks for debug info when generating code
inside the debugger.

When LLDB is JIT-compiling expressions, it will not generate a
SWIFT_ENTRY_POINT_FUNCTION (there will be one per expression)
but it will still generate the equivalent of top level code.

rdar://problem/26955467
2016-06-28 10:33:40 -07:00