]> granicus.if.org Git - clang/log
clang
12 years agoFollow up on llvm r164132.
Roman Divacky [Tue, 18 Sep 2012 16:09:16 +0000 (16:09 +0000)]
Follow up on llvm r164132.

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

12 years agoWarn about self references in in-class initializers.
Hans Wennborg [Tue, 18 Sep 2012 15:58:06 +0000 (15:58 +0000)]
Warn about self references in in-class initializers.

This makes Clang warn about self references in in-class initializers,
for example:

  struct S {
    int a = a + 42;
  };

This basically just moves UninitializedFieldVisitor up a bit in
SemaDeclCXX.cpp, and adds a call to it from ActOnCXXInClassMemberInitializer.

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

12 years agoFix isDerivedFrom matcher.
Daniel Jasper [Tue, 18 Sep 2012 14:17:42 +0000 (14:17 +0000)]
Fix isDerivedFrom matcher.

Without this patch, the isDerivedFrom matcher asserts in the
"assert(ClassDecl != NULL);" in the new test, as a
DependentTemplateSpecilizationType is not a sub-type of
TemplateSpecializationType and also does not offer getAsCXXRecordDecl().

I am not sure why this did not cause problems before. It is now (after
the changed implementation of isDerivedFrom) easier to write a matcher
that actually gets into this branch of the code.

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

12 years agoAdd missing matcher for C-style cast expressions.
Daniel Jasper [Tue, 18 Sep 2012 13:36:17 +0000 (13:36 +0000)]
Add missing matcher for C-style cast expressions.

Patch by Gábor Horváth.

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

12 years agoDisable some tests that fail when the x86 backend isn't built.
Benjamin Kramer [Tue, 18 Sep 2012 13:34:01 +0000 (13:34 +0000)]
Disable some tests that fail when the x86 backend isn't built.

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

12 years agoMake all VariadicDynCast-Expr-matchers StatementMatchers
Daniel Jasper [Tue, 18 Sep 2012 13:09:13 +0000 (13:09 +0000)]
Make all VariadicDynCast-Expr-matchers StatementMatchers

Having Expr-subclass-matchers being VariadicDynCast-Expr-matchers does
not provide additional type safety and just makes using them harder. In
the clang AST, expressions are always statements and an expression
matcher can be used anywhere, a statement matcher is expected. Any given
matcher definition still has at least one noun.

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

12 years agoRemove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.
Craig Topper [Tue, 18 Sep 2012 05:34:55 +0000 (05:34 +0000)]
Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.

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

12 years agoRemove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.
Craig Topper [Tue, 18 Sep 2012 05:30:57 +0000 (05:30 +0000)]
Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.

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

12 years agoRemove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.
Craig Topper [Tue, 18 Sep 2012 05:21:59 +0000 (05:21 +0000)]
Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.

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

12 years agoMark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_...
Craig Topper [Tue, 18 Sep 2012 04:52:05 +0000 (04:52 +0000)]
Mark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_FUNCTION.

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

12 years agoIf a comma operator is followed by a token which unambiguously indicates the
Richard Smith [Tue, 18 Sep 2012 00:52:05 +0000 (00:52 +0000)]
If a comma operator is followed by a token which unambiguously indicates the
start of a statement or the end of a compound-statement, diagnose the comma as
a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and
minor refactoring by me.

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

12 years agoPer discussion on cfe-dev, remove -Wunique-enums entirely. There
Ted Kremenek [Tue, 18 Sep 2012 00:41:42 +0000 (00:41 +0000)]
Per discussion on cfe-dev, remove -Wunique-enums entirely.  There
is no compelling argument that this is a generally useful warning,
and imposes a strong stylistic argument on code beyond what it was
intended to find warnings in.

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

12 years agoobjective-C: don't warn about class extension property's
Fariborz Jahanian [Mon, 17 Sep 2012 23:57:35 +0000 (23:57 +0000)]
objective-C: don't warn about class extension property's
missing 'assign' attribute as it is determined by its
overridden property in primary class. // rdar://12214070

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

12 years agoobjective-C: add Doug's test for my last patch.
Fariborz Jahanian [Mon, 17 Sep 2012 23:24:36 +0000 (23:24 +0000)]
objective-C: add Doug's test for my last patch.

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

