Commit Graph

292 Commits

Author SHA1 Message Date
Chris Lattner
ab0b5e8b5c - Add integer <-> integer conversion functions for Int32 and Int64.
- add a top level abort() method.
- add an assert() implementation
- Add a "Char" typedef for Int32, switch printChar to use it.
- Add a method to String to extract an element out of it (currently named
  getElement, to be named [] eventually)
- Implement String.replPrint in terms of string operations.


Swift SVN r1545
2012-04-21 21:36:28 +00:00
Chris Lattner
ea84f6ebd5 add a new UnsafePointerInt8 type, use it to implement String.size in swift instead of in C++.
Swift SVN r1544
2012-04-21 21:16:46 +00:00
Chris Lattner
c7922be1e5 on entering the repl, print a welcome message to stderr when it isatty().
Also, have the repl auto-indent the continuation prompt according to the # braces we're in.



Swift SVN r1542
2012-04-21 21:03:28 +00:00
Eli Friedman
a2c6150c13 Error recovery for the REPL. Seems to be working reasonably well. <rdar://problem/11269380>.
Swift SVN r1523
2012-04-20 01:14:39 +00:00
Eli Friedman
be602fcd05 Get rid of the implicit BraceStmt for the TranslationUnit; instead, have the TranslationUnit directly store a list of decls.
Swift SVN r1521
2012-04-20 00:17:13 +00:00
Eli Friedman
d6a92095f9 Make the REPL handle unbalanced braces, so multi-line function definitions work. <rdar://problem/11269371>.
Swift SVN r1514
2012-04-19 22:54:24 +00:00
Eli Friedman
4848072285 Add a hack which makes us run the initializers for "true" and "false" in script mode and REPL mode. <rdar://problem/11256886>
Swift SVN r1494
2012-04-19 19:04:28 +00:00
Eli Friedman
acc17d69aa Initial implementation of the "print" part of the REPL.
Swift SVN r1484
2012-04-19 01:13:37 +00:00
Eli Friedman
dd17ba6324 A few minor bugfixes for REPL.
Swift SVN r1477
2012-04-18 21:49:27 +00:00
Howard Hinnant
77bcc0f9b6 Primative + operator for String
Swift SVN r1473
2012-04-18 17:24:26 +00:00
Ted Kremenek
731e3c49b1 Update CMake build to link in libedit, and to not link in mcjit.
Swift SVN r1459
2012-04-18 07:09:21 +00:00
Chris Lattner
f136b16cb3 eliminate gratuitous lambda that crashes Xcode 4.3 clang.
Swift SVN r1456
2012-04-18 03:53:46 +00:00
Eli Friedman
cf10f0096e Make the REPL allow mutually recursive functions spread across multiple lines, like we do in script mode.
Swift SVN r1453
2012-04-18 01:20:38 +00:00
Eli Friedman
dc213bca76 Implement basic REPL under swift -repl. Known demo-blockers: need error recovery, need better brace/paren handling, need to implement the "print" part of REPL.
Swift SVN r1452
2012-04-18 00:52:11 +00:00
Howard Hinnant
8528c79819 Rename types to first-letter-upper-case try #2. The test suite is now passing for me.
Swift SVN r1447
2012-04-17 01:27:23 +00:00
Doug Gregor
3243108518 Introduce an new expression, MemberRefExpr, that refers to a
member of an object. This expression kind is currently used to refer
to properties within an object, but will eventually be extended to
refer to fields as well (once we make StructDecl real).


Swift SVN r1445
2012-04-17 00:35:06 +00:00
Eli Friedman
37de44a35d Implement changes to parsing/sema/etc so that we can implement a REPL and the main module parses the same way as a REPL.
Next step: implement an actual REPL.



