Commit Graph

121 Commits

Author SHA1 Message Date
Saleem Abdulrasool
e3e4d1ba0b tools: remove unnecessary LLVM_COMPONENT linkage
Remove the unncessary link against the DebugInfoCodeView component.  THe tools
seem to build without the dependency.  The dependency issue in the linkage
seems to have been resolved.
2018-11-14 18:29:19 -08:00
Adrian Prantl
7e6713ed76 Hide irreleveant command line options of lldb-moduleimport-test 2018-11-14 12:18:43 -08:00
Adrian Prantl
97cbd3b1cf Deserialize Swift compatibility version in CompilerInvocation::loadFromSerializedAST()
LLDB needs the -swift-version because the -D__swift__ macro affects
how Clang modules are built. This currently has the really odd effect
that when debugging a Swift program that is not using the very latest
Swift version, the first "po" takes several seconds, because the
module cache needs to be rebuilt.

rdar://problem/40241256
2018-08-28 13:04:27 -07:00
Doug Gregor
7a6ad36c7f [lldb-moduleimport-test] Add support for -resource-dir option. 2018-06-26 13:48:13 -07:00
Fred Riss
ec1ca50d8a Change the component of lldb-moduleimport-test so that it gets installed in toolchians
rdar://problem/39112397
2018-06-17 18:46:55 -07:00
Davide Italiano
73d01b0fed [lldb-moduleimport-test] Improve error detection. 2018-05-14 12:16:12 -07:00
Davide Italiano
5c99c35d24 [lldb-moduleimport-test] Validate input to prevent crashes. 2018-04-17 11:22:15 -07:00
Davide Italiano
eeac130ea3 [lldb-moduleimport-test] Get informations from the module.
This now mirrors what lldb does, and allows us to test this
codepath outside of the debugger.

<rdar://problem/38867076>
2018-04-02 13:05:34 -07:00
Davide Italiano
1c6d19a33c [lldb-moduleimport-test] Remove unused options. NFCI.
<rdar://problem/38867076>
2018-04-02 11:50:12 -07:00
Davide Italiano
23d551e655 [lldb-moduleimport-test] Refactor the whole tool.
This is in preparation for fetching informations directly from
the module instead of specifying them on the cmdline. It will
serve us better as it will mimick more accurately the way lldb
is behaving.

This refactoring moves the validation of the modules earlier
so that we can use the validation info to create the CompileUnit.

<rdar://problem/38867076>
2018-03-30 18:04:02 -07:00
Davide Italiano
5e463b1bc0 [lldb-moduleimport-test] Pass a target triple as a stopgap solution.
We're going to infer all these informations from the module, but
that's a large refactoring task which I'm going to do next.
In the meanwhile, this should allow Adrian's work to be unblocked.

<rdar://problem/38720742>
2018-03-23 13:13:26 -07:00
Davide Italiano
9dbd966e73 [lldb-moduleimport] Add the logic for testing getDeclBySymbolName().
Adrian already found and reported a bug, which I'm going to fix
in a later commit. Eventually this will go away, but in the meanwhile,
we should add test for this codepath.

<rdar://problem/38720742>
2018-03-22 10:47:24 -07:00
Davide Italiano
8cd5e8026b [lldb-moduleimport-test] Address Jordan's post commit review comments. 2018-03-22 10:07:10 -07:00
Davide Italiano
92c4c492a2 [lldb-moduleimport-test] Refactor dump of types from mangled name.
In preparation for adding dump decl from mangled name.
2018-03-22 09:03:08 -07:00
Davide Italiano
9ccdbc1cfa [lldb-moduleimport-test] Introduce a --verbose flag.
<rdar://problem/38323564>
2018-03-15 14:49:48 -07:00
Davide Italiano
06ae7eeff5 [lldb-moduleimport-test] Add a way to test getTypeFromMangledSymbolName.
The only way we had to test this path was through swift-ide-test,
which takes an input a source file, instead of a serialized module.

This is not the scenario that lldb tests, hence this patch.

