]> granicus.if.org Git - clang/log
clang
14 years agoIntroduce basic support for loading a precompiled preamble while
Douglas Gregor [Mon, 26 Jul 2010 21:36:20 +0000 (21:36 +0000)]
Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.

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

14 years agoMinor code simplification.
Dan Gohman [Mon, 26 Jul 2010 21:33:22 +0000 (21:33 +0000)]
Minor code simplification.

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

14 years agoIt's not necessary to call flush() on a raw_ostream immediately prior
Dan Gohman [Mon, 26 Jul 2010 21:29:50 +0000 (21:29 +0000)]
It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.

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

14 years agoFix namespace polution.
Dan Gohman [Mon, 26 Jul 2010 21:25:24 +0000 (21:25 +0000)]
Fix namespace polution.

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

14 years agoMake a variable static.
Dan Gohman [Mon, 26 Jul 2010 21:12:29 +0000 (21:12 +0000)]
Make a variable static.

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

14 years agoUse an export file. Plugins must export llvm::Registry symbols.
Dan Gohman [Mon, 26 Jul 2010 21:12:10 +0000 (21:12 +0000)]
Use an export file. Plugins must export llvm::Registry symbols.
Also, don't link in all the clang libraries statically.

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

14 years agoHoist argument type checking into CheckFormatHandler. This is prep for scanf format
Ted Kremenek [Mon, 26 Jul 2010 19:45:54 +0000 (19:45 +0000)]
Hoist argument type checking into CheckFormatHandler.  This is prep for scanf format
string argument type checking.

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

14 years agoConsolidate #args checking for scanf/printf format strings.
Ted Kremenek [Mon, 26 Jul 2010 19:45:42 +0000 (19:45 +0000)]
Consolidate #args checking for scanf/printf format strings.

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

14 years agoRevert 109303.
Devang Patel [Mon, 26 Jul 2010 18:49:27 +0000 (18:49 +0000)]
Revert 109303.

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

14 years agoMake sure that implicit qualification and derived-to-base conversions of xvalues...
Sebastian Redl [Mon, 26 Jul 2010 17:52:21 +0000 (17:52 +0000)]
Make sure that implicit qualification and derived-to-base conversions of xvalues preserve xvalue-ness. Unfortunately I have no idea how to test this property; there doesn't seem to be a syntactical construct that triggers such a conversion and still allows the distinction between prvalues and xvalues to be made.

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

14 years agoAdd source location information to C++ base specifiers.
Nick Lewycky [Mon, 26 Jul 2010 16:56:01 +0000 (16:56 +0000)]
Add source location information to C++ base specifiers.

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

14 years agoWhen LIBCLANG_CODE_COMPLETION_LOGGING is set in the environment, log code-completion...
Douglas Gregor [Mon, 26 Jul 2010 16:29:14 +0000 (16:29 +0000)]
When LIBCLANG_CODE_COMPLETION_LOGGING is set in the environment, log code-completion command lines to stderr

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

14 years agoEliminate the "minimal" and printing parser actions, which only ever
Douglas Gregor [Mon, 26 Jul 2010 04:08:02 +0000 (04:08 +0000)]
Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.

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

14 years agoWrap bit mangling logic for DiagMappings in its own class so it doesn't leak
Benjamin Kramer [Sun, 25 Jul 2010 21:40:48 +0000 (21:40 +0000)]
Wrap bit mangling logic for DiagMappings in its own class so it doesn't leak
into other code. Make it an array instead of a constant-length vector.

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

14 years agoRemove a bunch of trivial destructors
Douglas Gregor [Sun, 25 Jul 2010 18:44:37 +0000 (18:44 +0000)]
Remove a bunch of trivial destructors

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

14 years agoMove Type destructor out-of-line
Douglas Gregor [Sun, 25 Jul 2010 18:39:40 +0000 (18:39 +0000)]
Move Type destructor out-of-line

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

14 years agoRemove destructors from declaration nodes
Douglas Gregor [Sun, 25 Jul 2010 18:38:02 +0000 (18:38 +0000)]
Remove destructors from declaration nodes

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

