Commit Graph

55679 Commits

Author SHA1 Message Date
Chris Lattner 6acb4d6f7e When a crash signal is delivered do two things: remove all of our
signal handlers to prevent reentrance on unrelated things (a sigabort
where the handle bus errors) also, clear the signal mask so that the
signal doesn't infinitely reissue.  This fixes rdar://6654827 -
Crash causes clang to loop

llvm-svn: 66330
2009-03-07 08:15:47 +00:00
Eli Friedman 7c22c9dcdd Don't discard increment/decrement on function pointers. It's kind of
difficult to come up with a testcase because the code generation for this
construct is broken.

llvm-svn: 66325
2009-03-07 07:01:10 +00:00
Nate Begeman 52b696c7ad Finish cross-process JIT work, and clean up previous work.
1. When the JIT is asked to remove a function, updating it's
   mapping to 0, we invalidate any function stubs used only 
   by that function.  Now, also invalidate the JIT's mapping
   from the GV the stub pointed to, to the address of the GV.

2. When dlsym stubs for cross-process JIT are enabled, do not
   abort just because a named function cannot be found in the
   JIT's process.

3. Fix various assumptions about when it is ok to use the lazy
   resolver when non-lazy JITing is enabled.

llvm-svn: 66324
2009-03-07 06:41:19 +00:00
Mike Stump 1ab20cae19 Remove last FIXME for block literal codegen that I know about and turn
on all the new code by default.  There is still plenty of testing to
do and issues I'm sure need resolving.  Let me know if you find
anything.

llvm-svn: 66323
2009-03-07 06:16:52 +00:00
Mike Stump 90d8daf592 Remove some FIXMEs for block literals that should be close to working.
llvm-svn: 66322
2009-03-07 06:04:31 +00:00
Eli Friedman a374b68b5a Back out the patch in r66302, and re-fix it properly. We assume for
performance that the type of the returned llvm::Value for an expression 
matches the converted type of the clang::Expr; mismatches will cause all
sorts of errors and silent miscompilations.

llvm-svn: 66321
2009-03-07 03:57:15 +00:00
Mike Stump 6f7d9f8774 codegen support for dispose helpers for block literals.
llvm-svn: 66320
2009-03-07 02:53:18 +00:00
Mike Stump aeb0ffd56c Codegen support for copy helpers for block literals.
llvm-svn: 66319
2009-03-07 02:35:30 +00:00
Dan Gohman ff659b5b86 Arithmetic instructions don't set EFLAGS bits OF and CF bits
the same say the "test" instruction does in overflow cases,
so eliminating the test is only safe when those bits aren't
needed, as is the case for COND_E and COND_NE, or if it
can be proven that no overflow will occur. For now, just
restrict the optimization to COND_E and COND_NE and don't
do any overflow analysis.

llvm-svn: 66318
2009-03-07 01:58:32 +00:00
Ted Kremenek 22988cf493 Revert my last couple patches until I can get them to not make the tests fail.
llvm-svn: 66317
2009-03-07 01:47:10 +00:00
Daniel Dunbar fc1b80d481 Cleanup/comment IdentifierInfo::get.
- Shaves off a few instructions on x86_64.

One notable change: this intentionally stops setting the II->Entry
field of IdentifierInfo's retrieved by the ExternalLookup method. This
is to maintain the invariant that .getName() has a constant value for
any given IdentifierInfo. IRgen currently relies on this; which is
quite questionable but will be cleaned up in time.

Apologies for the lack of a test case; there really isn't a good way
to make one. As IRgen will eventually be fixed to not rely on this, we
can survive without one.

llvm-svn: 66316
2009-03-07 01:42:16 +00:00
Evan Cheng 9153f08c74 If ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes sure the JIT work correctly.
llvm-svn: 66315
2009-03-07 01:40:17 +00:00
Ted Kremenek a44b4f987c Teach Diagnostic about Selector.
llvm-svn: 66314
2009-03-07 01:36:13 +00:00
Ted Kremenek 0666a6ce70 Selector: (changes made after discussing this more with Steve Naroff)
- Make Selector::getAsIdentifierInfo() private.  Using IdentifierInfo* in
  Selector is an implementation detail that clients shouldn't think about.