12 years agoobjective-C: improve on warnings about misplacement of method
Fariborz Jahanian [Mon, 17 Sep 2012 23:09:59 +0000 (23:09 +0000)]
objective-C: improve on warnings about misplacement of method
argument names. // rdar://12263549

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

12 years agoAdded an example of an empty case label to avoid confusion.
Alexander Kornienko [Mon, 17 Sep 2012 21:45:21 +0000 (21:45 +0000)]
Added an example of an empty case label to avoid confusion.

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

12 years agoobjective-C: peroform property attribute consistency
Fariborz Jahanian [Mon, 17 Sep 2012 20:57:19 +0000 (20:57 +0000)]
objective-C: peroform property attribute consistency
checking on property declared in class extension.
// rdar://12214070

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

12 years agoobjective-C: issue warning when there is no whitespace
Fariborz Jahanian [Mon, 17 Sep 2012 19:15:26 +0000 (19:15 +0000)]
objective-C: issue warning when there is no whitespace
between objc method parameter name and colon.
// rdar://12263549

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

12 years ago[analyzer] Teach the analyzer about implicit initialization of statics
Anna Zaks [Mon, 17 Sep 2012 19:13:56 +0000 (19:13 +0000)]
[analyzer] Teach the analyzer about implicit initialization of statics
in ObjCMethods.

Extend FunctionTextRegion to represent ObjC methods as well as
functions. Note, it is not clear what type ObjCMethod region should
return. Since the type of the FunctionText region is not currently used,
defer solving this issue.

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

12 years ago-Warc-retain-cycles: look through [^{...} copy] and Block_copy(^{...})
Jordan Rose [Mon, 17 Sep 2012 17:54:30 +0000 (17:54 +0000)]
-Warc-retain-cycles: look through [^{...} copy] and Block_copy(^{...})

Retain cycles happen in the case where a block is persisted past its
life on the stack, and the way that occurs is by copying the block.
We should thus look through any explicit copies we see.

Note that Block_copy is actually a type-safe wrapper for _Block_copy,
which does all the real work.

<rdar://problem/12219663>

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

12 years agoDon't write uninitialized values even if nobody ever asks for it.
Axel Naumann [Mon, 17 Sep 2012 14:26:53 +0000 (14:26 +0000)]
Don't write uninitialized values even if nobody ever asks for it.

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

12 years agoRun install_name_tool to fix the dynamic library ID after it has been copied.
Alexander Potapenko [Mon, 17 Sep 2012 14:18:41 +0000 (14:18 +0000)]
Run install_name_tool to fix the dynamic library ID after it has been copied.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=113

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

12 years agoOpen up a few higher-level functions for tools.
Axel Naumann [Mon, 17 Sep 2012 13:14:34 +0000 (13:14 +0000)]
Open up a few higher-level functions for tools.

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

12 years agoFix dead store found by static analyzer.
Ted Kremenek [Sun, 16 Sep 2012 06:18:45 +0000 (06:18 +0000)]
Fix dead store found by static analyzer.

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

12 years agoUpdate the PCH internals documentation to cover chained precompiled
Douglas Gregor [Sun, 16 Sep 2012 01:44:02 +0000 (01:44 +0000)]
Update the PCH internals documentation to cover chained precompiled
headers and modules in more detail. I'd still like to expand on some
of the modules-related issues further, but this is a decent start.

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

12 years agoComment parsing: support \namespace like other commands that contain just a
Dmitri Gribenko [Sat, 15 Sep 2012 21:33:50 +0000 (21:33 +0000)]
Comment parsing: support \namespace like other commands that contain just a
declaration for the entity being documented.

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

12 years agoComment parsing: don't treat typedef to a typedef to a function as a
Dmitri Gribenko [Sat, 15 Sep 2012 21:13:36 +0000 (21:13 +0000)]
Comment parsing: don't treat typedef to a typedef to a function as a
'function-like' type that can be annotated with \param.

Thanks to Eli Friedman for noticing!

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

12 years agoUse LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
Dmitri Gribenko [Sat, 15 Sep 2012 20:20:27 +0000 (20:20 +0000)]
Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.

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

12 years agoMake PTHManager properly noncopyable.
Dmitri Gribenko [Sat, 15 Sep 2012 20:16:46 +0000 (20:16 +0000)]
Make PTHManager properly noncopyable.

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