14 years agoI lied. Kill off a few more Destroy methods
Douglas Gregor [Sun, 25 Jul 2010 18:32:30 +0000 (18:32 +0000)]
I lied. Kill off a few more Destroy methods

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

14 years agoKill off the last Destroy method in the AST library
Douglas Gregor [Sun, 25 Jul 2010 18:23:53 +0000 (18:23 +0000)]
Kill off the last Destroy method in the AST library

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

14 years agoRemove the vast majority of the Destroy methods from the AST library,
Douglas Gregor [Sun, 25 Jul 2010 18:17:45 +0000 (18:17 +0000)]
Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.

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

14 years agoMake ASTContext always use the BumpPtrAllocator.
Douglas Gregor [Sun, 25 Jul 2010 17:53:33 +0000 (17:53 +0000)]
Make ASTContext always use the BumpPtrAllocator.

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

14 years agoStart removing the use of smart pointers from the Parse/Sema
Douglas Gregor [Sun, 25 Jul 2010 17:39:21 +0000 (17:39 +0000)]
Start removing the use of smart pointers from the Parse/Sema
interaction, by effectively defaulting to
DISABLE_SMART_POINTERS. We're embracing the model where all AST nodes
are ASTContext-allocated and live as long as the ASTContext lives.

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

14 years agoRemove emacs file mode marker on file with .cpp extension.
Nick Lewycky [Sun, 25 Jul 2010 03:12:58 +0000 (03:12 +0000)]
Remove emacs file mode marker on file with .cpp extension.

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

14 years agoRemove dead code.
Eli Friedman [Sat, 24 Jul 2010 21:35:09 +0000 (21:35 +0000)]
Remove dead code.

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

14 years agoAdd header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!
Nick Lewycky [Sat, 24 Jul 2010 21:33:13 +0000 (21:33 +0000)]
Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!

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

14 years agoPR7698: Make sure we correctly handle the initialization of an array with
Eli Friedman [Sat, 24 Jul 2010 21:19:15 +0000 (21:19 +0000)]
PR7698: Make sure we correctly handle the initialization of an array with
dependent size.

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

14 years agoFix clang-interpreter build
Peter Collingbourne [Sat, 24 Jul 2010 17:59:51 +0000 (17:59 +0000)]
Fix clang-interpreter build

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

14 years agoFix sort order.
Nick Lewycky [Sat, 24 Jul 2010 02:58:13 +0000 (02:58 +0000)]
Fix sort order.

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

14 years agoMangle enum constant expressions. Fixes rdar://problem/8204122
John McCall [Sat, 24 Jul 2010 01:17:35 +0000 (01:17 +0000)]
Mangle enum constant expressions.  Fixes rdar://problem/8204122

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

14 years agoturn down the logical bitwise confusion warning to not warn
Chris Lattner [Sat, 24 Jul 2010 01:10:11 +0000 (01:10 +0000)]
turn down the logical bitwise confusion warning to not warn
when the RHS of the ||/&& is ever 0 or 1.  This handles a variety of
creative idioms for "true" used in C programs and fixes many false
positives at the expense of a few false negatives.  This fixes
rdar://8230351.

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

14 years agoUntangle filename/dirname confusion. Store constructed strings on the side. Avoid...
Devang Patel [Sat, 24 Jul 2010 00:59:16 +0000 (00:59 +0000)]
Untangle filename/dirname confusion. Store constructed strings on the side. Avoid use of Path.makeAbsolute().

DW_TAG_compile_unit uses two attributes DW_AT_name and DW_AT_comp_dir. Their expected values are:

$ clang foo.c -g
  DW_AT_name - foo.c
  DW_AT_comp_dir - `pwd`

$ clang one/two/foo.c -g
  DW_AT_name - one/two/foo.c
  DW_AT_comp_dir - `pwd`

$ clang /tmp/one/foo.c -g
  DW_AT_name - /tmp/one/foo.c
  DW_AT_comp_dir - empty

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

