Commit Graph

24522 Commits

Author SHA1 Message Date
John McCall 2dd7d44135 Some more correctness fixes and code-size optimizations for fragile-ABI
ObjC exceptions:
  - don't enter a try for the catch blocks unless there's a finally
  - put the setjmp buffer in the locals set for liveness reasons
  - dump the sync object into an alloca in the locals set for liveness reasons
Some of this can go away if the backend starts to properly calculate liveness
in the presence of setjmp (which would also be a *much* stabler solution).

llvm-svn: 110188
2010-08-04 05:59:32 +00:00
Douglas Gregor bb420abd0b When we try (but fail) to build a precompiled preamble, wait for a
short "cooling off" period (defaulting to 5 reparses) before trying to
build a precompiled preamble again. Previously, if we failed to build
the precompiled preamble at any time, we just gave up the whole
charade any never tried again.

llvm-svn: 110187
2010-08-04 05:53:38 +00:00
Bruno Cardoso Lopes 6586724f71 Add more AVX 256-bit intrinsics and test cases for them
llvm-svn: 110178
2010-08-04 01:11:26 +00:00
John McCall 3faf1cf3ea Add a test case for P%7346, which was fixed by not doing the operator
delete lookup until the end of the class definition.

llvm-svn: 110176
2010-08-04 01:07:02 +00:00
John McCall deb646ebb5 Only look up an 'operator delete' on the definition of a destructor, not on
a declaration.

llvm-svn: 110175
2010-08-04 01:04:25 +00:00
John McCall 66a8759400 Look through using declarations when deciding whether to use an operator
delete for a virtual destructor.  Diagnose ambiguities.

Fixes PR7803.

llvm-svn: 110173
2010-08-04 00:31:26 +00:00
John McCall f8280e723d Fix a warning on a test.
llvm-svn: 110165
2010-08-03 22:49:45 +00:00
John McCall 8601a75118 Do a very simple pass over every function we emit to infer whether we can
mark it nounwind based on whether it contains any non-nounwind calls.
<rdar://problem/8087431>

llvm-svn: 110163
2010-08-03 22:46:07 +00:00
Chris Lattner 38321174e0 add a hack for visual studio, fixing PR7796
llvm-svn: 110161
2010-08-03 22:13:56 +00:00
Sebastian Redl a19a67f899 Incomplete promotion of selector info to per-file data.
Store all selectors in the selector hash table instead of only those from the method pool.

llvm-svn: 110158
2010-08-03 21:58:15 +00:00
Nate Begeman f568b074db Add support for VFP status & control operations for ARM.
llvm-svn: 110153
2010-08-03 21:32:34 +00:00
Tom Care be633d91d0 Improved false positive detection and numerous small issues in UnreachableCodeChecker
- Reporting now uses getUnreachableStmt which returns the Stmt* we should report
- Indexing of reachable and visited blocks now use CFGBlock ID's instead of pointers
- The CFG used in the unreachable search is now the unoptimized CFG
- Added 'Dead code' category to warnings
- Removed obsolete function getCondition
- Simplified false positive detection based on properties of FindUnreachableEntryPoints

llvm-svn: 110148
2010-08-03 21:24:13 +00:00
Jordy Rose 6e6f6e2cc3 Remove DoneEvaluating field (unused since r90296)
llvm-svn: 110141
2010-08-03 20:45:31 +00:00
Jordy Rose ddec092641 Makes GRState::makeWithStore private, to encourage clients to make store changes through GRState instead of directly accessing the StoreManager. Also adds cover methods for InvalidateRegion(s) and EnterStackFrame to GRState.
This is in preparation for proposed region change notifications. No functionality change.

llvm-svn: 110137
2010-08-03 20:44:35 +00:00
Douglas Gregor e9db88f991 When using a precompiled preamble, keep track of the top-level
declarations that we saw when creating the precompiled preamble, and
provide those declarations in addition to the declarations parsed in
the main source file when traversing top-level declarations. This
makes the use of precompiled preambles a pure optimization, rather
than changing the semantics of the parsed translation unit.

llvm-svn: 110131
2010-08-03 19:06:41 +00:00
Eli Friedman 865afc96f7 PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.
llvm-svn: 110126
2010-08-03 17:34:19 +00:00
Argyrios Kyrtzidis 839bbacfb2 Apart from storing/retrieving the previous redeclaration from PCH, also store/retrieve the most recent
redeclaration. That way we are sure that the full redeclarations chain is loaded.

When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH.
To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need
to point to a most recent redeclaration in another PCH.

llvm-svn: 110125
2010-08-03 17:30:10 +00:00
Argyrios Kyrtzidis a6430cfe48 Introduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTemplateDecl.
llvm-svn: 110124
2010-08-03 17:30:01 +00:00
Argyrios Kyrtzidis 1e1de05f18 Send AST dumping/printing to stdout instead of stderr.
llvm-svn: 110123
2010-08-03 17:29:57 +00:00
Argyrios Kyrtzidis edee67f335 Avoid writing a VTABLE_USES record in PCH if there are no entries.
llvm-svn: 110122
2010-08-03 17:29:52 +00:00
Chris Lattner 278008f546 fix some undefined behavior, PR7779.
llvm-svn: 110116
2010-08-03 16:48:42 +00:00
Daniel Dunbar 939c1211cc Driver: Don't forward any -g options to GCC, when using it to drive the
assembler.
 - Fixes PR6218, hopefully.

llvm-svn: 110111
2010-08-03 16:14:14 +00:00
Douglas Gregor 48c8cd3fd0 Reshuffle the PCH generator action and consumer, so that we can re-use
it while generating precompiled preambles. No functionality change.

