]> granicus.if.org Git - clang/log
clang
14 years agoAdd -mavx and -mno-avx command line support
Bruno Cardoso Lopes [Wed, 4 Aug 2010 22:29:13 +0000 (22:29 +0000)]
Add -mavx and -mno-avx command line support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110265 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoActivate selectors in chained PCH. Chained PCH now works for Objective-C.
Sebastian Redl [Wed, 4 Aug 2010 22:21:29 +0000 (22:21 +0000)]
Activate selectors in chained PCH. Chained PCH now works for Objective-C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110262 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd AVX intrinsics header
Bruno Cardoso Lopes [Wed, 4 Aug 2010 22:03:36 +0000 (22:03 +0000)]
Add AVX intrinsics header

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110253 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBring stats for the method pool back.
Sebastian Redl [Wed, 4 Aug 2010 21:22:45 +0000 (21:22 +0000)]
Bring stats for the method pool back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110247 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement per-file reading of the selector table. This disables statistics about...
Sebastian Redl [Wed, 4 Aug 2010 20:40:17 +0000 (20:40 +0000)]
Implement per-file reading of the selector table. This disables statistics about method pool hits for the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110245 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach SemaChecking::CheckReturnStackAddr about ImplicitCastExprs that convert values...
Ted Kremenek [Wed, 4 Aug 2010 20:01:07 +0000 (20:01 +0000)]
Teach SemaChecking::CheckReturnStackAddr about ImplicitCastExprs that convert values to an lvalue.  This allows us to warn (again) about returning references to stack variables.  (fixes PR 7812).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110242 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore objc block variable layout info. work.
Fariborz Jahanian [Wed, 4 Aug 2010 18:44:59 +0000 (18:44 +0000)]
More objc block variable layout info. work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110239 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CFGStmtMap, which defines a mapping from Stmt* to CFGBlock*. The immediate inten...
Ted Kremenek [Wed, 4 Aug 2010 18:23:15 +0000 (18:23 +0000)]
Add CFGStmtMap, which defines a mapping from Stmt* to CFGBlock*.  The immediate intended use is in the unreachable code analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110230 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen chaining, only write interesting selectors to the PCH.
Sebastian Redl [Wed, 4 Aug 2010 18:21:41 +0000 (18:21 +0000)]
When chaining, only write interesting selectors to the PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110229 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStore the IDs of selectors in the PCH file explicitly.
Sebastian Redl [Wed, 4 Aug 2010 17:20:04 +0000 (17:20 +0000)]
Store the IDs of selectors in the PCH file explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110219 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen performing in-process code completion, don't free the remapped
Douglas Gregor [Wed, 4 Aug 2010 17:07:00 +0000 (17:07 +0000)]
When performing in-process code completion, don't free the remapped
file buffers until the code completion results are destroyed;
diagnostics may end up referring into the source.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110216 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSome early work for providing block layout info.
Fariborz Jahanian [Wed, 4 Aug 2010 16:57:49 +0000 (16:57 +0000)]
Some early work for providing block layout info.
for objective-c/c++ blocks (NeXt runtime).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110213 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd code-completion support directly to ASTUnit, which performs code
Douglas Gregor [Wed, 4 Aug 2010 16:47:14 +0000 (16:47 +0000)]
Add code-completion support directly to ASTUnit, which performs code
completion within the translation unit using the same command-line
arguments for parsing the translation unit. Eventually, we'll reuse
the precompiled preamble to improve code-completion performance, and
this also gives us a place to cache results.

Expose this function via the new libclang function
clang_codeCompleteAt(), which performs the code completion within a
CXTranslationUnit. The completion occurs in-process
(clang_codeCompletion() runs code completion out-of-process).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110210 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEmit standard-library RTTI with external linkage, not weak_odr.
John McCall [Wed, 4 Aug 2010 08:34:44 +0000 (08:34 +0000)]
Emit standard-library RTTI with external linkage, not weak_odr.

Apply hidden visibility to most RTTI;  libstdc++ does not rely on exact
pointer equality for the type info (just the type info names).  Apply
the same optimization to RTTI that we do to vtables.