14 years agoPut a newline at the end of the padded buffers used for the
Douglas Gregor [Sat, 24 Jul 2010 00:42:07 +0000 (00:42 +0000)]
Put a newline at the end of the padded buffers used for the
precompiled preamble. This will suppress the -pedantic "no newline at
end of file" warning.

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

14 years agoOnce we've built (or reused) a precompiled preamble, create the
Douglas Gregor [Sat, 24 Jul 2010 00:38:13 +0000 (00:38 +0000)]
Once we've built (or reused) a precompiled preamble, create the
appropriately-padded main file buffer (that has spaces in the extra
"reserved" space) and thread that buffer through to the parsing
function. This still does nothing.

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

14 years agoSupport catching Objective C pointers in C++ under the non-fragile NeXT runtime.
John McCall [Sat, 24 Jul 2010 00:37:23 +0000 (00:37 +0000)]
Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.
Diagnose attempts to do this under the GNU or fragile NeXT runtimes.

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

14 years agoReturn type of a setter call caused by
Fariborz Jahanian [Sat, 24 Jul 2010 00:34:08 +0000 (00:34 +0000)]
Return type of a setter call caused by
use of property-dot syntax using 'super' as receiver
is 'void'. This fixes a bug in generating correct
API for setter call. Fixes radar 8203426.

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

14 years agoBe careful; even though we had a proper name at the beginning of
Douglas Gregor [Sat, 24 Jul 2010 00:10:38 +0000 (00:10 +0000)]
Be careful; even though we had a proper name at the beginning of
Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating
has a useful name. <rdar://problem/8229910>

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

14 years agoOnce we've built a precompiled preamble, keep track of the details of
Douglas Gregor [Fri, 23 Jul 2010 23:58:40 +0000 (23:58 +0000)]
Once we've built a precompiled preamble, keep track of the details of
that preamble (the preamble text, preamble file, reserved main file
size). Check these details when we try to rebuild the precompiled
preamble, and when nothing has changed, re-use the precompiled
preamble.

This code is still very much a WIP, and can't even properly be tested
because we have no way to use the precompiled preamble yet. "Trust me"

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

14 years agoMake declarations in the dependent PCH visible, for C at least.
Sebastian Redl [Fri, 23 Jul 2010 23:49:55 +0000 (23:49 +0000)]
Make declarations in the dependent PCH visible, for C at least.

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

14 years agoAdded an path-sensitive unreachable code checker to the experimental analyzer checks.
Tom Care [Fri, 23 Jul 2010 23:04:53 +0000 (23:04 +0000)]
Added an path-sensitive unreachable code checker to the experimental analyzer checks.
- Created a new class to do post-analysis
- Updated several test cases with unreachable code to expect a warning
- Added some general tests

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

14 years agoRevert r109263.
Devang Patel [Fri, 23 Jul 2010 23:04:28 +0000 (23:04 +0000)]
Revert r109263.

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

14 years agoWe never want to pop the translation unit DC, so assert if this happens.
John McCall [Fri, 23 Jul 2010 22:45:07 +0000 (22:45 +0000)]
We never want to pop the translation unit DC, so assert if this happens.

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

14 years agoRevise cleanup IR generation to fix a major bug with cleanups (PR7686)
John McCall [Fri, 23 Jul 2010 21:56:41 +0000 (21:56 +0000)]
Revise cleanup IR generation to fix a major bug with cleanups (PR7686)
as well as some significant asymptotic inefficiencies with threading
multiple jumps through deep cleanups.

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

14 years agoAllow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.
Fariborz Jahanian [Fri, 23 Jul 2010 21:53:24 +0000 (21:53 +0000)]
Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.
Radar 8218839.

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

14 years agoThere is no need to use separate dir name for AT_comp_dir attribute. Using absolute...
Devang Patel [Fri, 23 Jul 2010 20:38:37 +0000 (20:38 +0000)]
There is no need to use separate dir name for AT_comp_dir attribute. Using absolute path for filename allows clients to query complete file location info from gdb breakpoints. Save constructed full file name.

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