12 years agoAddress a long-standing FIXME: remove an unused copy constructor and make
Dmitri Gribenko [Sat, 15 Sep 2012 19:23:53 +0000 (19:23 +0000)]
Address a long-standing FIXME: remove an unused copy constructor and make
UnqualifiedId() properly noncopyable.

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

12 years agoFix includes of llvm and clang files that used angle brackets.
Craig Topper [Sat, 15 Sep 2012 18:47:51 +0000 (18:47 +0000)]
Fix includes of llvm and clang files that used angle brackets.

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

12 years agoAdd bindings for clang_getCompletionBriefComment to cindex.py.
Dmitri Gribenko [Sat, 15 Sep 2012 11:56:32 +0000 (11:56 +0000)]
Add bindings for clang_getCompletionBriefComment to cindex.py.

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

12 years agoconst _Atomic(T) is not an atomic type, so do not allow it as the type 'A' in
Richard Smith [Sat, 15 Sep 2012 06:09:58 +0000 (06:09 +0000)]
const _Atomic(T) is not an atomic type, so do not allow it as the type 'A' in
C11 7.17's atomic operations. GNU's __atomic_* builtins do allow const-qualified
atomics, though (!!) so don't restrict those.

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

12 years agoRevert "Utilize new build system support in Xcode 4.5 for easier interposition"
Ted Kremenek [Sat, 15 Sep 2012 05:51:10 +0000 (05:51 +0000)]
Revert "Utilize new build system support in Xcode 4.5 for easier interposition"

It's not clear if this is working yet on the buildbot.  Reverting until we have
time to investigate.

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

12 years ago-Warc-retain-cycles: warn at variable initialization as well as assignment.
Jordan Rose [Sat, 15 Sep 2012 02:48:31 +0000 (02:48 +0000)]
-Warc-retain-cycles: warn at variable initialization as well as assignment.

Specifically, this should warn:

  __block block_t a = ^{ a(); };

Furthermore, this case which previously warned now does not, since the value
of 'b' is captured before the assignment occurs:

  block_t b; // not __block
  b = ^{ b(); };

(This will of course warn under -Wuninitialized, as before.)

<rdar://problem/11015883>

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

12 years agoAllow disabling PCH validation when loading an AST file by checking
Argyrios Kyrtzidis [Sat, 15 Sep 2012 01:10:20 +0000 (01:10 +0000)]
Allow disabling PCH validation when loading an AST file by checking
an environment variable for debugging purposes.

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

12 years agocompiler-rt/darwin: Install asan_osx_dynamic with the other runtime libraries.
Daniel Dunbar [Fri, 14 Sep 2012 21:30:17 +0000 (21:30 +0000)]
compiler-rt/darwin: Install asan_osx_dynamic with the other runtime libraries.

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

12 years agoIn StringLiteral::setString make sure that we copy the number of
Argyrios Kyrtzidis [Fri, 14 Sep 2012 21:17:41 +0000 (21:17 +0000)]
In StringLiteral::setString make sure that we copy the number of
bytes of the buffer and not the size of the string, otherwise we
may overwrite the buffer if there is a mismatch between the size
of the string and the CharByteWidth, and assertions are disabled.

The bug where this could occur was fixed in r163931.
Related to rdar://12069503

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

12 years ago[libclang] When loading an AST file, make sure to apply the language options
Argyrios Kyrtzidis [Fri, 14 Sep 2012 20:24:53 +0000 (20:24 +0000)]
[libclang] When loading an AST file, make sure to apply the language options
to the target info.

Related to rdar://12069503.

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

12 years agoUtilize new build system support in Xcode 4.5 for easier interposition
Ted Kremenek [Fri, 14 Sep 2012 19:06:33 +0000 (19:06 +0000)]
Utilize new build system support in Xcode 4.5 for easier interposition
of a build without needing to use ccc-analyzer.

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

12 years agoscan-build: Determine the location of the clang binary before printing help.
Jordan Rose [Fri, 14 Sep 2012 18:59:03 +0000 (18:59 +0000)]
scan-build: Determine the location of the clang binary before printing help.

We need the clang executable to print the list of available checkers.

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

12 years agoFix some dead stores which the static analyzer warned about. No functionality
Richard Smith [Fri, 14 Sep 2012 18:27:01 +0000 (18:27 +0000)]
Fix some dead stores which the static analyzer warned about. No functionality
change (the problematic cases in ParseDecl.cpp are currently impossible).

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