<rdar://problem/38323564>
2018-03-15 14:39:44 -07:00
Jordan Rose
3cd9f166bc Don't spend time initializing LLVM when running the driver (#14896)
Tiny start-up time optimization noticed while looking at how we do
PrettyStackTraceProgram. Also add PrettyStackTraceProgram to a few
more of our testing tools, via the new PROGRAM_START macro.
2018-02-28 19:56:19 -08:00
Argyrios Kyrtzidis
ca906d1e99 Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
This has the effect of propagating the search path to the clang importer as '-iframework'.
It doesn't affect whether a swift module is treated as system or not, this can be done as follow-up enhancement.
2017-02-14 16:13:25 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00
Michael Gottesman
7e2568dcf0 [cmake-components] Introduce a new API add_swift_host_tool for creating/initializing swift tool targets.
The main action here is to sink the creation of the installation rule for all of
the swift host tools into this API. In a latter commit, I will use this API to
create include and build rules for add_swift_host_tool.
2016-08-28 14:12:14 -07:00
Saleem Abdulrasool
2d50ed9ca3 [upstream-update] Link LLVMDebugInfoCodeView into 6 executable tools. (#4489)
All of these cases seem to need the symbols from LLVM's new CodeView library to
link.

The specific executables are:

1. Swift Driver.
2. SIL Extract.
3. SIL Opt.
4. Swift IDE Test.
5. Swift LLVM Opt.
6. LLDB Module Import Test
2016-08-26 02:20:45 -04:00
Michael Gottesman
7803a440f6 Use COMPONENT_DEPENDS instead of LINK_LIBRARIES when linking against llvm libraries. 2016-05-20 21:30:27 -07:00
Mark Lacey
859b779f15 Speculatively try a different fix for LLVMCoverage linker issues.
We're still hitting undefined symbols on Linux. Hopefully this clears
those up as well.
2016-05-06 17:02:22 -07:00
Mark Lacey
590cd6476e Link LLVMCoverage into tools that pull in references to it. 2016-05-03 21:41:54 -07:00
Mark Lacey
b044c4d74f Fixes for uses of new Expected<T> type in LLVM. 2016-05-03 17:02:54 -07:00
Mark Lacey
182b6dfb18 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	tools/driver/CMakeLists.txt
	tools/swift-reflection-dump/swift-reflection-dump.cpp
2016-05-03 14:23:20 -07:00
Jordan Rose
8f820dea2b [serialization] Diagnose loading modules from older Swifts.
...with a better message than the generic "older version of the
compiler" one, when we know it's actually a different version of
Swift proper.

This still uses the same internal module version numbers to check
if the module is compatible; the presentation of language versions
is a diagnostic thing only.

Speaking of module version numbers, this deliberately does NOT
increment VERSION_MINOR; it's implemented in a backwards-compatible
way.

This will only work going forwards, of course; all existing modules
don't have a short version string, and I don't feel comfortable
assuming all older modules we might encounter are "Swift 2.2".

rdar://problem/25680392
2016-04-29 16:25:33 -07:00
Michael Gottesman
140bcbc355 [upstream-update] Link LLVMDebugInfoCodeView into 6 executable tools.
All of these cases seem to need the symbols from LLVM's new CodeView library to
link.

The specific executables are:

1. Swift Driver.
2. SIL Extract.
3. SIL Opt.
4. Swift IDE Test.
5. Swift LLVM Opt.
6. LLDB Module Import Test
2016-03-26 02:01:19 -07:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Michael Gottesman
6f2a6271f5 Update lldb-moduleimport-test for changed LLVM API.
Swift SVN r31819
2015-09-09 04:37:51 +00:00
Michael Gottesman
e864f02690 In all executables make sure to completely initialize LLVM.
I also added a macro called INITIALIZE_LLVM(argc, argv) which moves this logic
into one place and should be used at the beginning of *all* binaries. It
initializes an LLVM shutdown object, sets up the pretty stack trace, and then
initializes all of the parts of LLVM. This will make it easy to update this in
the future.

The reason why a macro was required was because of llvm_shutdown_obj, an RAII
object that cleans up LLVM. It has to be at the function level scope of the main
function.

Swift SVN r31815
2015-09-09 04:37:38 +00:00
Adrian Prantl
0de0d43773 Introduce a -modulewrap driver action that wraps a (merged) .swiftmodule
inside a swift ast section in an object file so it can be passed to the
linker. The driver automatically wraps merged swiftmodules iff the target
is ELF.

rdar://problem/22407666

Swift SVN r31641
2015-09-02 21:56:25 +00:00
Adrian Prantl
e273ae1e9e Generalize lldb-moduleimport-test to accept object format other than Mach-O
Swift SVN r31591
2015-09-01 00:05:29 +00:00
Dmitri Hrybenko
a6a97e6543 Unbreak the build after upstream CMake changes
Swift SVN r26088
2015-03-13 04:20:04 +00:00
Adrian Prantl
9d14113bf3 Adapt for Mach-O clang module container format transition.
NOTE: This may require deleting the Module Cache that build-script
       creates in the swift build dir.

rdar://problem/19104245

Swift SVN r26021
2015-03-12 02:00:56 +00:00
Adrian Prantl
83fce2670e Revert "Adapt for Mach-O clang module container format transition."
This reverts commit 25995 (this commit was missing a few LLVM libraries).

Swift SVN r26020
2015-03-12 02:00:55 +00:00
Adrian Prantl
ae3d758fa8 Adapt for Mach-O clang module container format transition.
NOTE: This may require deleting the Module Cache that build-script
       creates in the swift build dir.

Swift SVN r25995
2015-03-11 22:55:37 +00:00
Jordan Rose
dbd3b60f6b [Serialization] Move (Module)Status and validateSerializedAST into a namespace.
Also into a separate file.

Before (swift/Serialization/SerializedModuleLoader.h):
  ModuleStatus
  SerializedModuleLoader::ValidationInfo
  SerializedModuleLoader::ExtendedValidationInfo
  SerializedModuleLoader::isSerializedAST
  SerializedModuleLoader::validateSerializedAST

After (swift/Serialization/Validation.h):
  serialization::Status
  serialization::ValidationInfo
  serialization::ExtendedValidationInfo
  serialization::isSerializedAST
  serialization::validateSerializedAST

No functionality change, just a lot of renaming and a bit of reorganizing.

Swift SVN r25226
2015-02-12 05:32:25 +00:00
Jordan Rose
de8a05b293 [Serialization] Serialize the SDK path and -Xcc arguments for an app.
...so that the debugger has the best possible chance of being able to load
the app properly.

We don't do this for frameworks today because we don't want to leak this
information into the public module; once we have a distinction between
"the module that ships with the framework" and "the module that goes into
the debug info" we can do this for frameworks as well.

Part of rdar://problem/17670778

Swift SVN r25204
2015-02-11 23:07:48 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00
Adrian Prantl
9cbf991e80 Update lldb-moduleimport-test to use llvm::object::ObjectFile.
Fixes: rdar://16244944 lldb-moduleimport-test does not support 32-bit executables

Swift SVN r23960
2014-12-16 20:23:58 +00:00
Dmitri Hrybenko
1eea220932 Use one module cache directory for all the lit tests to speed them up
Doing so is safe even though we have mock SDK.  The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).