14 years agoTest for selector-warning PCH patch.
Fariborz Jahanian [Fri, 23 Jul 2010 20:32:57 +0000 (20:32 +0000)]
Test for selector-warning PCH patch.
radar 6507158.

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

14 years agoFix for PR7694: make sure to pass in a RecordType to CheckBaseClassAccess;
Eli Friedman [Fri, 23 Jul 2010 19:25:41 +0000 (19:25 +0000)]
Fix for PR7694: make sure to pass in a RecordType to CheckBaseClassAccess;
fixes crashes on both valid and invalid code.  The diagnostic here could
potentially be improved, but it's good enough as-is.

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

14 years agoPCH read/write for selector reference pool.
Fariborz Jahanian [Fri, 23 Jul 2010 19:11:11 +0000 (19:11 +0000)]
PCH read/write for selector reference pool.
Finishes off radar 6507158.

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

14 years agoDataflow solver: Don't overrwite the initial value of a block with top unless new...
Ted Kremenek [Fri, 23 Jul 2010 18:15:17 +0000 (18:15 +0000)]
Dataflow solver: Don't overrwite the initial value of a block with top unless new values are available.  Patch by Simone Pellegrini!

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

14 years agoVectors are not integer types, so the type system should not classify
Douglas Gregor [Fri, 23 Jul 2010 15:58:24 +0000 (15:58 +0000)]
Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!

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

14 years agoAdd FILE* leak check to StreamChecker. Patch by Lei Zhang.
Zhongxing Xu [Fri, 23 Jul 2010 14:14:59 +0000 (14:14 +0000)]
Add FILE* leak check to StreamChecker. Patch by Lei Zhang.

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

14 years agoRemove unneeded iostream include.
Bill Wendling [Fri, 23 Jul 2010 07:19:31 +0000 (07:19 +0000)]
Remove unneeded iostream include.

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

14 years agoChange arg type.
Zhongxing Xu [Fri, 23 Jul 2010 05:55:01 +0000 (05:55 +0000)]
Change arg type.

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

14 years agoDelete unnecessary const_cast.
Zhongxing Xu [Fri, 23 Jul 2010 02:54:53 +0000 (02:54 +0000)]
Delete unnecessary const_cast.

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

14 years agoAnalysisContext is not const.
Zhongxing Xu [Fri, 23 Jul 2010 02:49:07 +0000 (02:49 +0000)]
AnalysisContext is not const.

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

14 years agoFix build on Ubuntu 10.04.
Zhongxing Xu [Fri, 23 Jul 2010 02:15:08 +0000 (02:15 +0000)]
Fix build on Ubuntu 10.04.

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

14 years agoBasic plumbing for generating a precompiled preamble for an
Douglas Gregor [Fri, 23 Jul 2010 00:33:23 +0000 (00:33 +0000)]
Basic plumbing for generating a precompiled preamble for an
ASTUnit/CXTranslationUnit. We can't actually use this preamble yet,
however.

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

14 years agoWarn when property ivar lookup finds a global variable
Fariborz Jahanian [Thu, 22 Jul 2010 23:33:21 +0000 (23:33 +0000)]
Warn when property ivar lookup finds a global variable
of same name. In nonfragile-abi2, lookup accesses a synthesized
ivar. This is a transition warning.  Radar 8225011.

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

14 years agoTed pointed out that this test case could be using access control instead of
John McCall [Thu, 22 Jul 2010 22:44:38 +0000 (22:44 +0000)]
Ted pointed out that this test case could be using access control instead of
__attribute__((unavailable)).  I've done so, but unfortunately there's still a case
of redundant diagnostics.

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

14 years agoThread bitstream cursors all the way through the AST reading stuff. This way, reading...
Sebastian Redl [Thu, 22 Jul 2010 22:43:28 +0000 (22:43 +0000)]
Thread bitstream cursors all the way through the AST reading stuff. This way, reading a trivial 2-element chained file actually works.

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

