Commit Graph

41 Commits

Author SHA1 Message Date
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Ben Barham
b134541111 [rebranch] Fix API changes from LLVM update
`insert` inserts *before* the given iterator. The `insertAfter` calls
thus need a `std::next` when converted to `insert`.

Resolves rdar://113145355.
2023-08-01 13:10:33 -07:00
Evan Wilde
8ce6ee8dd1 Updating API usages
LLVM deprecated, renamed, and removed a bunch of APIs. This patch
contains a lot of the changes needed to deal with that.

The SetVector type changed the template parameters.

APInt updated multiple names, countPopulation became popcount,
getAllOnesValue became getAllOnes, getNullValue became getZero, etc...

Clang type nullability check stopped taking a clang AST context.

The LLVM IRGen Function type stopped exposing basic block list directly,
but gained enough API surface that the translation isn't too bad.
(GenControl.cpp, LLVMMergeFunctions.cpp)

llvm::Optional had a transform function. That was being used in a couple
of places, so I've added a new implementation under STLExtras that
transforms valid optionals, otherwise it returns nullopt.
2023-07-17 10:53:42 -07:00
Erik Eckstein
e196932f67 Remove includes to llvm's CallSite.h
Fixes a master-next compile problem
2020-04-28 11:58:38 +02: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
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Michael Gottesman
9fb54bf4bf Fix for upstream ilist changes. 2015-11-11 16:07:41 -08:00
Dmitri Hrybenko
a39d5b4f42 Track LLVM ToT header file name changes
This should unbreak the buildbot.


Swift SVN r14642
2014-03-04 13:11:01 +00:00
Dmitri Hrybenko
d98408425e Remove unused OwningPtr.h includes
Swift is C++11 and uses std::unique_ptr.


Swift SVN r7731
2013-08-29 20:09:49 +00:00
Chris Lattner
43bd01689b Tidy up IGF a bit, changing some ivars to be arguments to emitProlog, removing
dead methods, and moving emitInvoke to CallInvocation.

An interesting semantic change of this is that we're now calling getResultType
on the function type every time IGF is constructed, which exposed some latent
bugs.  Specifically two places in GenObjC are trying to extra curry level two 
from function types like "SomeObject -> (value : SomeObject) -> ()" which
doesn't make sense.  I switched them to get curry level 1, but this definitely
needs some close review.



Swift SVN r4852
2013-04-21 17:00:33 +00:00
Chris Lattner
5664431c9a remove Cleanup.h and references to the Cleanup class, along with
some dead logic in IRGenFunction.



Swift SVN r4847
2013-04-21 06:36:22 +00:00
Chris Lattner
6e50329da3 remove the cleanups list from CallEmission and ManagedValue, along with the machinery for adding Cleanups.
Swift SVN r4840
2013-04-21 05:16:00 +00:00
Chris Lattner
e3d6a489af remove the Cleanup subclasses.
Swift SVN r4839
2013-04-21 05:06:52 +00:00
Chris Lattner
ef79e16137 remove CleanupControl and supporting logic.
Swift SVN r4838
2013-04-21 04:41:08 +00:00
Chris Lattner
19baff9169 remove some code now that Cleanups are never "used".
Swift SVN r4837
2013-04-21 04:33:00 +00:00
Chris Lattner
1c3dc82449 Now that Joe moved ObjC cleanup emission up to SILGen, start zapping cleanups.
First step is some of the emission deatils.


Swift SVN r4836
2013-04-21 04:18:54 +00:00
Chris Lattner
1abf1d0ebc remove RValueEmitter and some implementation logic for it, as well as
FullExpr.  Scope is kept alive by one dangling thread, rdar://13681467


Swift SVN r4798
2013-04-18 05:24:50 +00:00
Chris Lattner
447ceab4e1 remove JumpDest class and JumpDest.h, it is now a SILGen concept.
Swift SVN r4783
2013-04-17 22:52:38 +00:00
Chris Lattner
0701489691 remove Condition.
Swift SVN r4768
2013-04-17 05:01:03 +00:00
Chris Lattner
47dbc4051c update for mainline LLVM header file moves.
Swift SVN r3634
2013-01-02 14:38:42 +00:00
Doug Gregor
b4ca0f1fef Rename llvm::AttrListPtr -> llvm::AttributeSet to sync with LLVM mainline.
Swift SVN r3430
2012-12-10 23:21:19 +00:00
Chris Lattner
b9279c7239 Remove some dead code from emitCondition: unlike clang, it is impossible
for Swift's IRGen (or CFGGen) to get a constant folded condition when 
emitting a branch: this is because all constants are obfuscated behind
function calls.  This is verified to never trigger on the testsuite.