Fixes PR5962.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110192 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the checker callback cache in GRExprEngine to be more compact (and IMHO a...
Jordy Rose [Wed, 4 Aug 2010 07:10:57 +0000 (07:10 +0000)]
Change the checker callback cache in GRExprEngine to be more compact (and IMHO a little easier to understand), and add the same sort of caching for EvalAssume (tied for least-used callback), mostly as proof-of-concept.

Before we go further with these, we should figure out a way to reuse the visit-and-cache code in CheckerVisit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110191 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAccept and ignore (for now) -funroll-loops.
Eric Christopher [Wed, 4 Aug 2010 06:55:48 +0000 (06:55 +0000)]
Accept and ignore (for now) -funroll-loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110190 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtend the hidden-visibility vtables optimization to template classes that
John McCall [Wed, 4 Aug 2010 06:38:15 +0000 (06:38 +0000)]
Extend the hidden-visibility vtables optimization to template classes that
haven't been explicitly instantiated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110189 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSome more correctness fixes and code-size optimizations for fragile-ABI
John McCall [Wed, 4 Aug 2010 05:59:32 +0000 (05:59 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110188 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen we try (but fail) to build a precompiled preamble, wait for a
Douglas Gregor [Wed, 4 Aug 2010 05:53:38 +0000 (05:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110187 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd more AVX 256-bit intrinsics and test cases for them
Bruno Cardoso Lopes [Wed, 4 Aug 2010 01:11:26 +0000 (01:11 +0000)]
Add more AVX 256-bit intrinsics and test cases for them

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110178 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a test case for P%7346, which was fixed by not doing the operator
John McCall [Wed, 4 Aug 2010 01:07:02 +0000 (01:07 +0000)]
Add a test case for P%7346, which was fixed by not doing the operator
delete lookup until the end of the class definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110176 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOnly look up an 'operator delete' on the definition of a destructor, not on
John McCall [Wed, 4 Aug 2010 01:04:25 +0000 (01:04 +0000)]
Only look up an 'operator delete' on the definition of a destructor, not on
a declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110175 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLook through using declarations when deciding whether to use an operator
John McCall [Wed, 4 Aug 2010 00:31:26 +0000 (00:31 +0000)]
Look through using declarations when deciding whether to use an operator
delete for a virtual destructor.  Diagnose ambiguities.

Fixes PR7803.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110173 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a warning on a test.
John McCall [Tue, 3 Aug 2010 22:49:45 +0000 (22:49 +0000)]
Fix a warning on a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110165 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo a very simple pass over every function we emit to infer whether we can
John McCall [Tue, 3 Aug 2010 22:46:07 +0000 (22:46 +0000)]
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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110163 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a hack for visual studio, fixing PR7796
Chris Lattner [Tue, 3 Aug 2010 22:13:56 +0000 (22:13 +0000)]
add a hack for visual studio, fixing PR7796

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110161 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIncomplete promotion of selector info to per-file data.
Sebastian Redl [Tue, 3 Aug 2010 21:58:15 +0000 (21:58 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110158 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for VFP status & control operations for ARM.
Nate Begeman [Tue, 3 Aug 2010 21:32:34 +0000 (21:32 +0000)]
Add support for VFP status & control operations for ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110153 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImproved false positive detection and numerous small issues in UnreachableCodeChecker
Tom Care [Tue, 3 Aug 2010 21:24:13 +0000 (21:24 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110148 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove DoneEvaluating field (unused since r90296)
Jordy Rose [Tue, 3 Aug 2010 20:45:31 +0000 (20:45 +0000)]
Remove DoneEvaluating field (unused since r90296)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110141 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMakes GRState::makeWithStore private, to encourage clients to make store changes...
Jordy Rose [Tue, 3 Aug 2010 20:44:35 +0000 (20:44 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110137 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen using a precompiled preamble, keep track of the top-level
Douglas Gregor [Tue, 3 Aug 2010 19:06:41 +0000 (19:06 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110131 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.
Eli Friedman [Tue, 3 Aug 2010 17:34:19 +0000 (17:34 +0000)]
PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110126 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoApart from storing/retrieving the previous redeclaration from PCH, also store/retriev...
Argyrios Kyrtzidis [Tue, 3 Aug 2010 17:30:10 +0000 (17:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110125 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTempla...
Argyrios Kyrtzidis [Tue, 3 Aug 2010 17:30:01 +0000 (17:30 +0000)]
Introduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110124 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSend AST dumping/printing to stdout instead of stderr.
Argyrios Kyrtzidis [Tue, 3 Aug 2010 17:29:57 +0000 (17:29 +0000)]
Send AST dumping/printing to stdout instead of stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110123 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid writing a VTABLE_USES record in PCH if there are no entries.
Argyrios Kyrtzidis [Tue, 3 Aug 2010 17:29:52 +0000 (17:29 +0000)]
Avoid writing a VTABLE_USES record in PCH if there are no entries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110122 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix some undefined behavior, PR7779.
Chris Lattner [Tue, 3 Aug 2010 16:48:42 +0000 (16:48 +0000)]
fix some undefined behavior, PR7779.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110116 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Don't forward any -g options to GCC, when using it to drive the
Daniel Dunbar [Tue, 3 Aug 2010 16:14:14 +0000 (16:14 +0000)]
Driver: Don't forward any -g options to GCC, when using it to drive the
assembler.
 - Fixes PR6218, hopefully.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110111 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReshuffle the PCH generator action and consumer, so that we can re-use
Douglas Gregor [Tue, 3 Aug 2010 08:14:03 +0000 (08:14 +0000)]
Reshuffle the PCH generator action and consumer, so that we can re-use
it while generating precompiled preambles. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110108 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEmit weak vtables of non-template classes with hidden visibility.
John McCall [Tue, 3 Aug 2010 07:24:12 +0000 (07:24 +0000)]
Emit weak vtables of non-template classes with hidden visibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110107 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAllow offsets to be negative. Out-of-bound cases are checked elsewhere. We
Zhongxing Xu [Tue, 3 Aug 2010 06:34:25 +0000 (06:34 +0000)]
Allow offsets to be negative. Out-of-bound cases are checked elsewhere. We
shouldn't put restrictions in store manager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110106 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPull the region offset computation logic into a single method.
Zhongxing Xu [Tue, 3 Aug 2010 04:52:05 +0000 (04:52 +0000)]
Pull the region offset computation logic into a single method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110102 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport x86 AVX 256-bit instructions built-ins. Right now support all of them, but
Bruno Cardoso Lopes [Tue, 3 Aug 2010 01:57:18 +0000 (01:57 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110096 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChanged GRExprEngine to pass down a reference to itself when checkers are doing posta...
Tom Care [Tue, 3 Aug 2010 01:55:07 +0000 (01:55 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110095 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that...
Ted Kremenek [Tue, 3 Aug 2010 00:09:51 +0000 (00:09 +0000)]
Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to the...
Ted Kremenek [Mon, 2 Aug 2010 23:46:59 +0000 (23:46 +0000)]
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)').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110085 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLabels (and case statement) don't create independent scope parents for the
John McCall [Mon, 2 Aug 2010 23:33:14 +0000 (23:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110082 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify global method pool implementation in Sema. No functionality change.
Sebastian Redl [Mon, 2 Aug 2010 23:18:59 +0000 (23:18 +0000)]
Simplify global method pool implementation in Sema. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110078 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix another case (this time in JumpScopeChecker) where walking deeply nested CaseStmt...
Ted Kremenek [Mon, 2 Aug 2010 22:46:57 +0000 (22:46 +0000)]
Fix another case (this time in JumpScopeChecker) where walking deeply nested CaseStmts can blow out the stack.  Fixes <rdar://problem/8125165>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110071 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix idempotent operations false positive caused by ivars not being invalidated in...
Ted Kremenek [Mon, 2 Aug 2010 21:59:12 +0000 (21:59 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110068 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFurther adjustments to -Wglobal-constructors; works for references and direct
John McCall [Mon, 2 Aug 2010 21:13:48 +0000 (21:13 +0000)]
Further adjustments to -Wglobal-constructors;  works for references and direct
initializations now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110063 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd Darwin dylib versioning support to libclang when build with CMake.
Douglas Gregor [Mon, 2 Aug 2010 20:52:32 +0000 (20:52 +0000)]
Add Darwin dylib versioning support to libclang when build with CMake.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110062 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen using a precompiled preamble, save the diagnostics produced when
Douglas Gregor [Mon, 2 Aug 2010 20:51:39 +0000 (20:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110061 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; no need...
Ted Kremenek [Mon, 2 Aug 2010 20:33:02 +0000 (20:33 +0000)]
'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; no need to two
lookups in the hashtable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110059 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd test case for <rdar://problem/8258814>.
Ted Kremenek [Mon, 2 Aug 2010 20:33:00 +0000 (20:33 +0000)]
Add test case for <rdar://problem/8258814>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110058 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoQuery only the latest version of an identifier in the PCH chain. Make sure this versi...
Sebastian Redl [Mon, 2 Aug 2010 18:30:12 +0000 (18:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110052 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove mutable data on TagType and InjectedClassNameType, by instead walking the...
Sebastian Redl [Mon, 2 Aug 2010 18:27:05 +0000 (18:27 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110051 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCompute width/align of objc builtin types (id, etc)
Fariborz Jahanian [Mon, 2 Aug 2010 18:03:20 +0000 (18:03 +0000)]
Compute width/align of objc builtin types (id, etc)
for radar 8258797.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110047 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate UsersManual, we support '#pragma align' now.
Daniel Dunbar [Mon, 2 Aug 2010 15:36:37 +0000 (15:36 +0000)]
Update UsersManual, we support '#pragma align' now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110040 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFrontend: Change PluginASTAction::ParseArgs to take a CompilerInstance object
Daniel Dunbar [Mon, 2 Aug 2010 15:31:28 +0000 (15:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110039 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoYou actually have to include a header in order to use a symbol, it's so 90s..
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:46:27 +0000 (07:46 +0000)]
You actually have to include a header in order to use a symbol, it's so 90s..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110034 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse llvm_unreachable.
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:31:21 +0000 (07:31 +0000)]
Use llvm_unreachable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110033 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoShut up warnings in Release build.
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:24:29 +0000 (07:24 +0000)]
Shut up warnings in Release build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110032 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRead/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them...
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:14:54 +0000 (07:14 +0000)]
Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:14:39 +0000 (07:14 +0000)]
Rename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110030 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Darwin: Change where Darwin computes the host version, to normalize tool
Daniel Dunbar [Mon, 2 Aug 2010 05:44:07 +0000 (05:44 +0000)]
Driver/Darwin: Change where Darwin computes the host version, to normalize tool
chain construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110028 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Have -ccc-host-triple simply override the default in the driver, for
Daniel Dunbar [Mon, 2 Aug 2010 05:44:04 +0000 (05:44 +0000)]
Driver: Have -ccc-host-triple simply override the default in the driver, for
now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110027 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Darwin: Inline some constants.
Daniel Dunbar [Mon, 2 Aug 2010 05:44:01 +0000 (05:44 +0000)]
Driver/Darwin: Inline some constants.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110026 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize tool
Daniel Dunbar [Mon, 2 Aug 2010 05:43:59 +0000 (05:43 +0000)]
Driver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize tool
chain construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110025 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Move HostInfo::lookupTypeForExtension to ToolChain::LookupTypeForExtension.
Daniel Dunbar [Mon, 2 Aug 2010 05:43:56 +0000 (05:43 +0000)]
Driver: Move HostInfo::lookupTypeForExtension to ToolChain::LookupTypeForExtension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110024 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Give Build{Universal,}Actions access to the default host tool chain. I
Daniel Dunbar [Mon, 2 Aug 2010 05:43:51 +0000 (05:43 +0000)]
Driver: Give Build{Universal,}Actions access to the default host tool chain. I
avoided this originally to enforce that the driver actions aren't toolchain
dependent, but it isn't worth the cumbersone additional hostinfo split.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110023 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove flat store: MemRegion::getAsOffset() computes a region's offset within
Zhongxing Xu [Mon, 2 Aug 2010 04:56:14 +0000 (04:56 +0000)]
Improve flat store: MemRegion::getAsOffset() computes a region's offset within
the top-level object. FlatStore now can bind and retrieve element and field
regions.
PR7297 is fixed by flat store.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110020 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Add Compilation::addCommand and switch tools to using it, now that we
Daniel Dunbar [Mon, 2 Aug 2010 02:38:28 +0000 (02:38 +0000)]
Driver: Add Compilation::addCommand and switch tools to using it, now that we
don't have to deal with nested jobs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110015 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Eliminate PipedJob, which is now unused.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:25 +0000 (02:38 +0000)]
Driver: Eliminate PipedJob, which is now unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110014 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Eliminate special InputInfo kind for pipes, it is now unused.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:21 +0000 (02:38 +0000)]
Driver: Eliminate special InputInfo kind for pipes, it is now unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110013 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Eliminate now unnecessary tool hooks for whether they accept piped input...
Daniel Dunbar [Mon, 2 Aug 2010 02:38:18 +0000 (02:38 +0000)]
Driver: Eliminate now unnecessary tool hooks for whether they accept piped input/output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110012 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Simplify.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:15 +0000 (02:38 +0000)]
Driver: Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110011 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Eliminate now unused argument.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:12 +0000 (02:38 +0000)]
Driver: Eliminate now unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110010 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Simplify logic for sending 'clang -E t.c' output to stdout.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:08 +0000 (02:38 +0000)]
Driver: Simplify logic for sending 'clang -E t.c' output to stdout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110009 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Never try to use piped inputs.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:06 +0000 (02:38 +0000)]
Driver: Never try to use piped inputs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110008 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Start ripping out support for -pipe, which is worthless and complicates
Daniel Dunbar [Mon, 2 Aug 2010 02:38:03 +0000 (02:38 +0000)]
Driver: Start ripping out support for -pipe, which is worthless and complicates
too many other things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110007 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Daniel Dunbar [Sun, 1 Aug 2010 23:13:54 +0000 (23:13 +0000)]
Driver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Gray.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109994 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Keep track of a separate "install dir", which is the path where clang
Daniel Dunbar [Sun, 1 Aug 2010 22:29:51 +0000 (22:29 +0000)]
Driver: Keep track of a separate "install dir", which is the path where clang
was invoked from (which may not be where the executable itself is).
 - This allows having e.g., /Developer/usr/bin/clang be a symlink to some other
   location, while still making sure the Driver finds 'as', 'ld', etc. relative
   to itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109989 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify.
Daniel Dunbar [Sun, 1 Aug 2010 22:29:47 +0000 (22:29 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109988 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPR7777: Set EnabledByDefault to something useful, instead of setting it
Eli Friedman [Sun, 1 Aug 2010 22:13:15 +0000 (22:13 +0000)]
PR7777: Set EnabledByDefault to something useful, instead of setting it
randomly.  This makes us consistently show "-pedantic" as the warning option
for a warning where appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109987 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoKill off RequiresGlobalConstructor in favor of isConstantInitializer.
John McCall [Sun, 1 Aug 2010 21:51:45 +0000 (21:51 +0000)]
Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109986 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake a first pass at implementing -Wglobal-constructors. I'm worried that this
John McCall [Sun, 1 Aug 2010 20:20:59 +0000 (20:20 +0000)]
Make a first pass at implementing -Wglobal-constructors.  I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109984 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInstantiate attributes from the pattern record when instantiating
John McCall [Sun, 1 Aug 2010 02:01:53 +0000 (02:01 +0000)]
Instantiate attributes from the pattern record when instantiating
a class template.  Fixes rdar://problem/8243419.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109967 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix indentation.
John McCall [Sun, 1 Aug 2010 01:25:24 +0000 (01:25 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109965 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't consider all local variables in C++ to mandate scope-checking, just
John McCall [Sun, 1 Aug 2010 01:24:59 +0000 (01:24 +0000)]
Don't consider all local variables in C++ to mandate scope-checking, just
those with initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109964 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOnly run the jump-checker if there's a branch-protected scope *and* there's
John McCall [Sun, 1 Aug 2010 00:26:45 +0000 (00:26 +0000)]
Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function.  Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.

Turns off the jump-checker in a lot of cases in C++.  rdar://problem/7702918

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109962 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIterate typeloc's for class bases.
Nick Lewycky [Sat, 31 Jul 2010 23:26:36 +0000 (23:26 +0000)]
Iterate typeloc's for class bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109961 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix fragile-ABI ObjC exceptions in the presence of optimization with
John McCall [Sat, 31 Jul 2010 23:20:56 +0000 (23:20 +0000)]
Fix fragile-ABI ObjC exceptions in the presence of optimization with
the magic of inline assembly.  Essentially we use read and write hazards
on the set of local variables to force flushing locals to memory
immediately before any protected calls and to inhibit optimizing locals
across the setjmp->catch edge.  Fixes rdar://problem/8160285

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109960 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agobuild: Don't pass -avoid-version or -no-undefined on Darwin, they don't do
Daniel Dunbar [Sat, 31 Jul 2010 21:33:01 +0000 (21:33 +0000)]
build: Don't pass -avoid-version or -no-undefined on Darwin, they don't do
anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109958 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoParser: Add support for #pragma align, which is just another spelling of #pragma
Daniel Dunbar [Sat, 31 Jul 2010 19:17:07 +0000 (19:17 +0000)]
Parser: Add support for #pragma align, which is just another spelling of #pragma
options align.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109952 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAfter a lengthy design discussion, add support for "ownership attributes" for malloc...
Ted Kremenek [Sat, 31 Jul 2010 01:52:11 +0000 (01:52 +0000)]
After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking.  Patch by Andrew McGregor!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109939 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement dependency analysis for the precompiled preamble. If any of
Douglas Gregor [Sat, 31 Jul 2010 00:40:00 +0000 (00:40 +0000)]
Implement dependency analysis for the precompiled preamble. If any of
the files in the precompiled preamble have changed since it was build,
force the preamble to be rebuilt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109937 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate checker build.
Ted Kremenek [Fri, 30 Jul 2010 23:07:20 +0000 (23:07 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109907 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest case for PR7763.
Tom Care [Fri, 30 Jul 2010 21:42:31 +0000 (21:42 +0000)]
Test case for PR7763.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109895 91177308-0d34-0410-b5e6-96231b3b80d8