14 years agoKeep track of artificial scopes introduced by line directives. For example,
Devang Patel [Thu, 22 Jul 2010 22:29:16 +0000 (22:29 +0000)]
Keep track of artificial scopes introduced by line directives. For example,

#line 41 "bar.c"
  dummy (1, i);
#line 24 "bar.h"
  i = f2 (i);
#line 44 "bar.c"

This is tested by step-line.exp in gdb testsuite.

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

14 years agoTurn off EH cleanups for __block variables; they caused some internal buildbot
John McCall [Thu, 22 Jul 2010 21:25:44 +0000 (21:25 +0000)]
Turn off EH cleanups for __block variables;  they caused some internal buildbot
failures.  There's a radar tracking this.

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

14 years agoImprove performance during cursor traversal when a region of interest
Douglas Gregor [Thu, 22 Jul 2010 20:22:31 +0000 (20:22 +0000)]
Improve performance during cursor traversal when a region of interest
is present.

Rather than using clang_getCursorExtent(), which requires
us to lex the token at the ending position to determine its
length. Then, we'd be comparing [a, b) source ranges that cover the
characters in the range rather than the normal behavior for Clang's
source ranges, which covers the tokens in the range. However, relexing
causes us to read the source file (which may come from a precompiled
header), which is rather unfortunate and affects performance.

In the new scheme, we only use Clang-style source ranges that cover
the tokens in the range. At the entry points where this matters
(clang_annotateTokens, clang_getCursor), we make sure to move source
locations to the start of the token.

Addresses most of <rdar://problem/8049381>.

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

14 years agoatch for implementation of objective-c's -Wselector
Fariborz Jahanian [Thu, 22 Jul 2010 18:24:20 +0000 (18:24 +0000)]
atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.

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

14 years agoDon't crash when an explicit template instantiation has no user-written
Nick Lewycky [Thu, 22 Jul 2010 17:56:53 +0000 (17:56 +0000)]
Don't crash when an explicit template instantiation has no user-written
arguments. This happens in clang itself where template:

  template <typename T> T const *getAs();

gets specialized with:

  template<> inline clang::TypedefType const *getAs() { ... }

and there's no TemplateArgumentList.

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

14 years agoSerialization is implemented, fix comments.
Argyrios Kyrtzidis [Thu, 22 Jul 2010 17:28:27 +0000 (17:28 +0000)]
Serialization is implemented, fix comments.

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

14 years agoRead/write C++0x static_assert for PCH.
Argyrios Kyrtzidis [Thu, 22 Jul 2010 17:28:12 +0000 (17:28 +0000)]
Read/write C++0x static_assert for PCH.

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

14 years agoAllow loading declcontext information from any file in the chain. Properly write...
Sebastian Redl [Thu, 22 Jul 2010 17:01:13 +0000 (17:01 +0000)]
Allow loading declcontext information from any file in the chain. Properly write source locations to dependent files. WIP

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

14 years agoRead/write FriendTemplateDecl for PCH.
Argyrios Kyrtzidis [Thu, 22 Jul 2010 16:04:10 +0000 (16:04 +0000)]
Read/write FriendTemplateDecl for PCH.

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

14 years agoSupport C++ try/catch statements for PCH.
Argyrios Kyrtzidis [Thu, 22 Jul 2010 16:03:56 +0000 (16:03 +0000)]
Support C++ try/catch statements for PCH.

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

14 years agoThis patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.
Zhongxing Xu [Thu, 22 Jul 2010 14:01:01 +0000 (14:01 +0000)]
This patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.

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

14 years agoMake a bunch of new data structures for the new analysis
Zhongxing Xu [Thu, 22 Jul 2010 13:52:13 +0000 (13:52 +0000)]
Make a bunch of new data structures for the new analysis
engine of the new translation unit. State marshal is there but no real
work is done. End nodes are passed back.

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