Swift SVN r1441
2012-04-16 23:52:01 +00:00
Eli Friedman
6348a5a372 A bit of minor hacking to get print("hello") working.
Swift SVN r1355
2012-04-10 02:06:33 +00:00
Doug Gregor
2822ea954c Mostly unbreak CMake build. However, we still won't properly find libswift_abi.dylib.
Swift SVN r1324
2012-04-04 23:57:35 +00:00
Eli Friedman
22b7cd05f5 Some minor incremental improvements for module import. Allow explicitly importing Builtin, and implicitly import swift for any module which doesn't explicitly import Builtin or swift. Fixes <rdar://problem/11185519>.
Swift SVN r1323
2012-04-04 21:56:40 +00:00
Eli Friedman
15bc5df608 Rename Interpret* to immediate mode, which should be a bit more intuitive.
Swift SVN r1322
2012-04-04 20:47:21 +00:00
Eli Friedman
f5e405cbac Cosmetic fixes.
Swift SVN r1320
2012-04-04 01:49:44 +00:00
Eli Friedman
d295d02c42 Initial interpreter implementation. The included pieces are enough to get the included simple.swift running in swift -i mode. <rdar://problem/10962290>, part 1.
Swift SVN r1319
2012-04-04 01:34:42 +00:00
Chris Lattner
d14ddfc8bb Unbreak the makefile build. Swift now builds with this patch to llvm/Makfile.rules:
+++ /Users/sabre/llvm/Makefile.rules	(working copy)
@@ -299,6 +299,9 @@
   endif
 endif
 
+CXX.Flags +=  -stdlib=libc++
+LD.Flags +=  -stdlib=libc++
+
 ifeq ($(ENABLE_PROFILING),1)
   BuildMode := $(BuildMode)+Profile
   CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g

I asked for a configure flag to get the same.



Swift SVN r865
2011-11-10 20:57:08 +00:00
Chris Lattner
a4244984b3 fix "newline @ end of file" warning.
Swift SVN r864
2011-11-10 20:33:44 +00:00
Doug Gregor
3f5c6d7c44 Fix typo in comment regarding inclusive range.
Swift SVN r858
2011-11-10 15:48:13 +00:00
Doug Gregor
d4d7ac1e6b SMRange is inclusive of the end location, so adjust our end location
accordingly when printing diagnostics.


Swift SVN r854
2011-11-09 22:07:29 +00:00
Doug Gregor
b1c98e1731 Introduce Lexer::getLocForEndOfToken() to adjust source locations to
the end of the current token, and use it for proper translation from
SourceRange to SMRange when printing diagnostics.



Swift SVN r853
2011-11-09 22:03:30 +00:00
Doug Gregor
725298a2da Introduce a DiagnosticConsumer abstract interface that is used to
actually render emitted diagnostics. This is both a useful
generalization (we expect to have a number of other
DiagnosticConsumers down the road, as Clang does) and is also
important now to avoid a layering violation when adjusting the source
location at the end of a SourceRange to the end of the token.

 


Swift SVN r850
2011-11-09 18:59:39 +00:00
Chris Lattner
30b6007b61 move the diagnostics stuff from Basic -> AST to fix layering.
Swift SVN r781
2011-10-22 00:41:24 +00:00
Doug Gregor
2d6ff76ed5 Fix the make-based build system
Swift SVN r737
2011-09-27 00:05:15 +00:00
John McCall
15922d77b4 Go ahead and support outputting to .ll, .bc, .s, and .o.
Swift SVN r546
2011-08-13 22:01:51 +00:00
Chris Lattner
7f71bc5e8a it doesn't help much, but try to improve link times.
Swift SVN r543
2011-08-13 21:08:16 +00:00
John McCall
bca041368d Structure for IR generation.
Swift SVN r537
2011-08-13 05:37:06 +00:00
Doug Gregor
86ab76d624 Introduce a CMake build system for Swift.
This CMake-based build system is based on the one in Clang, simplified
and tweaked slightly to better support building a smaller Xcode
project that links against an existing LLVM (rather than importing all
of LLVM into this project).



Swift SVN r403
2011-07-14 17:58:33 +00:00
Chris Lattner
ddb760bf2b Remove the concept of an ASTConsumer, add a new TranslationUnitDecl.
Swift SVN r255
2011-03-04 22:08:34 +00:00
Chris Lattner
547b2a8003 implement vardecl dumping and Casting.h support for decls.
Swift SVN r45
2010-07-19 06:39:56 +00:00
Chris Lattner
43f414c81f stub out a new ast dumper consumer.
Swift SVN r44
2010-07-19 06:11:35 +00:00
Chris Lattner
d3756f2627 Sketch out the new AST library, lets start with expressions.
Swift SVN r25
2010-07-19 00:05:11 +00:00
Chris Lattner
c02e462b58 wire sema up to the Parser.
Swift SVN r22
2010-07-18 23:00:47 +00:00
Chris Lattner
db8e1301ff Start setting up the lexer object.
Swift SVN r7
2010-07-18 01:14:09 +00:00
Chris Lattner
afc81c1855 initial checkin, nothing much to see here.
Swift SVN r4
2010-07-18 00:04:11 +00:00