12 years agoWhen diagnosing multiple mem-initializers in a delegating ctor, point to the delegati...
Richard Smith [Fri, 14 Sep 2012 18:21:10 +0000 (18:21 +0000)]
When diagnosing multiple mem-initializers in a delegating ctor, point to the delegating initializer, not to the first initializer. For good measure, also highlight the other initializer.

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

12 years agoTest removed.
Fariborz Jahanian [Fri, 14 Sep 2012 17:51:34 +0000 (17:51 +0000)]
Test removed.

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

12 years agoobjective-C arc: remove -Warc-abi in its entirety.
Fariborz Jahanian [Fri, 14 Sep 2012 17:48:35 +0000 (17:48 +0000)]
objective-C arc: remove -Warc-abi in its entirety.
// rdar://10554025

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

12 years agoFix copy-paste error in manpage. Should be -stdlib=library.
Ted Kremenek [Fri, 14 Sep 2012 17:20:56 +0000 (17:20 +0000)]
Fix copy-paste error in manpage.  Should be -stdlib=library.

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

12 years agoAdd missing test from r163874.
Douglas Gregor [Fri, 14 Sep 2012 16:38:59 +0000 (16:38 +0000)]
Add missing test from r163874.

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

12 years agoComment parsing: don't parse comment marker followed by a digit as a command
Dmitri Gribenko [Fri, 14 Sep 2012 16:35:35 +0000 (16:35 +0000)]
Comment parsing: don't parse comment marker followed by a digit as a command
since no Doxygen command starts with a digit.

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

12 years agoComment parsing: support the "\invariant" command.
Dmitri Gribenko [Fri, 14 Sep 2012 15:37:29 +0000 (15:37 +0000)]
Comment parsing: support the "\invariant" command.

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

12 years agoDo not use "lib32" directory to create a library/object files
Simon Atanasyan [Fri, 14 Sep 2012 11:27:24 +0000 (11:27 +0000)]
Do not use "lib32" directory to create a library/object files
paths when target is MIPS 32-bit.

The patch reviewed by Chandler Carruth.

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

12 years agoFix warning on qualified typedef with 'unused' attribute, from Jason Haslam!
Douglas Gregor [Fri, 14 Sep 2012 05:10:40 +0000 (05:10 +0000)]
Fix warning on qualified typedef with 'unused' attribute, from Jason Haslam!

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

12 years agoIn debugger mode, allow comparisons between pointers and integers
Douglas Gregor [Fri, 14 Sep 2012 04:35:37 +0000 (04:35 +0000)]
In debugger mode, allow comparisons between pointers and integers
without a cast. Fixes <rdar://problem/11830912>.

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

12 years agoAs we do with base and member initializers in a dependent class, delay
Douglas Gregor [Fri, 14 Sep 2012 04:20:37 +0000 (04:20 +0000)]
As we do with base and member initializers in a dependent class, delay
type checking for non-static data member initializers in a dependent
class, because our ASTs lose too much information to when
type-checking an initializer. Fixes <rdar://problem/11974632>,
although the result is still rather unsatisfactory.

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

12 years agoImprove the driver title as shown in the --help message. <rdar://12297538>
Bob Wilson [Fri, 14 Sep 2012 03:35:42 +0000 (03:35 +0000)]
Improve the driver title as shown in the --help message. <rdar://12297538>

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

12 years agoFix thunk emission for covariant virtual functions in cases which require
Eli Friedman [Fri, 14 Sep 2012 01:45:09 +0000 (01:45 +0000)]
Fix thunk emission for covariant virtual functions in cases which require
both a virtual and a non-virtual offset. PR13832.

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

12 years agoFix line endings.
Eli Friedman [Fri, 14 Sep 2012 01:19:01 +0000 (01:19 +0000)]
Fix line endings.

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

12 years agoFix abbreviation for CharacterLiteral in AST serialization. PR13806.
Eli Friedman [Fri, 14 Sep 2012 00:51:36 +0000 (00:51 +0000)]
Fix abbreviation for CharacterLiteral in AST serialization.  PR13806.

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

12 years agoWhen computing the decltype of an expression, consider Objective-C
Douglas Gregor [Thu, 13 Sep 2012 23:40:46 +0000 (23:40 +0000)]
When computing the decltype of an expression, consider Objective-C
ivar and property references as member accesses and produce the actual
type of the declaration. Fixes <rdar://problem/12031582>.

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