14 years agoFix '<rdar://problem/8214263> MakeCXCursor null dereference when body of block is...
Ted Kremenek [Thu, 22 Jul 2010 11:30:19 +0000 (11:30 +0000)]
Fix '<rdar://problem/8214263> MakeCXCursor null dereference when body of block is invalid' by checking that the body of a BlockDecl is null before constructing a CXCursor.

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

14 years agoUpdate test case to include USRs containing offsets instead of line/columns.
Ted Kremenek [Thu, 22 Jul 2010 11:30:17 +0000 (11:30 +0000)]
Update test case to include USRs containing offsets instead of line/columns.

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

14 years agoSwitch USR generation to use file offsets instead of line/columns for anonymous symbo...
Ted Kremenek [Thu, 22 Jul 2010 11:14:15 +0000 (11:14 +0000)]
Switch USR generation to use file offsets instead of line/columns for anonymous symbols.  Fixes <rdar://problem/8221557>.

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

14 years agoFix PR7673 by allowing an empty clobbers section in an ASM statement.
Chandler Carruth [Thu, 22 Jul 2010 07:11:21 +0000 (07:11 +0000)]
Fix PR7673 by allowing an empty clobbers section in an ASM statement.

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

14 years agoAdd alternate names for x86 SIMD intrinsics. These aren't as common, but show
Chandler Carruth [Thu, 22 Jul 2010 06:47:28 +0000 (06:47 +0000)]
Add alternate names for x86 SIMD intrinsics. These aren't as common, but show
up enough to be worth supporting properly. Fixes PR7674.

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

14 years agoThis was still complaining about the length of the string. I've broken it here
Chandler Carruth [Thu, 22 Jul 2010 06:29:13 +0000 (06:29 +0000)]
This was still complaining about the length of the string. I've broken it here
to try to keep as much logical grouping as possible.

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

14 years agotests: Make FileCheck version check that preamble isn't longer than we expected.
Daniel Dunbar [Thu, 22 Jul 2010 02:22:24 +0000 (02:22 +0000)]
tests: Make FileCheck version check that preamble isn't longer than we expected.

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

14 years agoDriver/Darwin: Set -force_cpusubtype_ALL only by default on x86.
Daniel Dunbar [Thu, 22 Jul 2010 01:47:22 +0000 (01:47 +0000)]
Driver/Darwin: Set -force_cpusubtype_ALL only by default on x86.

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

14 years agobuild: Make sure arm_neon.h gets installed.
Daniel Dunbar [Thu, 22 Jul 2010 01:19:36 +0000 (01:19 +0000)]
build: Make sure arm_neon.h gets installed.

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

14 years agoDriver/Darwin: Always allow blocks on Darwin, so that users can conditionally
Daniel Dunbar [Thu, 22 Jul 2010 00:40:31 +0000 (00:40 +0000)]
Driver/Darwin: Always allow blocks on Darwin, so that users can conditionally
use blocks even when targetting older systems (using runtime checks and weak
linking).

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

14 years agoObjCId is special "struct objc_object". Make this explicit in debug info.
Devang Patel [Wed, 21 Jul 2010 22:41:25 +0000 (22:41 +0000)]
ObjCId is special "struct objc_object". Make this explicit in debug info.
This is tested by objc-rbreak.exp in gdb testsuite.

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

14 years agoAllow loading macros from any file in the chain. WIP
Sebastian Redl [Wed, 21 Jul 2010 22:31:37 +0000 (22:31 +0000)]
Allow loading macros from any file in the chain. WIP

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

14 years agotests: XFAIL this test on win32, someone else can hunt this one down.
Daniel Dunbar [Wed, 21 Jul 2010 22:09:09 +0000 (22:09 +0000)]
tests: XFAIL this test on win32, someone else can hunt this one down.

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

14 years agoUpgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior...
Ted Kremenek [Wed, 21 Jul 2010 20:43:11 +0000 (20:43 +0000)]
Upgrade "'X' is unavailable" from a warning to an error.  This matches GCC's behavior.  Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent.  We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.

Fixes <rdar://problem/8213093>.

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