llvm-svn: 110108
2010-08-03 08:14:03 +00:00
John McCall 5696d6d316 Emit weak vtables of non-template classes with hidden visibility.
llvm-svn: 110107
2010-08-03 07:24:12 +00:00
Zhongxing Xu 42b8c30de6 Allow offsets to be negative. Out-of-bound cases are checked elsewhere. We
shouldn't put restrictions in store manager.

llvm-svn: 110106
2010-08-03 06:34:25 +00:00
Zhongxing Xu 83734e46ce Pull the region offset computation logic into a single method.
llvm-svn: 110102
2010-08-03 04:52:05 +00:00
Bruno Cardoso Lopes 1f927ccaa2 Support x86 AVX 256-bit instructions built-ins. Right now support all of them, but
as soon as we properly codegen the simple vector operations, remove the
unnecessary built-ins/intrinsics from clang and llvm. Also add tests for the new
built-ins

llvm-svn: 110096
2010-08-03 01:57:18 +00:00
Tom Care 44081fbc6c Changed GRExprEngine to pass down a reference to itself when checkers are doing postanalysis. This allows the checker to gather information about the state of the engine when it has finished.
- Exposed the worklist and BlockAborted flag in GRCoreEngine
- Changed postanalysis checkers to use the new infrastructure

llvm-svn: 110095
2010-08-03 01:55:07 +00:00
Ted Kremenek 4a2b237967 Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.
llvm-svn: 110087
2010-08-03 00:09:51 +00:00
Ted Kremenek dc03bd0894 Add 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to the original
CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)').

llvm-svn: 110085
2010-08-02 23:46:59 +00:00
John McCall 4a33fa95c0 Labels (and case statement) don't create independent scope parents for the
purposes of the jump checker.  Also extend Ted's iteration fix to labels.

Fixes PR7789.

llvm-svn: 110082
2010-08-02 23:33:14 +00:00
Sebastian Redl 75d8a32817 Simplify global method pool implementation in Sema. No functionality change.
llvm-svn: 110078
2010-08-02 23:18:59 +00:00
Ted Kremenek 04d50f5d13 Fix another case (this time in JumpScopeChecker) where walking deeply nested CaseStmts can blow out the stack. Fixes <rdar://problem/8125165>.
llvm-svn: 110071
2010-08-02 22:46:57 +00:00
Ted Kremenek 297e2e5bf6 Fix idempotent operations false positive caused by ivars not being invalidated in function
calls when the enclosing object had retain/release state.  Fixes <rdar://problem/8261992>.

llvm-svn: 110068
2010-08-02 21:59:12 +00:00
John McCall 8b0f4ff317 Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.

llvm-svn: 110063
2010-08-02 21:13:48 +00:00
Douglas Gregor b1cf1ca19a Add Darwin dylib versioning support to libclang when build with CMake.
llvm-svn: 110062
2010-08-02 20:52:32 +00:00
Douglas Gregor d9a30af25b When using a precompiled preamble, save the diagnostics produced when
creating the preamble and "replay" them when reusing the
preamble. Also, fix a thinko in the copying of the preamble when
building the precompiled preamble.

llvm-svn: 110061
2010-08-02 20:51:39 +00:00
Ted Kremenek 8a4a2b14e8 'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; no need to two
lookups in the hashtable.

llvm-svn: 110059
2010-08-02 20:33:02 +00:00
Ted Kremenek 4b83f753a1 Add test case for <rdar://problem/8258814>.
llvm-svn: 110058
2010-08-02 20:33:00 +00:00
Sebastian Redl 78f5177d37 Query only the latest version of an identifier in the PCH chain. Make sure this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases.
llvm-svn: 110052
2010-08-02 18:30:12 +00:00
Sebastian Redl 9d8854ec60 Remove mutable data on TagType and InjectedClassNameType, by instead walking the declaration chain in search of a definition. This is necessary for a sane chained PCH implementation. No observable performance change on Carbon.h syntax-only, and bootstraps cleanly.
llvm-svn: 110051
2010-08-02 18:27:05 +00:00
Fariborz Jahanian 9c6a39e862 Compute width/align of objc builtin types (id, etc)
for radar 8258797.

llvm-svn: 110047
2010-08-02 18:03:20 +00:00
Daniel Dunbar 1b8842d981 Update UsersManual, we support '#pragma align' now.
llvm-svn: 110040
2010-08-02 15:36:37 +00:00
Daniel Dunbar 2be96746b4 Frontend: Change PluginASTAction::ParseArgs to take a CompilerInstance object
for use in reporting diagnostics.
 - We don't want to use the Action's own CompilerInstance, because that is only
   initialized during file processing and I like that invariant.

Also, if ParseArgs returns false then abandon execution.

Also, remove unused PluginASTAction::PrintHelp virtual method.

llvm-svn: 110039
2010-08-02 15:31:28 +00:00
Argyrios Kyrtzidis cd948c1df5 You actually have to include a header in order to use a symbol, it's so 90s..
llvm-svn: 110034
2010-08-02 07:46:27 +00:00
Argyrios Kyrtzidis ea247181ab Use llvm_unreachable.
llvm-svn: 110033
2010-08-02 07:31:21 +00:00
Argyrios Kyrtzidis d46687f200 Shut up warnings in Release build.
llvm-svn: 110032
2010-08-02 07:24:29 +00:00
Argyrios Kyrtzidis 2d68810caf Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.
llvm-svn: 110031
2010-08-02 07:14:54 +00:00
Argyrios Kyrtzidis 4f8e17379d Rename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
No functionality change.

llvm-svn: 110030
2010-08-02 07:14:39 +00:00
Daniel Dunbar 71c723da29 Driver/Darwin: Change where Darwin computes the host version, to normalize tool
chain construction.

llvm-svn: 110028
2010-08-02 05:44:07 +00:00