This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.

This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple.  I
fixed the tests where I noticed this issue.

rdar://problem/19125022

Swift SVN r23683
2014-12-04 11:21:48 +00:00
Dmitri Hrybenko
1347b446c9 Stop using the MODULES_SDK variable in -D flags for the C++ compiler
Swift SVN r23097
2014-11-04 05:44:12 +00:00
Jordan Rose
79224874eb [Driver] Switch debug info to use ld's new -add_ast_path option.
Rather than embed AST info directly in binaries, we now include a special
symbol table entry that points to the serialized AST as a separate file.
This requires a very recent version of ld.

We still want to support the __SWIFT,__ast section in a binary because
that's how it's modeled in dSYM, so manually test both modes in
ASTSection_linker.swift.

Part of <rdar://problem/15796201>.

Swift SVN r20421
2014-07-23 18:04:10 +00:00
Doug Gregor
3d3ff6811a Add a pile of missing #includes exposed by pruning includes in top-of-tree LLVM.
Swift SVN r17157
2014-05-01 14:26:34 +00:00
Jordan Rose
d52edd8675 Add -I and -F support to lldb-moduleimport-test.
Swift SVN r15751
2014-04-01 21:47:36 +00:00
Jordan Rose
49ec7c1ea1 Use SWIFT_MODULE_CACHE_PATH for all tools.
Now that the standard library depends on Clang headers, every single tool
needs to specifically avoid using the default module cache when
SWIFT_MODULE_CACHE_PATH is set.

<rdar://problem/16294222>

Swift SVN r14937
2014-03-12 00:27:24 +00:00