14 years agoPromote some macro-related stuff to per-file data. Fix a cache-inefficient nested...
Sebastian Redl [Wed, 21 Jul 2010 20:07:32 +0000 (20:07 +0000)]
Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.

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

14 years agotests: Use FileCheck instead of external input; I think this test was failing on
Daniel Dunbar [Wed, 21 Jul 2010 19:40:01 +0000 (19:40 +0000)]
tests: Use FileCheck instead of external input; I think this test was failing on
Win32 because of line ending differences.

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

14 years agoIntroduce a new C API function, clang_parseTranslationUnit(), which
Douglas Gregor [Wed, 21 Jul 2010 18:52:53 +0000 (18:52 +0000)]
Introduce a new C API function, clang_parseTranslationUnit(), which
will eventually replace
clang_createTranslationUnitFromSourceFile(). The only addition in
clang_parseTranslationUnit() is a set of flags that can control how
the translation unit is loaded. More interesting flags will be coming.

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

14 years agoAdded extra check when looking for location of '=' in
Fariborz Jahanian [Wed, 21 Jul 2010 18:40:47 +0000 (18:40 +0000)]
Added extra check when looking for location of '=' in
a copy initialization.

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

14 years agoFix source location of the initializer in
Fariborz Jahanian [Wed, 21 Jul 2010 18:31:47 +0000 (18:31 +0000)]
Fix source location of the initializer in
a copy initialization. Back out hack in objc rewriter.
fixes radar 8213998.

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

14 years agoCatch thinko that Daniel Dunbar found.
Nate Begeman [Wed, 21 Jul 2010 18:11:42 +0000 (18:11 +0000)]
Catch thinko that Daniel Dunbar found.

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

14 years agoFix regression caused by r108911.
Devang Patel [Wed, 21 Jul 2010 18:08:50 +0000 (18:08 +0000)]
Fix regression caused by r108911.
Do not override known debug loc with unknown debug loc.
This is tested by sections.exp in gdb testsuite.

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

14 years agoFix a rewriter bug which originates in SemaInit involving
Fariborz Jahanian [Wed, 21 Jul 2010 17:36:39 +0000 (17:36 +0000)]
Fix a rewriter bug which originates in SemaInit involving
Constructor Initialization which computes Source Location
differently now. Fixes radar 8213998.

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

14 years agoDon't crash when sending a message inside a block with the non-fragile ABI (GNU runtime).
David Chisnall [Wed, 21 Jul 2010 15:28:28 +0000 (15:28 +0000)]
Don't crash when sending a message inside a block with the non-fragile ABI (GNU runtime).

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

14 years agoMark the load after calling objc_msg_lookup_sender() so that it doesn't get optimised...
David Chisnall [Wed, 21 Jul 2010 12:55:25 +0000 (12:55 +0000)]
Mark the load after calling objc_msg_lookup_sender() so that it doesn't get optimised away (GNU runtime).

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

14 years agoRename LazyCleanup -> Cleanup. No functionality change for these last three
John McCall [Wed, 21 Jul 2010 07:22:38 +0000 (07:22 +0000)]
Rename LazyCleanup -> Cleanup.  No functionality change for these last three
commits.

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

14 years agoRip out EHCleanupScope.
John McCall [Wed, 21 Jul 2010 07:11:21 +0000 (07:11 +0000)]
Rip out EHCleanupScope.

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

14 years agoKill the CleanupBlock API.
John McCall [Wed, 21 Jul 2010 07:04:01 +0000 (07:04 +0000)]
Kill the CleanupBlock API.

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

14 years agoSwitch the fragile-ABI @finally/@synchronized cleanup over to using a lazy
John McCall [Wed, 21 Jul 2010 06:59:36 +0000 (06:59 +0000)]
Switch the fragile-ABI @finally/@synchronized cleanup over to using a lazy
cleanup.

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

14 years agoCode simplification.
John McCall [Wed, 21 Jul 2010 06:45:54 +0000 (06:45 +0000)]
Code simplification.

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