Tag build swift-DEVELOPMENT-SNAPSHOT-2017-09-27-a
[Expression Parser] Inhibit global lookups for symbols in the IR dynamic checks

The IR dynamic checks are self-contained functions whose job is to

- verify that pointers referenced in an expression are valid at runtime; and
- verify that selectors sent to Objective-C objects by an expression are
  actually supported by that object.

These dynamic checks forward-declare all the functions they use and should not
require any external debug information. The way they ensure this is by marking
all the names they use with a dollar sign ($). The expression parser recognizes
such symbols and perform no lookups for them.

This patch fixes three issues surrounding the use of the dollar sign:

- to fix a MIPS issue, the name of the pointer checker was changed from
  starting with $ to starting with _$, but this was not properly ignored; and
- the Objective-C object checker used a temporary variable that did not start
  with $.
- the Objective-C object checker used an externally-defined struct (struct
  objc_selector) but didn't need to.

The patch also implements some cleanup in the area:

- it reformats the string containing the Objective-C object checker,
  which was mangled horribly when the code was transformed to a uniform width
  of 80 columns, and
- it factors out the logic for ignoring global $-symbols into common code
  shared between ClangASTSource and ClangExpressionDeclMap.

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


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@314225 91177308-0d34-0410-b5e6-96231b3b80d8
4 files changed
tree: 3fdefa2ec2c23f50ac87dae9cbea1c222ecc5ba7
  1. cmake/
  2. docs/
  3. examples/
  4. include/
  5. lit/
  6. lldb.xcodeproj/
  7. lldb.xcworkspace/
  8. packages/
  9. resources/
  10. scripts/
  11. source/
  12. test/
  13. third_party/
  14. tools/
  15. unittests/
  16. utils/
  17. www/
  18. .arcconfig
  19. .clang-format
  20. .gitignore
  21. CMakeLists.txt
  22. CODE_OWNERS.txt
  23. CONTRIBUTING.md
  24. EXPORT.APPLE
  25. INSTALL.txt
  26. LICENSE.TXT
  27. notifications.json
  28. README.md
  29. use_lldb_suite_root.py
README.md

Swift Debugger and REPL

Status
macOSBuild Status
Ubuntu 14.04Build Status
Ubuntu 15.10Build Status

Welcome to the Swift Debugger and REPL!

Swift is a new, high performance systems programming language. It has a clean and modern syntax, offers seamless access to existing C and Objective-C code and frameworks, and is memory safe (by default).

This repository covers the Swift Debugger and REPL support, built on top of the LLDB Debugger.

Building LLDB for Swift

To build LLDB for Swift, you must have the following prerequisites installed on your development system:

  • OS X Requirements

  • Linux x86_64 (Ubuntu 14.04, Ubuntu 15.10)

    • Clang 3.5 or later.

    • Cmake (version 2.8.12.2 or later)

    • Python 2.7

Once the pre-requisites are satisfied, follow these steps from a bash-like shell:

mkdir myswift
cd myswift
git clone https://github.com/apple/swift-lldb.git lldb
lldb/scripts/build-swift-cmake.py --test

The lldb build script will clone additional repositories for required dependencies if they are not already present. An optional --update argument can be used to refresh these required repositories. Products of the build process will be placed in the build/ directory under the root source directory.

Inter-project Directory Layout

LLDB for Swift introduces new dependencies that do not exist with core LLDB. In particular, LLDB for Swift makes extensive use of the Swift codebase.

Each one of the directories listed below underneath the overall source_root are backed by a Swift.org repository:

.
+-- clang/
|
+-- cmark/
|
+-- lldb/
|
+-- llvm/
|
+-- ninja/
|
+-- swift/

Details on the contents:

  • clang

    Contains the stable version of Clang used by Swift.

  • cmark

    Contains markdown support used by Swift.

  • lldb

    Contains the LLDB source that includes Swift support. All of LLDB for Swift is contained in this repository. Core LLDB contents are merged into this repository. No other copy of LLDB source code is required.

  • llvm

    Contains the stable version of LLVM used by Swift.

  • ninja

    Contains the Ninja build system.

  • swift

    Contains the Swift Language and Swift Runtime code.

Note: If you don‘t use the build-swift-cmake.py script to do the initial clone of the related project repositories, you’ll need to manually clone them to the names above:

Contribution Subtleties

The swift-lldb project enhances the core LLDB project developed under the LLVM Project. Swift support in the debugger is added via the existing source-level plugin infrastructure, isolated to files that are newly introduced in the lldb-swift repository.

Files that come from the core LLDB project can be readily identified by their use of the LLVM comment header. As no local changes should be made to any of these files, follow the standard guidance for upstream changes.