12 years agoFix incorrect comment.
Richard Smith [Thu, 13 Sep 2012 22:10:19 +0000 (22:10 +0000)]
Fix incorrect comment.

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

12 years agoFix up after r163846. Sorry!
Richard Smith [Thu, 13 Sep 2012 22:03:58 +0000 (22:03 +0000)]
Fix up after r163846. Sorry!

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

12 years agoActually rebuild function types properly when adjusting the function
Douglas Gregor [Thu, 13 Sep 2012 22:01:49 +0000 (22:01 +0000)]
Actually rebuild function types properly when adjusting the function
type of an instantiation.

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

12 years agoRevert r163829. The world (or libstdc++, at least) is not ready.
Richard Smith [Thu, 13 Sep 2012 22:00:12 +0000 (22:00 +0000)]
Revert r163829. The world (or libstdc++, at least) is not ready.

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

12 years agoWhen we substitute into the type of a function based on the
Douglas Gregor [Thu, 13 Sep 2012 21:56:43 +0000 (21:56 +0000)]
When we substitute into the type of a function based on the
TypeSourceInfo, we may have lost some adjustments made to the type of
that function due to declaration merging. Adjust the resulting type
correspondingly. Fixes PR12948 / <rdar://problem/11552434>.

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

12 years agoComment to XML conversion: we try not to emit empty <Discussion> elements, but
Dmitri Gribenko [Thu, 13 Sep 2012 21:32:58 +0000 (21:32 +0000)]
Comment to XML conversion: we try not to emit empty <Discussion> elements, but
it is not possible to guarantee that without duplicating logic or buffering
<Discussion> element contents.  So, allow empty <Discussion> elements in schema.

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

12 years agoImplement C++11 [conv.prom]p4: an enumeration with a fixed underlying type has
Richard Smith [Thu, 13 Sep 2012 21:18:54 +0000 (21:18 +0000)]
Implement C++11 [conv.prom]p4: an enumeration with a fixed underlying type has
integral promotions to both its underlying type and to its underlying type's
promoted type. This matters now that boolean conversions aren't permitted in
converted constant expressions (a la DR1407): an enumerator with a fixed
underlying type of bool still can be.

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

12 years agoDon't perform template argument deduction against invalid templates;
Douglas Gregor [Thu, 13 Sep 2012 21:01:57 +0000 (21:01 +0000)]
Don't perform template argument deduction against invalid templates;
it's likely to lead to a crash later on. Fixes PR12933 /
<rdar://problem/11525335>.

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

12 years agoComment parsing: handle \deprecated command. It is a block command, but it
Dmitri Gribenko [Thu, 13 Sep 2012 20:36:01 +0000 (20:36 +0000)]
Comment parsing: handle \deprecated command.  It is a block command, but it
should be fine to use it without further explanations in the attached
paragraph, so the warning about empty paragraph was turned off for it.

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

12 years agoremove duplicate code.
Fariborz Jahanian [Thu, 13 Sep 2012 20:26:40 +0000 (20:26 +0000)]
remove duplicate code.

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

12 years agoPromote the warning about extra qualification on a declaration from a
Douglas Gregor [Thu, 13 Sep 2012 20:16:20 +0000 (20:16 +0000)]
Promote the warning about extra qualification on a declaration from a
warning to an error. C++ bans it, and both GCC and EDG diagnose it as
an error. Microsoft allows it, so we still warn in Microsoft
mode. Fixes <rdar://problem/11135644>.

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

12 years agoRemove speculative fix for C++ core issue 1407, since it was resolved as NAD.
Richard Smith [Thu, 13 Sep 2012 19:55:13 +0000 (19:55 +0000)]
Remove speculative fix for C++ core issue 1407, since it was resolved as NAD.

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

12 years agoFix grammar.
Ted Kremenek [Thu, 13 Sep 2012 19:48:51 +0000 (19:48 +0000)]
Fix grammar.

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

12 years agoRecover properly after a parse error in a static_assert declaration.
Richard Smith [Thu, 13 Sep 2012 19:12:50 +0000 (19:12 +0000)]
Recover properly after a parse error in a static_assert declaration.

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

12 years agoUse a "better" unicode character, to avoid buildbot breakage on bots which can print...
Richard Smith [Thu, 13 Sep 2012 19:10:51 +0000 (19:10 +0000)]
Use a "better" unicode character, to avoid buildbot breakage on bots which can print some unicode characters.

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