- Modify diagnostic emission in Sema::ProcessPropertyDecl to not use
  Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is
  null) and instead use Selector::getAsString().
- Tidy up Selector::getAsString() implementation.

llvm-svn: 66313
2009-03-07 01:22:02 +00:00
Ted Kremenek b6b7ce4b50 Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece and
PathDiagnosticControlFlowPiece to distinguish (in the class hierarchy) between
events and control-flow diagnostic pieces. Clients must now use these directly
when constructing PathDiagnosticPieces.

llvm-svn: 66310
2009-03-06 23:58:11 +00:00
Douglas Gregor 65530cb62e Tweak warning text from the last commit
llvm-svn: 66309
2009-03-06 23:46:13 +00:00
Douglas Gregor 3e06dbf48c Downgrade complaints about the use of variable-sized types within a
struct to an extension warning to match the behavior of GNU C, which
addresses the Sema part of PR3671.

llvm-svn: 66308
2009-03-06 23:41:27 +00:00
Ted Kremenek 5f080b43fa Handle null IdentifierInfo* in Selector::getAsString().
llvm-svn: 66307
2009-03-06 23:36:28 +00:00
Ted Kremenek bbaea048b8 Remove false assertion.
llvm-svn: 66306
2009-03-06 23:31:51 +00:00
Douglas Gregor d9f92e2a06 Clean up some error messages with anonymous structs/unions and member declaration parsing. Fixes PR3680
llvm-svn: 66305
2009-03-06 23:28:18 +00:00
Ted Kremenek f77f65ef83 Re-order contents of file. No functionality change.
llvm-svn: 66304
2009-03-06 23:21:37 +00:00
Douglas Gregor 2e7cba6208 Use the 'declaration does not declare anything' error when we see an anonymous struct/union declaration outside of a struct or union in C
llvm-svn: 66303
2009-03-06 23:06:59 +00:00
Fariborz Jahanian f5d0613ce9 Fixed a bug where generation of read-barriers caused
crash in ir-gen.

llvm-svn: 66302
2009-03-06 23:05:56 +00:00
Douglas Gregor a74a29771f Implement GNU C semantics for K&R function definitions that follow a
prototype of the same function, where the promoted parameter types in
the K&R definition are not compatible with the types in the
prototype. Fixes PR2821.

llvm-svn: 66301
2009-03-06 22:43:54 +00:00
Daniel Dunbar d39e0974fe Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
- Names are lame, but it seems better to be explicit.

llvm-svn: 66295
2009-03-06 22:26:07 +00:00
Daniel Dunbar 3b3c3f02cc Rename my makefile debugging rule to prevent accidental collisions.
llvm-svn: 66294
2009-03-06 22:23:25 +00:00
Daniel Dunbar fe5b7bc5ef Add my "clang compatible" test runner. Sorry for keeping this to myself...
Usage: from clang/test, 'make -f ../utils/test/Makefile.multi'

Pros: About 20% faster than the Makefile based version on my 8 core
box (way faster on Windows I imagine, if it works).

Cons: Needs some cleanup. Ctrl-C works quite poorly on Darwin; more
Python's fault than mine.

Future: Support config definitions so we can use this for running LLVM
tests instead of dejagnu. Parallel testing goodness? Indeed.

llvm-svn: 66293
2009-03-06 22:20:40 +00:00
Daniel Dunbar 7aecee998c (LLVM svn up) Generalize RuntimeFunctions to RuntimeGlobals and add
CodeGenModule::CreateRuntimeVariable.

 - No real functionality change; although we now assert on silly
   things like:
--
int objc_exception_throw;
void f0() { @throw(@"A"); }
--
   instead of accepting it.

