]> granicus.if.org Git - clang/log
clang
11 years agoPropagate CharUnits into ObjC CodeGen. No intended functional change.
Eli Friedman [Tue, 6 Nov 2012 01:51:20 +0000 (01:51 +0000)]
Propagate CharUnits into ObjC CodeGen.  No intended functional change.

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

11 years agoPer discussion on cfe-commits, treat -faddress-sanitizer,
Richard Smith [Tue, 6 Nov 2012 01:12:02 +0000 (01:12 +0000)]
Per discussion on cfe-commits, treat -faddress-sanitizer,
-fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and
-fcatch-undefined-behavior as deprecated: produce a warning if they are used
pointing to the corresponding -fsanitize= option. In passing add the missing
'-' to some diagnostics.

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

11 years ago[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.
Argyrios Kyrtzidis [Tue, 6 Nov 2012 00:35:04 +0000 (00:35 +0000)]
[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.

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

11 years ago[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
Argyrios Kyrtzidis [Tue, 6 Nov 2012 00:35:02 +0000 (00:35 +0000)]
[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
reference instead of relying on computing it.

In general, if storage is no issue, it is preferable to deserialize info from
the PCH instead of trying to recompute it after the PCH was loaded.

The incentive to change this now was due to r155303 changing how friend template
classes in dependent contexts are handled; such classes can now be chained to
a previous template class but the computed InjectedClassNameType may be different
due to the extra template parameters from the dependent context.

The new handling requires more investigation but, in the meantime, writing out
InjectedClassNameType fixes PCH issue in rdar://12627738.

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

11 years agoHave the parser initialize Sema before it consumes the first
Douglas Gregor [Mon, 5 Nov 2012 23:58:27 +0000 (23:58 +0000)]
Have the parser initialize Sema before it consumes the first
token. This is important because the first token could actually be
after an #include that triggers a module import, which might use
either Sema or the AST consumer before it would have been initialized.

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

11 years agoSplit the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
Douglas Gregor [Mon, 5 Nov 2012 23:30:26 +0000 (23:30 +0000)]
Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
that we can model them as separate submodules.

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

11 years agoFrontend: Add support for reading named pipes as the main file.
Daniel Dunbar [Mon, 5 Nov 2012 22:53:33 +0000 (22:53 +0000)]
Frontend: Add support for reading named pipes as the main file.

 - The whole {File,Source}Manager is built around wanting to pre-determine the
   size of files, so we can't fit this in naturally. Instead, we handle it like
   we do STDIN, where we just replace the main file contents upfront.

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

11 years agoDelete comment I forgot to delete in my last change.
Nico Weber [Mon, 5 Nov 2012 22:50:26 +0000 (22:50 +0000)]
Delete comment I forgot to delete in my last change.

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

11 years agoUse Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.
Nico Weber [Mon, 5 Nov 2012 22:49:03 +0000 (22:49 +0000)]
Use Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.

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

11 years agoARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
Manman Ren [Mon, 5 Nov 2012 22:42:46 +0000 (22:42 +0000)]
ARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
the type alignment of the byval argument. This patch will disable byval in this case,
it also increases the size threshold for turning on byval.

A backend fix will be attempted.

rdar://12596507

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

11 years agoUse the individual -fsanitize=<...> arguments to control which of the UBSan
Richard Smith [Mon, 5 Nov 2012 22:21:05 +0000 (22:21 +0000)]
Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.

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

11 years agoAdd -fsanitize=<sanitizers> argument to driver and frontend, and add
Richard Smith [Mon, 5 Nov 2012 22:04:41 +0000 (22:04 +0000)]
Add -fsanitize=<sanitizers> argument to driver and frontend, and add
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the
various UBSan checks to be enabled and disabled separately. Right now, the
different modes can't be combined, but the intention is that combining UBSan
and the other sanitizers will be permitted in the near future.

Currently, the UBSan checks will all be enabled if any of them is; that will be
fixed by the next patch.

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

11 years agoRename LangOptions members for address sanitizer and thread sanitizer from
Richard Smith [Mon, 5 Nov 2012 21:48:12 +0000 (21:48 +0000)]
Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.

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

11 years agoFix module map for SSE4a builtins
Douglas Gregor [Mon, 5 Nov 2012 20:41:30 +0000 (20:41 +0000)]
Fix module map for SSE4a builtins

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

11 years agoMake cpuid.h actually work with -std=c99 <rdar://problem/12552716>.
Douglas Gregor [Mon, 5 Nov 2012 20:11:10 +0000 (20:11 +0000)]
Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.

While we're here, extend the module map to cover most of the
newly-added instrinsic headers. Only wmmintrin.h is missing, because
it needs to be split into AES/PCLMUL subheaders (as a separate commit).

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

11 years agoHash the various compiler version, target, preprocessor, and
Douglas Gregor [Mon, 5 Nov 2012 19:45:09 +0000 (19:45 +0000)]
Hash the various compiler version, target, preprocessor, and
header-search options into the module hash. We're just using
ADT/Hashing.hpp for this, which isn't as cryptographically strong as
I'd like, but it'll do. If someone contributes (say) and MD4
implementation, we'd happily switch to that.

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

11 years agoOn PowerPC64, integer arguments and return values need to be sign- or
Ulrich Weigand [Mon, 5 Nov 2012 19:13:42 +0000 (19:13 +0000)]
On PowerPC64, integer arguments and return values need to be sign- or
zero-extended to 64 bits.  This information is currently provided to
the back end by setting "signext" or "zeroext" attributes.  However,
this is done only for integer types *smaller* than i32, not for i32
itself.  This causes clang to generate code violating the ABI, which
results in a failure of the tramp3d-v4 test case (due to calling a
system library routine without ABI-required extension).

This patch implements custom versions of classifyArgumentType and
classifyReturnType for PPC64_SVR4_ABIInfo, which are the same as the
default versions except that they also classify "int" and "unsigned int"
as types needing extending.  This fixed tramp3d-v4 on PowerPC64.

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

11 years agoTests for 32bit version of block ivar layout metadata.
Fariborz Jahanian [Mon, 5 Nov 2012 18:14:34 +0000 (18:14 +0000)]
Tests for 32bit version of block ivar layout metadata.

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

11 years ago[analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h
Jordan Rose [Mon, 5 Nov 2012 16:58:00 +0000 (16:58 +0000)]
[analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h

As Anna pointed out, ProgramStateTrait.h is a relatively obscure header,
and checker writers may not know to look there to add their own custom
state.

The base macro that specializes the template remains in ProgramStateTrait.h
(REGISTER_TRAIT_WITH_PROGRAMSTATE), which allows the analyzer core to keep
using it.

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

11 years agoOur style for diagnostic messages is to not include a trailing dot.
Matt Beaumont-Gay [Mon, 5 Nov 2012 05:32:00 +0000 (05:32 +0000)]
Our style for diagnostic messages is to not include a trailing dot.

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

11 years agoPut the usage-directive inside the nearest namespace or TU decl. We don't want
Nick Lewycky [Sun, 4 Nov 2012 20:21:54 +0000 (20:21 +0000)]
Put the usage-directive inside the nearest namespace or TU decl. We don't want
to have UsingDirectiveDecl inside anything other than those two.

No user-visible functionality change.

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

11 years agoFixes liftime of captured block variables in mrr mode, per John's feedback, as
Fariborz Jahanian [Sun, 4 Nov 2012 18:19:40 +0000 (18:19 +0000)]
Fixes liftime of captured block variables in mrr mode, per John's feedback, as
well as couple of tests which were not being excercised because of TYPOs.

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

11 years agoTest case for r167363.
Lang Hames [Sun, 4 Nov 2012 05:08:08 +0000 (05:08 +0000)]
Test case for r167363.

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

11 years agoonly truncate source lines in text diagnostics when
Seth Cantrell [Sat, 3 Nov 2012 23:56:43 +0000 (23:56 +0000)]
only truncate source lines in text diagnostics when
the ellipsis is shorter than the text it replaces

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

11 years agoSupport interleaving of other pragmas with FP_CONTRACT at the beginning of a
Lang Hames [Sat, 3 Nov 2012 22:29:05 +0000 (22:29 +0000)]
Support interleaving of other pragmas with FP_CONTRACT at the beginning of a
compound statement.

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

11 years agoAddress review comments for r167358: explicitly check for CK_BitCast instead of
Dmitri Gribenko [Sat, 3 Nov 2012 22:10:18 +0000 (22:10 +0000)]
Address review comments for r167358: explicitly check for CK_BitCast instead of
checking against a blacklist.

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

11 years agodon't step into the middle of multibyte sequences
Seth Cantrell [Sat, 3 Nov 2012 21:21:17 +0000 (21:21 +0000)]
don't step into the middle of multibyte sequences

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

11 years agofix bug in SourceColumnMap::startOfPreviousColumn
Seth Cantrell [Sat, 3 Nov 2012 21:21:14 +0000 (21:21 +0000)]
fix bug in SourceColumnMap::startOfPreviousColumn

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

11 years agoEscape trigraphs in unittest.
Benjamin Kramer [Sat, 3 Nov 2012 20:58:26 +0000 (20:58 +0000)]
Escape trigraphs in unittest.

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

11 years agoHandle CK_NullToPointer casts in -Wtype-safety properly. Fixes PR14249.
Dmitri Gribenko [Sat, 3 Nov 2012 16:07:49 +0000 (16:07 +0000)]
Handle CK_NullToPointer casts in -Wtype-safety properly.  Fixes PR14249.

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

11 years agoRemove a const_cast by propagating constness to the member function.
Dmitri Gribenko [Sat, 3 Nov 2012 14:24:57 +0000 (14:24 +0000)]
Remove a const_cast by propagating constness to the member function.

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

11 years agoStaticAnalyzer/Core/ExprEngineCallAndReturn.cpp: Appease msvc.
NAKAMURA Takumi [Sat, 3 Nov 2012 13:59:36 +0000 (13:59 +0000)]
StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp: Appease msvc.

0 (as nullptr) is incompatible to pointer in type matching on msvc.

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

11 years agoAdd a proper algorithm to compute accurate source ranges for diagnostics with
Eli Friedman [Sat, 3 Nov 2012 03:36:51 +0000 (03:36 +0000)]
Add a proper algorithm to compute accurate source ranges for diagnostics with
caret locations and source ranges in macros.  Makes ranges more accurate
in some cases, and fixes an assertion failure.

Fixes <rdar://problem/12472249>.

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

11 years ago[analyzer] Run remove dead on end of path.
Anna Zaks [Sat, 3 Nov 2012 02:54:20 +0000 (02:54 +0000)]
[analyzer] Run remove dead on end of path.

This will simplify checkers that need to register for leaks. Currently,
they have to register for both: check dead and check end of path.

I've modified the SymbolReaper to consider everything on the stack dead
if the input StackLocationContext is 0.

(This is a bit disruptive, so I'd like to flash out all the issues
asap.)

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

11 years ago[analyzer] add LocationContext::inTopFrame() helper.
Anna Zaks [Sat, 3 Nov 2012 02:54:16 +0000 (02:54 +0000)]
[analyzer] add LocationContext::inTopFrame() helper.

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

11 years ago[analyzer] Refactor: Remove Pred from NodeBuilderContext.
Anna Zaks [Sat, 3 Nov 2012 02:54:11 +0000 (02:54 +0000)]
[analyzer] Refactor: Remove Pred from NodeBuilderContext.

Node builders should manage the nodes, not the context.

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

11 years agoSimplify these tests again, now that we're past the version skew.
David Blaikie [Sat, 3 Nov 2012 00:27:14 +0000 (00:27 +0000)]
Simplify these tests again, now that we're past the version skew.

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

11 years ago[analyzer] Convert SimpleStreamChecker over to CallEvent.
Jordan Rose [Fri, 2 Nov 2012 23:49:35 +0000 (23:49 +0000)]
[analyzer] Convert SimpleStreamChecker over to CallEvent.

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

11 years ago[analyzer] CheckerDocumentation: Change examples for PreStmt and PostStmt.
Jordan Rose [Fri, 2 Nov 2012 23:49:33 +0000 (23:49 +0000)]
[analyzer] CheckerDocumentation: Change examples for PreStmt and PostStmt.

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

11 years ago[analyzer] Add some convenience accessors to CallEvent, and use them.
Jordan Rose [Fri, 2 Nov 2012 23:49:29 +0000 (23:49 +0000)]
[analyzer] Add some convenience accessors to CallEvent, and use them.

These are CallEvent-equivalents of helpers already accessible in
CheckerContext, as part of making it easier for new checkers to be written
using CallEvent rather than raw CallExprs.

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

11 years ago[analyzer] isCLibraryFunction: check that the function is at TU-scope.
Jordan Rose [Fri, 2 Nov 2012 23:49:24 +0000 (23:49 +0000)]
[analyzer] isCLibraryFunction: check that the function is at TU-scope.

Also, Decls already carry a pointer to the ASTContext, so there's no need
to pass an extra argument to the predicate.

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

11 years agoEmit debug info for C++ struct definitions as DW_TAG_structure_type (instead of class...
David Blaikie [Fri, 2 Nov 2012 23:40:00 +0000 (23:40 +0000)]
Emit debug info for C++ struct definitions as DW_TAG_structure_type (instead of class_type).

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

11 years agoAvoid version skew by making ObjC strict metadata tests resilient to new field.
David Blaikie [Fri, 2 Nov 2012 23:07:41 +0000 (23:07 +0000)]
Avoid version skew by making ObjC strict metadata tests resilient to new field.

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

11 years agoobjective-C mrr block. Block variable layout metadata in
Fariborz Jahanian [Fri, 2 Nov 2012 22:51:18 +0000 (22:51 +0000)]
objective-C mrr block. Block variable layout metadata in
mrr mode.

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

11 years agoWhen code-completing don't disable the preprocessing record if modules are enabled.
Argyrios Kyrtzidis [Fri, 2 Nov 2012 22:18:44 +0000 (22:18 +0000)]
When code-completing don't disable the preprocessing record if modules are enabled.

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

11 years agoThread safety analysis: Fixed ICE caused by double delete when late parsed
DeLesley Hutchins [Fri, 2 Nov 2012 21:44:32 +0000 (21:44 +0000)]
Thread safety analysis: Fixed ICE caused by double delete when late parsed
attributes are attached to function declarations nested inside a class method.

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

11 years agoFix test cases I broken when fixing grammar in diagnostic message.
Richard Trieu [Fri, 2 Nov 2012 21:41:42 +0000 (21:41 +0000)]
Fix test cases I broken when fixing grammar in diagnostic message.

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

11 years agoFix grammar of diagnostic message.
Richard Trieu [Fri, 2 Nov 2012 21:33:17 +0000 (21:33 +0000)]
Fix grammar of diagnostic message.

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

11 years ago[analyzer] Test SimpleStream on the buildbot.
Anna Zaks [Fri, 2 Nov 2012 21:30:07 +0000 (21:30 +0000)]
[analyzer] Test SimpleStream on the buildbot.

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

11 years ago[analyzer] Factor SimpleStreamChecker pulling out isLeaked().
Anna Zaks [Fri, 2 Nov 2012 21:30:04 +0000 (21:30 +0000)]
[analyzer] Factor SimpleStreamChecker pulling out isLeaked().

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

11 years agoFix debug tag type of forward declarations of struct/class in C++.
David Blaikie [Fri, 2 Nov 2012 20:49:01 +0000 (20:49 +0000)]
Fix debug tag type of forward declarations of struct/class in C++.

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

11 years agoImprove x86 android support:
Rafael Espindola [Fri, 2 Nov 2012 20:41:30 +0000 (20:41 +0000)]
Improve x86 android support:
* -Bsymbolic must be added for x86 as well.
* Default CPU name also set to 'core2' for x86 android.
Patch by Edwin Vane.

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

11 years agoAdd test for link flags added by -fcatch-undefined-behavior.
Richard Smith [Fri, 2 Nov 2012 20:34:30 +0000 (20:34 +0000)]
Add test for link flags added by -fcatch-undefined-behavior.

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

11 years agoAdd -lpthread when building with Ubsan on Linux, in preparation for making libclang...
Richard Smith [Fri, 2 Nov 2012 20:32:19 +0000 (20:32 +0000)]
Add -lpthread when building with Ubsan on Linux, in preparation for making libclang-rt.ubsan pull in sanitizer_common, which in turn depends on pthreads.

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

11 years agoUpdate test case.
Ted Kremenek [Fri, 2 Nov 2012 17:50:53 +0000 (17:50 +0000)]
Update test case.

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

11 years agoMove -Wimplicit-retain-self to be off-by-default until we can evaluate
Ted Kremenek [Fri, 2 Nov 2012 17:48:49 +0000 (17:48 +0000)]
Move -Wimplicit-retain-self to be off-by-default until we can evaluate
more how noisy it is.

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

11 years agoclang/test/CodeGen/bitfield-promote.c: Add explicit triple for now. It has been faili...
NAKAMURA Takumi [Fri, 2 Nov 2012 09:59:12 +0000 (09:59 +0000)]
clang/test/CodeGen/bitfield-promote.c: Add explicit triple for now. It has been failing for big endian targets, for example, ppc.

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

11 years agoclang/test/CodeGen/bitfield-promote.c: FileCheck-ize.
NAKAMURA Takumi [Fri, 2 Nov 2012 09:59:06 +0000 (09:59 +0000)]
clang/test/CodeGen/bitfield-promote.c: FileCheck-ize.

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

11 years agoDelete lines which do nothing from DiagnosticGroups.td.
Eli Friedman [Fri, 2 Nov 2012 03:35:13 +0000 (03:35 +0000)]
Delete lines which do nothing from DiagnosticGroups.td.

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

11 years ago[libclang] Correct how the index inside the local preprocessed entities array
Argyrios Kyrtzidis [Fri, 2 Nov 2012 02:31:22 +0000 (02:31 +0000)]
[libclang] Correct how the index inside the local preprocessed entities array
is getting converted to a global PreprocessedEntityID.

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

11 years agoAdd missing diagnostic group to format string warning.
Eli Friedman [Fri, 2 Nov 2012 02:14:44 +0000 (02:14 +0000)]
Add missing diagnostic group to format string warning.

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

11 years agoanalyzer-plugin/MainCallChecker.cpp: Fixup corresponding to r167275.
NAKAMURA Takumi [Fri, 2 Nov 2012 02:04:01 +0000 (02:04 +0000)]
analyzer-plugin/MainCallChecker.cpp: Fixup corresponding to r167275.

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

11 years ago[analyzer] Convert some of the harder cases over to ProgramStateTrait macros.
Jordan Rose [Fri, 2 Nov 2012 01:54:42 +0000 (01:54 +0000)]
[analyzer] Convert some of the harder cases over to ProgramStateTrait macros.

Add FIXMEs for the traits visible from multiple translation units.
Currently the macros hide their key types in an anonymous namespace.

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

11 years ago[analyzer] Use nice macros for the common ProgramStateTraits (map, set, list).
Jordan Rose [Fri, 2 Nov 2012 01:54:06 +0000 (01:54 +0000)]
[analyzer] Use nice macros for the common ProgramStateTraits (map, set, list).

Also, move the REGISTER_*_WITH_PROGRAMSTATE macros to ProgramStateTrait.h.

This doesn't get rid of /all/ explicit uses of ProgramStatePartialTrait,
but it does get a lot of them.

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

11 years ago[analyzer] Rename 'EmitReport' to 'emitReport'.
Jordan Rose [Fri, 2 Nov 2012 01:53:40 +0000 (01:53 +0000)]
[analyzer] Rename 'EmitReport' to 'emitReport'.

No functionality change.

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

11 years agoTweak wording and add diagnostic groups to misc diagnostics.
Eli Friedman [Fri, 2 Nov 2012 01:40:23 +0000 (01:40 +0000)]
Tweak wording and add diagnostic groups to misc diagnostics.

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

11 years agoChange diagnostics for enums with fixed underlying type so in C++98 mode, we cite...
Eli Friedman [Fri, 2 Nov 2012 01:34:28 +0000 (01:34 +0000)]
Change diagnostics for enums with fixed underlying type so in C++98 mode, we cite C++11.

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

11 years agoInsert interception point onStartOfTranslationUnit.
Manuel Klimek [Fri, 2 Nov 2012 01:31:03 +0000 (01:31 +0000)]
Insert interception point onStartOfTranslationUnit.

Often users of the ASTMatchers want to add tasks that are done once per
translation unit, for example, cleaning up caches. Combined with the
interception point for the end of source file one can add to the factory
creation, this covers the cases we've seen users need.

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

11 years agoWhen finding a '(' after '::', emit error with hint to remove '(' and matching
Richard Trieu [Fri, 2 Nov 2012 01:08:58 +0000 (01:08 +0000)]
When finding a '(' after '::', emit error with hint to remove '(' and matching
')', if found.  Don't crash.
Fixes PR11852.

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

11 years agoUpdate the front end to use minsize attribute
Quentin Colombet [Thu, 1 Nov 2012 23:55:47 +0000 (23:55 +0000)]
Update the front end to use minsize attribute

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

11 years agoSimplify: replace getContext().getLangOpts() with just getLangOpts().
Richard Smith [Thu, 1 Nov 2012 22:30:59 +0000 (22:30 +0000)]
Simplify: replace getContext().getLangOpts() with just getLangOpts().

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

11 years agoClean up misapplication of diff.
Richard Smith [Thu, 1 Nov 2012 22:16:43 +0000 (22:16 +0000)]
Clean up misapplication of diff.

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

11 years agoSplit emission of -ftrapv checks and -fcatch-undefined-behavior checks into
Richard Smith [Thu, 1 Nov 2012 22:15:34 +0000 (22:15 +0000)]
Split emission of -ftrapv checks and -fcatch-undefined-behavior checks into
separate functions, since they share essentially no code.

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

11 years agoRemove divison-by-zero checks from -ftrapv. These checks were incompatible with
Richard Smith [Thu, 1 Nov 2012 22:13:39 +0000 (22:13 +0000)]
Remove divison-by-zero checks from -ftrapv. These checks were incompatible with
g++'s -ftrapv, failed to call the -ftrapv overflow handler, and are still
available under -fcatch-undefined-behavior.

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

11 years agoFix the template type diffing to handle integral template arguments.
Richard Trieu [Thu, 1 Nov 2012 21:29:28 +0000 (21:29 +0000)]
Fix the template type diffing to handle integral template arguments.

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

11 years agoSilence -Wformat on platforms where uint64_t is unsigned long.
Matt Beaumont-Gay [Thu, 1 Nov 2012 20:26:42 +0000 (20:26 +0000)]
Silence -Wformat on platforms where uint64_t is unsigned long.

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

11 years agoobjective-C block meta-data. This patch completes meta-data
Fariborz Jahanian [Thu, 1 Nov 2012 18:32:55 +0000 (18:32 +0000)]
objective-C block meta-data. This patch completes meta-data
generation for captured block variables in arc mode. This includes
inlined version of the meta-data when it can be done. It also includes
severat tests. This is wip. // rdar://12184410.

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

11 years agoMake the FilenameRange of the InclusionDirective callback more accurate,
Argyrios Kyrtzidis [Thu, 1 Nov 2012 17:52:58 +0000 (17:52 +0000)]
Make the FilenameRange of the InclusionDirective callback more accurate,
preserve the macro location of the range end if the filename came from a macro.

Patch by Kim Gräsman!

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

11 years agoFix an incorrect assert, the LHS can be an LValue.
Rafael Espindola [Thu, 1 Nov 2012 14:32:20 +0000 (14:32 +0000)]
Fix an incorrect assert, the LHS can be an LValue.

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

11 years ago-fcatch-undefined-behavior: Start checking loads and stores for null pointers.
Richard Smith [Thu, 1 Nov 2012 07:22:08 +0000 (07:22 +0000)]
-fcatch-undefined-behavior: Start checking loads and stores for null pointers.
We want the diagnostic, and if the load is optimized away, we still want to
trap it. Stop checking non-default address spaces; that doesn't work in
general.

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

11 years ago[clang.py] Add Cursor.get_arguments()
Gregory Szorc [Thu, 1 Nov 2012 05:46:30 +0000 (05:46 +0000)]
[clang.py] Add Cursor.get_arguments()

Patch provided by Matthias Kleine <matthias_kleine@gmx.de>

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

11 years agoRemove first argument from Arg::getValue; it's been unused since r105760.
Richard Smith [Thu, 1 Nov 2012 04:30:05 +0000 (04:30 +0000)]
Remove first argument from Arg::getValue; it's been unused since r105760.

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

11 years agoRemove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
Richard Smith [Thu, 1 Nov 2012 03:48:49 +0000 (03:48 +0000)]
Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).

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

11 years ago[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
Argyrios Kyrtzidis [Thu, 1 Nov 2012 02:01:34 +0000 (02:01 +0000)]
[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

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

11 years agoclang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease...
NAKAMURA Takumi [Thu, 1 Nov 2012 01:47:02 +0000 (01:47 +0000)]
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease msvc.

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

11 years ago[analyzer] Optimize assumeDual by assuming constraint managers are consistent.
Jordan Rose [Thu, 1 Nov 2012 01:05:39 +0000 (01:05 +0000)]
[analyzer] Optimize assumeDual by assuming constraint managers are consistent.

Specifically, if adding a constraint makes the current system infeasible,
assume the constraint is false, instead of attempting to add its negation.

In +Asserts builds we will still assert that at least one state is feasible.

Patch by Ryan Govostes!

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

11 years ago[lit] For the "case-insensitive-filesystem" make sure to create the test temporary...
Argyrios Kyrtzidis [Thu, 1 Nov 2012 00:59:15 +0000 (00:59 +0000)]
[lit] For the "case-insensitive-filesystem" make sure to create the test temporary file
in the test output directory.

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

11 years ago[analyzer] Fix typo in r167186.
Jordan Rose [Thu, 1 Nov 2012 00:25:15 +0000 (00:25 +0000)]
[analyzer] Fix typo in r167186.

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

11 years agoclang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.
NAKAMURA Takumi [Thu, 1 Nov 2012 00:20:00 +0000 (00:20 +0000)]
clang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.

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

11 years ago[analyzer] Minor cleanup in SimpleStreamChecker's class definition.
Jordan Rose [Thu, 1 Nov 2012 00:18:41 +0000 (00:18 +0000)]
[analyzer] Minor cleanup in SimpleStreamChecker's class definition.

No functionality change.

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

11 years ago[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.
Jordan Rose [Thu, 1 Nov 2012 00:18:27 +0000 (00:18 +0000)]
[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.

(and the same for isFalse)

No functionality change.

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

11 years agoCorrectly reject gotos in function-level try blocks. PR14225.
Eli Friedman [Wed, 31 Oct 2012 23:55:28 +0000 (23:55 +0000)]
Correctly reject gotos in function-level try blocks.  PR14225.

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

11 years ago[analyzer] Fix a bug in SimpleStreamChecker - return after sink.
Anna Zaks [Wed, 31 Oct 2012 22:17:48 +0000 (22:17 +0000)]
[analyzer] Fix a bug in SimpleStreamChecker - return after sink.

Thanks Ted.

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

11 years ago[driver] Remove an extra space with the -iprefix option, so that
Chad Rosier [Wed, 31 Oct 2012 21:08:30 +0000 (21:08 +0000)]
[driver] Remove an extra space with the -iprefix option, so that
matching works correctly.
Part of rdar://12329974

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

11 years ago[PCH] Remove the stat cache from the PCH file.
Argyrios Kyrtzidis [Wed, 31 Oct 2012 20:59:50 +0000 (20:59 +0000)]
[PCH] Remove the stat cache from the PCH file.

The stat cache became essentially useless ever since we started
validating all file entries in the PCH.
But the motivating reason for removing it now is that it also affected
correctness in this situation:

-You have a header without include guards (using "#pragma once" or #import)
-When creating the PCH:
  -The same header is referenced in an #include with different filename cases.
  -In the PCH, of course, we record only one file entry for the header file
  -But we cache in the PCH file the stat info for both filename cases

-Then the source files are updated and the header file is updated in a way that
 its size and modification time are the same but its inode changes

-When using the PCH:
  -We validate the headers, we check that header file and we create a file entry with its current inode
  -There's another #include with a filename with different case than the previously created file entry
  -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode
  -because of the different inodes, we think they are different files so we go ahead and include its contents.

Removing the stat cache will potentially break clients that are attempting to use the stat cache
as a way of avoiding having the actual input files available. If that use case is important, patches are welcome
to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with
literal strings, line/column computations, etc.).

This fixes rdar://5502805

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

11 years ago[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to...
Michael Gottesman [Wed, 31 Oct 2012 20:20:04 +0000 (20:20 +0000)]
[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to ensure it only runs on ppc64.

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

11 years ago[driver] Remove an extra space with the -internal-externc-isystem option, so
Chad Rosier [Wed, 31 Oct 2012 19:28:55 +0000 (19:28 +0000)]
[driver] Remove an extra space with the -internal-externc-isystem option, so
that matching works correctly.
Part of rdar://12329974

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

11 years agoARM AAPCS-VFP: fix tracking of allocated VFP registers.
Manman Ren [Wed, 31 Oct 2012 19:02:26 +0000 (19:02 +0000)]
ARM AAPCS-VFP: fix tracking of allocated VFP registers.

According to the spec, we can backfill VFP registers that were skipped due
to alignment constraints.

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

11 years ago[driver] Remove the -ccc-host-triple alias. This has been replaced by the
Chad Rosier [Wed, 31 Oct 2012 18:59:38 +0000 (18:59 +0000)]
[driver] Remove the -ccc-host-triple alias.  This has been replaced by the
-target option.
rdar://10692880

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

11 years agogetArchTypeForDarwinArchName is only used in the clang driver, copy it there.
Rafael Espindola [Wed, 31 Oct 2012 18:51:07 +0000 (18:51 +0000)]
getArchTypeForDarwinArchName is only used in the clang driver, copy it there.
I will remove it from llvm in the next commit.

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