12 years agoMove back the stuff about missing ownership attribute warning
Fariborz Jahanian [Thu, 13 Sep 2012 18:53:14 +0000 (18:53 +0000)]
Move back the stuff about missing ownership attribute warning
to SemaDeclObjC and apply some simplification per John's
comment. // rdar://12280826

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

12 years agoMake TextDiagnostic more robust against SourceLocations which point into the
Richard Smith [Thu, 13 Sep 2012 18:37:50 +0000 (18:37 +0000)]
Make TextDiagnostic more robust against SourceLocations which point into the
middle of UTF-8 characters, and avoid walking to such positions when adjusting
column ranges for display. Fixes a couple of hangs when rendering diagnostics.

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

12 years agoWhen warning about unsafe uses of dispatch_once, specially handle the
Ted Kremenek [Thu, 13 Sep 2012 18:18:37 +0000 (18:18 +0000)]
When warning about unsafe uses of dispatch_once, specially handle the
crazy case where dispatch_once gets redefined as a macro that calls
_dispatch_once (which calls the real dispatch_once).  Users want to
see the warning in their own code.

Fixes <rdar://problem/11617767>

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

12 years agoMove no explicit ownership warning to SemaType.cpp.
Fariborz Jahanian [Thu, 13 Sep 2012 17:29:07 +0000 (17:29 +0000)]
Move no explicit ownership warning to SemaType.cpp.
// rdar://12280826

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

12 years agoAdd tests for r163778.
Ted Kremenek [Thu, 13 Sep 2012 17:25:51 +0000 (17:25 +0000)]
Add tests for r163778.

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

12 years agoThis patch introduces A15 as a target in Clang.
Silviu Baranga [Thu, 13 Sep 2012 15:06:00 +0000 (15:06 +0000)]
This patch introduces A15 as a target in Clang.

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

12 years agoASTMatchersMacros.h: Appease msvc.
NAKAMURA Takumi [Thu, 13 Sep 2012 14:28:23 +0000 (14:28 +0000)]
ASTMatchersMacros.h: Appease msvc.

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

12 years agoCreate initial support for matching and binding NestedNameSpecifier(Loc)s.
Daniel Jasper [Thu, 13 Sep 2012 13:11:25 +0000 (13:11 +0000)]
Create initial support for matching and binding NestedNameSpecifier(Loc)s.

Review: http://llvm-reviews.chandlerc.com/D39

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

12 years agoFix Doxygen misuse: refer to parameter names in paragraphs correctly (\arg is
Dmitri Gribenko [Thu, 13 Sep 2012 13:11:20 +0000 (13:11 +0000)]
Fix Doxygen misuse: refer to parameter names in paragraphs correctly (\arg is
not what most people want -- it starts a new paragraph).

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

12 years agoAdd missing accessor.
Manuel Klimek [Thu, 13 Sep 2012 12:44:47 +0000 (12:44 +0000)]
Add missing accessor.

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

12 years agoConditionally parse documentation comments in system headers by
Ted Kremenek [Thu, 13 Sep 2012 06:41:18 +0000 (06:41 +0000)]
Conditionally parse documentation comments in system headers by
passing -fretain-comments-from-system-headers.  By default, the
compiler no longer parses such documentation comments, as they
can result in a noticeable compile time/PCH slowdown.

Fixes <rdar://problem/11860820>.

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

12 years agoProperly link libpthread_p when using profiling on OpenBSD.
Eric Christopher [Thu, 13 Sep 2012 06:32:34 +0000 (06:32 +0000)]
Properly link libpthread_p when using profiling on OpenBSD.

Patch by Brad Smith.

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

12 years agoInitHeaderSearch.cpp: [mingw] Handle DOSish paths only on Win32 hosts.
NAKAMURA Takumi [Thu, 13 Sep 2012 05:53:23 +0000 (05:53 +0000)]
InitHeaderSearch.cpp: [mingw] Handle DOSish paths only on Win32 hosts.

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

12 years agoclang/lib/Analysis/ObjCNoReturn.cpp: Fix [-Wnewline-eof]
NAKAMURA Takumi [Thu, 13 Sep 2012 05:53:17 +0000 (05:53 +0000)]
clang/lib/Analysis/ObjCNoReturn.cpp: Fix [-Wnewline-eof]

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

12 years agoFormat strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.
Jordan Rose [Thu, 13 Sep 2012 02:11:15 +0000 (02:11 +0000)]
Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.

<rdar://problem/12061922>

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

12 years agoFormat strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).
Jordan Rose [Thu, 13 Sep 2012 02:11:03 +0000 (02:11 +0000)]
Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).