Swift SVN r2940
2012-10-05 01:01:54 +00:00
Chris Lattner
2a8a6b04d8 microoptimize IRGen's emitCondition a bit: instead of emitting a xor to
invert a condition, just output an inverted conditional branch (swap the 
true/false dests).


Swift SVN r2778
2012-08-26 17:20:23 +00:00
Eli Friedman
2b163c2afa Get rid of a broken optimization in the cleanup generation code. Fixes <rdar://problem/11720621>.
Swift SVN r2225
2012-06-22 01:55:07 +00:00
John McCall
5064f39024 Refactor towards the goal of using different CCs when
passing this pointers or data arguments.

Swift SVN r2149
2012-06-05 04:50:58 +00:00
Eli Friedman
26bebcfd61 IRGen for break/continue.
Swift SVN r2089
2012-05-31 02:45:18 +00:00
Eli Friedman
ed63824918 Fix a minor logic issue with swift::irgen::IRBuilder::insertBlockAnywhere. Fixes the rest of <rdar://problem/11425939>.
Swift SVN r1800
2012-05-10 21:52:04 +00:00
Eli Friedman
daa531d0e4 Make sure we correctly restrict the scope of the FullExpr in IRGenFunction::emitCondition to the actual expression emission, so the branch comes after any cleanups. Found while experimenting with bools.
Swift SVN r1695
2012-04-30 23:17:48 +00:00
Eli Friedman
e6865b3b23 Move the implementation of Char printing into swift.swift, and get rid of the old printChar. Fix a bug in IRGen I ran into while working on that.
Swift SVN r1620
2012-04-25 03:39:48 +00:00
Doug Gregor
6d5f67c790 Implement IR generation for the 'foreach' loop and convert our fractal
examples over to using the 'foreach' loop. Addresses
<rdar://problem/11259997>.


Swift SVN r1606
2012-04-24 21:37:55 +00:00
John McCall
af2399cd30 Significantly step up the validity asserting around the cleanup stack.
With that in place, fix ~Scope so that it uses the same code for
popping as Scope::pop() does, i.e. the code that modifies InnermostScope
before popping out.

This properly fixes the issue Doug patched over in r1387.

Swift SVN r1393
2012-04-11 18:00:48 +00:00
Doug Gregor
4c97c19a4f "Fix" a use-after-free when dealing with dead cleanups, where we try
to look at the first element of an empty stack. The use-after-free
triggers occasionally for me during normal testing (about 1 failure
per 5 trials), but triggers on IRgen/func.swift regularly when using
guardmalloc. 

John, please take a look; this feels more like treating a symptom than
addressing the cause.




Swift SVN r1389
2012-04-11 16:09:45 +00:00
John McCall
5ad3782b01 Rework the IR-generation of initialization and teach the
compiler to enter properly-scoped cleanups to destroy local
variables.

Swift SVN r1385
2012-04-11 03:00:08 +00:00
John McCall
44677bc117 Fixes and embellishments, and actually make IR-gen properly
emit release cleanups.  And they work!

Swift SVN r1334
2012-04-05 20:36:20 +00:00
John McCall
82ca0e7720 Basic infrastructure for cleanup emission and branches. Totally untested!
Swift SVN r1332
2012-04-05 20:36:19 +00:00
John McCall
d76aaea2b6 Remove the outdated RValue concept; no functionality change.
Swift SVN r1216
2012-03-16 09:26:39 +00:00
John McCall
885783ab76 Start switching things over to using explosions.
Swift SVN r1014
2012-01-12 07:05:49 +00:00
John McCall
3b5a5509a7 Revisit the Condition logic, which turns out to be subtly wrong in
an extremely simple test case that happens to come up in swift.swift.



Swift SVN r971
2011-12-22 09:05:29 +00:00
John McCall
2cd676bf99 IR generation for 'if' statements. Adjust the standard library
to use global functions for the relational operators, just to get
prettier IR.



Swift SVN r679
2011-09-02 19:02:36 +00:00
John McCall
156c029718 Implement return statements; add some related infrastructure,
including a new file for control flow code.



Swift SVN r617
2011-08-25 09:09:58 +00:00