llvm-svn: 66292
2009-03-06 22:13:30 +00:00
Ted Kremenek 81bddcb61e Start work on subclassing PathDiagnosticPiece to distinguish more between control-flow pieces, events, etc.
llvm-svn: 66291
2009-03-06 22:10:49 +00:00
Ted Kremenek f4649f9f57 Add null-check assertion in the constructor of Selector.
llvm-svn: 66290
2009-03-06 22:09:31 +00:00
Daniel Dunbar dcf8d3c9eb Add Module::getNamedValue; use to normalize access to Module symbol
table.
 - No functionality change.

llvm-svn: 66289
2009-03-06 22:04:43 +00:00
Dale Johannesen 6e447e08ee Fix another case where debug info interferes with
an optimization.

llvm-svn: 66288
2009-03-06 21:08:33 +00:00
Daniel Dunbar e03c6102cc Handle #pragma pack(0). I left this out of diagnostic because users should
really use pack() instead.
 - <rdar://problem/6650243> clang warns about '#pragma pack(0)'

llvm-svn: 66287
2009-03-06 20:45:54 +00:00
Douglas Gregor c2fd626cac Improve recovery from ill-formed scope specifiers. Fixes PR3670.
llvm-svn: 66286
2009-03-06 19:06:37 +00:00
Mike Stump d6ef62f0bf Pass the type of the block literal around to make required temporal ordering of code clearer.
llvm-svn: 66284
2009-03-06 18:42:23 +00:00
Daniel Dunbar 13e9eff3f2 Fix thinko. *cough* ofcourseItestedit *cough*
llvm-svn: 66283
2009-03-06 18:35:43 +00:00
Douglas Gregor d45b93bdd6 Implement the GNU semantics for forward declarations of enum types in
C and C++. Fixes PR3688.

llvm-svn: 66282
2009-03-06 18:34:03 +00:00
Daniel Dunbar 3a45e4fffb Tidy file removal cleanup & remove race condition on file existence.
llvm-svn: 66281
2009-03-06 18:32:01 +00:00
Tanya Lattner 8498d2dd2b Add default constructor to SDNode to make gcc 3.4.6 happy.
llvm-svn: 66280
2009-03-06 18:17:45 +00:00
Dan Gohman ec5f2b5e05 Use c_str() to force the string to be nul-terminated.
llvm-svn: 66279
2009-03-06 18:13:15 +00:00
Mikhail Glushenkov 211f3c0f97 Add a comment.
llvm-svn: 66278
2009-03-06 17:59:58 +00:00
Daniel Dunbar 94911a91d5 x86_64 ABI: Handle long double in union when upper eightbyte results
in a lone X87 class.
 - PR3735.

llvm-svn: 66277
2009-03-06 17:50:25 +00:00
Sebastian Redl 4835010a29 Implement the machinery that can process TableGenerated warning options.
Manually write a table and some ad-hoc code to provide feature parity with the current code.

llvm-svn: 66276
2009-03-06 17:41:35 +00:00
Chris Lattner 040ce02174 some nits noticed by Duncan
llvm-svn: 66274
2009-03-06 17:05:04 +00:00
Chris Lattner a59518276e fix header comment and include guard.
llvm-svn: 66273
2009-03-06 16:54:19 +00:00
Chris Lattner e48f897ca7 add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!

llvm-svn: 66272
2009-03-06 16:52:18 +00:00
Ted Kremenek 704bc52bd9 Use list instead of vector for storing strings.
llvm-svn: 66271
2009-03-06 16:36:40 +00:00
Daniel Dunbar 8e79b8491f IRgen support for weak_import.
- <rdar://problem/6652110> clang should support weak_import

llvm-svn: 66270
2009-03-06 16:20:49 +00:00
Mikhail Glushenkov 0658cac532 Trailing whitespace.
llvm-svn: 66269
2009-03-06 12:25:56 +00:00
Mikhail Glushenkov 6a64f907c6 Trailing whitespace.
llvm-svn: 66268
2009-03-06 12:21:40 +00:00