These will warn under -Wformat-non-iso, and will still be rejected
outright on other platforms.

<rdar://problem/12061922>

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

12 years ago[analyzer] Don't reimplement an existing function.
Anna Zaks [Thu, 13 Sep 2012 00:37:12 +0000 (00:37 +0000)]
[analyzer] Don't reimplement an existing function.

Thanks Jordan.

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

12 years agoTeach -Wuninitialized to recognize common "noreturn" idioms in
Ted Kremenek [Thu, 13 Sep 2012 00:21:35 +0000 (00:21 +0000)]
Teach -Wuninitialized to recognize common "noreturn" idioms in
Objective-C related to NSException.

Fixes <rdar://problem/12287498>

I debated whether or not this logic should be sunk into the CFG
itself.  It's not clear if we should, as different analyses may
wish to have different policies.  We can re-evaluate this in the
future.

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

12 years agoRefactor logic in ExprEngine for detecting 'noreturn' methods
Ted Kremenek [Thu, 13 Sep 2012 00:21:31 +0000 (00:21 +0000)]
Refactor logic in ExprEngine for detecting 'noreturn' methods
in NSException to a helper object in libAnalysis that can also
be used by Sema.  Not sure if the predicate name 'isImplicitNoReturn'
is the best one, but we can massage that later.

No functionality change.

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

12 years agoAdd a few FIXMEs.
Chad Rosier [Thu, 13 Sep 2012 00:20:37 +0000 (00:20 +0000)]
Add a few FIXMEs.

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

12 years ago[ms-inline asm] Handle the enumeration of input and output expressions in a
Chad Rosier [Thu, 13 Sep 2012 00:06:55 +0000 (00:06 +0000)]
[ms-inline asm]  Handle the enumeration of input and output expressions in a
more robust way to address a few FIXMEs.

The initial implementation, r163342, built the IR asm string and then tried to
patch things on the fly without enough context.  Specifically, it didn't skip
mnemonics nor did it track with assembly instruction an expression was related
to.  The new implementation patches the operands and then builds the final
IR string.

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

12 years agoReapply:
Eric Christopher [Wed, 12 Sep 2012 23:36:49 +0000 (23:36 +0000)]
Reapply:

    Make clang emit a flag for DW_AT_object_pointer for the artificial
    args where it should (implicit first arguments). FileCheck-ize a
    test as well and update tests to take into account the object
    pointer flag.

    rdar://9797999

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

12 years agoAdd two new functions to Qualifiers.
Richard Trieu [Wed, 12 Sep 2012 23:13:31 +0000 (23:13 +0000)]
Add two new functions to Qualifiers.

static Qualifiers removeCommonQualifiers(Qualifiers &L, Qualifiers &R)
Removes the common qualifiers from L and R and returns them in a new Qualifier.
This will be used in template diffing.

void removeQualifiers(Qualifiers Q)
Removes the qualifiers in Q from the current qualifier.
This replaces the current underlying implementation of operator- and
operator -= which only performed bit masking.

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

12 years agoWhitespace.
Chad Rosier [Wed, 12 Sep 2012 23:03:48 +0000 (23:03 +0000)]
Whitespace.

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

12 years ago[analyzer] Do not report use of undef on "return foo();" when the return type is...
Anna Zaks [Wed, 12 Sep 2012 22:57:40 +0000 (22:57 +0000)]
[analyzer] Do not report use of undef on "return foo();" when the return type is void.

Fixes a false positive found by analyzing LLVM code base.

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

12 years ago[analyzer] Fix another false positive in malloc realloc logic.
Anna Zaks [Wed, 12 Sep 2012 22:57:34 +0000 (22:57 +0000)]
[analyzer] Fix another false positive in malloc realloc logic.

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

12 years ago[analyzer] Teach UndefOrNullArgVisitor to track parent regions.
Anna Zaks [Wed, 12 Sep 2012 22:57:30 +0000 (22:57 +0000)]
[analyzer] Teach UndefOrNullArgVisitor to track parent regions.

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