]> granicus.if.org Git - clang/log
clang
12 years agoDocumentation cleanup: fixing file headers to use Doxygen \file markup while
James Dennett [Tue, 19 Jun 2012 21:02:26 +0000 (21:02 +0000)]
Documentation cleanup: fixing file headers to use Doxygen \file markup while
also being sufficiently conformant to LLVM's coding standards.

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

12 years agoobjc-arc: captured block variable accessed in its block literal
Fariborz Jahanian [Tue, 19 Jun 2012 20:53:26 +0000 (20:53 +0000)]
objc-arc: captured block variable accessed in its block literal
initializer need be null initialized before initializer takes
hold, just like any other initialized retainable object pointer.
// rdar://11016025

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

12 years agoAdjust scan-build to enable color output for xterm-256color.
Ted Kremenek [Tue, 19 Jun 2012 19:27:28 +0000 (19:27 +0000)]
Adjust scan-build to enable color output for xterm-256color.

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

12 years ago[driver] Per Bob's suggestion, emphasize the file dumps.
Chad Rosier [Tue, 19 Jun 2012 18:39:21 +0000 (18:39 +0000)]
[driver] Per Bob's suggestion, emphasize the file dumps.
rdar://11684107

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

12 years agoRemove some debugging code that snuck into r158691.
Kaelyn Uhrain [Tue, 19 Jun 2012 18:38:00 +0000 (18:38 +0000)]
Remove some debugging code that snuck into r158691.

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

12 years agoRevert predefined decl tracking.
Meador Inge [Tue, 19 Jun 2012 18:17:30 +0000 (18:17 +0000)]
Revert predefined decl tracking.

r158085 added some logic to track predefined declarations.  The main reason we
had predefined declarations in the input was because the __builtin_va_list
declarations were injected into the preprocessor input.  As of r158592 we
explicitly build the __builtin_va_list declarations.  Therefore the predefined
decl tracking is no longer needed.

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

12 years agoRemove redundant uses of SmallString
Sean Hunt [Tue, 19 Jun 2012 18:12:18 +0000 (18:12 +0000)]
Remove redundant uses of SmallString

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

12 years ago[driver] Print the compiler version before the diagnostic messages.
Chad Rosier [Tue, 19 Jun 2012 17:51:34 +0000 (17:51 +0000)]
[driver] Print the compiler version before the diagnostic messages.

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

12 years ago[driver] Make the crash diagnostic message more visable. Bug reports are being
Chad Rosier [Tue, 19 Jun 2012 17:48:02 +0000 (17:48 +0000)]
[driver] Make the crash diagnostic message more visable.  Bug reports are being
filed, but still missing the preprocessed source and associated run script.
rdar://11684107

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

12 years agoImproves parsing and semantic analysis for MS __declspec attributes. This includes...
Aaron Ballman [Tue, 19 Jun 2012 13:49:26 +0000 (13:49 +0000)]
Improves parsing and semantic analysis for MS __declspec attributes.  This includes support for the align (which fixes PR12631).

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

12 years agoStop abusing StringRef. Fixes the Windows build.
Sean Hunt [Tue, 19 Jun 2012 13:36:02 +0000 (13:36 +0000)]
Stop abusing StringRef. Fixes the Windows build.

I've also removed the duplicate check for PARSED_ATTR since it seems
unnecessary, and would have made the code more complicated.

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

12 years ago[analyzer] Allow pointers to escape into NSPointerArray.
Anna Zaks [Tue, 19 Jun 2012 05:10:32 +0000 (05:10 +0000)]
[analyzer] Allow pointers to escape into NSPointerArray.
(Fixes radar://11691035 PR13140)

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

12 years agoImprove the specification of spellings in Attr.td.
Sean Hunt [Tue, 19 Jun 2012 03:39:03 +0000 (03:39 +0000)]
Improve the specification of spellings in Attr.td.

Note that this is mostly a structural patch that handles the change from the old
spelling style to the new one. One consequence of this is that all AT_foo_bar
enum values have changed to not be based off of the first spelling, but rather
off of the class name, so they are now AT_FooBar and the like (a straw poll on
IRC showed support for this). Apologies for code churn.

Most attributes have GNU spellings as a temporary solution until everything else
is sorted out (such as a Keyword spelling, which I intend to add if someone else
doesn't beat me to it). This is definitely a WIP.

I've also killed BaseCheckAttr since it was unused, and I had to go through
every attribute anyway.

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

12 years agoFix the location of the fixit for -Wnewline-eof.
Jordan Rose [Tue, 19 Jun 2012 03:09:38 +0000 (03:09 +0000)]
Fix the location of the fixit for -Wnewline-eof.

It turns out SourceManager treating the "one-past-the-end" location as invalid,
but then failing to set the invalid flag properly.

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

12 years ago[objcmt] When checking whether the subscripting methods are declared use
Argyrios Kyrtzidis [Tue, 19 Jun 2012 02:22:02 +0000 (02:22 +0000)]
[objcmt] When checking whether the subscripting methods are declared use
ObjCInterfaceDec::lookupInstanceMethod to make sure we check categories as well
and update related tests.

rdar://11695288

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

12 years agoAdd a -fuse-init-array option to cc1 and map to the UseInitArray target
Rafael Espindola [Tue, 19 Jun 2012 01:26:10 +0000 (01:26 +0000)]
Add a -fuse-init-array option to cc1 and map to the UseInitArray target
option. On the driver, check if we are using libraries from gcc 4.7 or newer
and if so pass -fuse-init-array to the frontend.
The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in
.ctors, so we have to use .init_array.

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

12 years agoImprove the error message when a function overload candidate is rejected
Kaelyn Uhrain [Tue, 19 Jun 2012 00:37:47 +0000 (00:37 +0000)]
Improve the error message when a function overload candidate is rejected
because it expects a reference and receives a non-l-value.

For example, given:

  int foo(int &);
  template<int x> void b() { foo(x); }

clang will now print "expects an l-value for 1st argument" instead of
"no known conversion from 'int' to 'int &' for 1st argument". The change
in wording (and associated code to detect the case) was prompted by
comment #5 in PR3104, and should be the last bit of work needed for the
bug.

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

12 years agoSink definition of IBOutlet, IBOutletCollection, and IBAction into
Ted Kremenek [Tue, 19 Jun 2012 00:37:39 +0000 (00:37 +0000)]
Sink definition of IBOutlet, IBOutletCollection, and IBAction into
the compiler predefines buffer.  These are essentially part of
the Objective-C language.

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

12 years agoChange -Winternal-linkage-in-inline from ExtWarn to Warning in C++.
Jordan Rose [Mon, 18 Jun 2012 23:58:49 +0000 (23:58 +0000)]
Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.

Per post-commit review, it's not appropriate to use ExtWarn in C++, because
we can't prove that the inline function will actually be defined in more than
one place (and thus we can't prove that this violates the ODR).

This removes the warning entirely from uses in the main source file in C++.

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

12 years agoXFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.
Michael J. Spencer [Mon, 18 Jun 2012 23:00:44 +0000 (23:00 +0000)]
XFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.

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

12 years agoAdd language std for OpenCL 1.1 and 1.2.
Tanya Lattner [Mon, 18 Jun 2012 22:55:02 +0000 (22:55 +0000)]
Add language std for OpenCL 1.1 and 1.2.

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

12 years agoSupport -Winternal-linkage-in-inline in C++ code.
Jordan Rose [Mon, 18 Jun 2012 22:09:19 +0000 (22:09 +0000)]
Support -Winternal-linkage-in-inline in C++ code.

This includes treating anonymous namespaces like internal linkage, and allowing
const variables to be used even if internal. The whole thing's been broken out
into a separate function to avoid nested ifs.

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

12 years agoAdd new tool 'diag-build' for showing enabled warnings in a project.
Jordan Rose [Mon, 18 Jun 2012 21:31:37 +0000 (21:31 +0000)]
Add new tool 'diag-build' for showing enabled warnings in a project.

diag-build acts as a wrapper for 'diagtool show-enabled', in the same way
that scan-build acts as a wrapper for the static analyzer. The common case is
simple: use 'diag-build make' or 'diag-build xcodebuild' to list the warnings
enabled for the first compilation command we see. Other build systems require
you to manually specify "dry-run" and "use $CC and $CXX"; if there is a build
system you are interested in, please add it to the switch statement.

diag-build is fairly stupid right now, but it serves its basic purpose.
Hopefully it can grow to meet any additional requirements.

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

12 years ago[analyzer] Add a comment: why we treat array compound literals as lvalues.
Jordan Rose [Mon, 18 Jun 2012 21:31:27 +0000 (21:31 +0000)]
[analyzer] Add a comment: why we treat array compound literals as lvalues.

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

12 years agoMove a few static functions from DiagnosticRenderer.cpp into SourceManager.
Matt Beaumont-Gay [Mon, 18 Jun 2012 20:12:05 +0000 (20:12 +0000)]
Move a few static functions from DiagnosticRenderer.cpp into SourceManager.

This simplifies the code a little bit, since these functions all took a
SourceManager parameter and called a bunch of methods on it, and makes
the functions available to other users.

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

12 years agoDocumentation cleanup:
James Dennett [Mon, 18 Jun 2012 18:42:20 +0000 (18:42 +0000)]
Documentation cleanup:
* Escaped "::" where needed to prevent Doxygen trying to make links;
* Updated one mention of C++0x to refer to C++11;
* Fixed a \brief summary to make it somewhat concise.

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

12 years agoAllow internal decls in inline functions if the function is in the main file.
Jordan Rose [Mon, 18 Jun 2012 17:49:58 +0000 (17:49 +0000)]
Allow internal decls in inline functions if the function is in the main file.

This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)

I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.

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

12 years agodocument _has_feature(objc_default_synthesize_properties).
Fariborz Jahanian [Mon, 18 Jun 2012 17:13:17 +0000 (17:13 +0000)]
document _has_feature(objc_default_synthesize_properties).
// rdar://11676972

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

12 years ago[VS Toolchain] Correctly forward -l linker inputs to link.exe.
Michael J. Spencer [Mon, 18 Jun 2012 16:56:04 +0000 (16:56 +0000)]
[VS Toolchain] Correctly forward -l linker inputs to link.exe.

Patch by Nikola Smiljanic!

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

12 years agofix PR13071 / rdar://problem/11634669 :
Nuno Lopes [Mon, 18 Jun 2012 16:39:04 +0000 (16:39 +0000)]
fix PR13071 / rdar://problem/11634669 :
crash on invalid function decl with alloc_size attribute

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

12 years agoalloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the...
Nuno Lopes [Mon, 18 Jun 2012 16:27:56 +0000 (16:27 +0000)]
alloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the function allocates x^2 bytes. GCC also accepts this syntax

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

12 years agoHandle C++11 attribute namespaces automatically.
Sean Hunt [Mon, 18 Jun 2012 16:13:52 +0000 (16:13 +0000)]
Handle C++11 attribute namespaces automatically.

Now, as long as the 'Namespaces' variable is correct inside Attr.td, the
generated code will correctly admit a C++11 attribute only when it has the
appropriate namespace(s).

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

12 years ago[MSExtensions] Add support for __forceinline.
Michael J. Spencer [Mon, 18 Jun 2012 07:00:48 +0000 (07:00 +0000)]
[MSExtensions] Add support for __forceinline.

__forceinline is a combination of the inline keyword and __attribute__((always_inline))

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

12 years agoExtend the error recovery for a template-argument-list terminated by '>>' to
Richard Smith [Mon, 18 Jun 2012 06:11:04 +0000 (06:11 +0000)]
Extend the error recovery for a template-argument-list terminated by '>>' to
also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to
deal with cases where the token is followed by an adjacent '=', '==', '>=',
'>>=', or '>>>' token, where a naive fix-it would result in a differing token
stream on a re-lex.

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

12 years agoDon't warn about address-to-member used as part of initialisation, if
Joerg Sonnenberger [Sun, 17 Jun 2012 23:10:39 +0000 (23:10 +0000)]
Don't warn about address-to-member used as part of initialisation, if
the member expression is in parentheses.

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

12 years agodiagtool/CMakeLists.txt: Add missing tblgen'd dependency, ClangDiagnosticIndexName.
NAKAMURA Takumi [Sun, 17 Jun 2012 15:41:44 +0000 (15:41 +0000)]
diagtool/CMakeLists.txt: Add missing tblgen'd dependency, ClangDiagnosticIndexName.

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

12 years agoSwitch users of SmallMap to use SmallDenseMap instead.
Chandler Carruth [Sun, 17 Jun 2012 11:47:03 +0000 (11:47 +0000)]
Switch users of SmallMap to use SmallDenseMap instead.

The most important change here is that the destructor and copy
constructor for StoredDeclsList will now reliably be run. Previously,
the destructors at least were missed in some cases. See the LLVM commits
discussions for why SmallMap is broken and going away.

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 07:39:14 +0000 (07:39 +0000)]
Documentation cleanup:
* Escaped # characters in Doxygen comments as needed;
* Exposed summaries using the \brief command.

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 06:45:58 +0000 (06:45 +0000)]
Documentation cleanup:
* Escaped # characters in Doxygen comments as needed;
* Added/reformatted \brief docs;
* Used a \file comment to document the file (MultipleIncludeOpt.h).

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 06:43:43 +0000 (06:43 +0000)]
Documentation cleanup:
* For Doxygen, escaped "::std" as "\::std";
* For humans, fixed "namespaecs" to "namespaces".

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

12 years agoDocumentation cleanup: add parameter name to \param
James Dennett [Sun, 17 Jun 2012 05:54:50 +0000 (05:54 +0000)]
Documentation cleanup: add parameter name to \param

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 05:49:13 +0000 (05:49 +0000)]
Documentation cleanup:
* Escaped # characters in Doxygen comments;
* Added \brief markup to provide summaries.

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

12 years agoDocumentation cleanup: escaped a < character in a Doxygen comment.
James Dennett [Sun, 17 Jun 2012 05:37:49 +0000 (05:37 +0000)]
Documentation cleanup: escaped a < character in a Doxygen comment.

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

12 years agoDocumentation cleanup: fix two typos, rief -> brief and Descripts -> Describes
James Dennett [Sun, 17 Jun 2012 05:33:25 +0000 (05:33 +0000)]
Documentation cleanup: fix two typos, rief -> brief and Descripts -> Describes

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

12 years agoDocumentation cleanup: escaping #define in Doxygen comments
James Dennett [Sun, 17 Jun 2012 04:46:54 +0000 (04:46 +0000)]
Documentation cleanup: escaping #define in Doxygen comments

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 04:36:28 +0000 (04:36 +0000)]
Documentation cleanup:
* Added \file, \brief and \verbatim...\endverbatim markup, particularly around
  documentation of subset of the grammars that are being parsed.

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

12 years agoDocumentation cleanup: escaping # characters and adding \brief markup
James Dennett [Sun, 17 Jun 2012 04:08:41 +0000 (04:08 +0000)]
Documentation cleanup: escaping # characters and adding \brief markup

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

12 years agoDocumentation cleanup: escaping # characters and adding \brief markup
James Dennett [Sun, 17 Jun 2012 04:04:08 +0000 (04:04 +0000)]
Documentation cleanup: escaping # characters and adding \brief markup

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

12 years agoDocumentation cleanup: escape #undef in Doxygen comments.
James Dennett [Sun, 17 Jun 2012 04:00:01 +0000 (04:00 +0000)]
Documentation cleanup: escape #undef in Doxygen comments.

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

12 years agoDocumentation cleanup: delete an erroneous use of \link
James Dennett [Sun, 17 Jun 2012 03:58:59 +0000 (03:58 +0000)]
Documentation cleanup: delete an erroneous use of \link

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

12 years agoDocumentation cleanup: typo fix, \briaf -> \brief
James Dennett [Sun, 17 Jun 2012 03:57:24 +0000 (03:57 +0000)]
Documentation cleanup: typo fix, \briaf -> \brief

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

12 years agoDocumentation cleanup: Add missing parameter name to a \param command
James Dennett [Sun, 17 Jun 2012 03:52:50 +0000 (03:52 +0000)]
Documentation cleanup: Add missing parameter name to a \param command

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

12 years agoDocumentation cleanup: escape "::" to eliminate a Doxygen warning
James Dennett [Sun, 17 Jun 2012 03:43:32 +0000 (03:43 +0000)]
Documentation cleanup: escape "::" to eliminate a Doxygen warning

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

12 years agoDocumentation cleanup: Use \brief for summaries, and escape # characters.
James Dennett [Sun, 17 Jun 2012 03:41:54 +0000 (03:41 +0000)]
Documentation cleanup: Use \brief for summaries, and escape # characters.

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 03:40:43 +0000 (03:40 +0000)]
Documentation cleanup:
* Removed docs for Lexer::makeFileCharRange from Lexer.cpp, as they're in
  the header file;
* Reworked the documentation for SkipBlockComment so that it doesn't confuse
  Doxygen's comment parsing;
* Added another summary with \brief markup.

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

12 years agoDocumentation cleanup: fixing a typo from my previous 'fix'.
James Dennett [Sun, 17 Jun 2012 03:36:08 +0000 (03:36 +0000)]
Documentation cleanup: fixing a typo from my previous 'fix'.

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

12 years agoDocumentation cleanup: added \verbatim...\verbatim markup to fix the
James Dennett [Sun, 17 Jun 2012 03:34:42 +0000 (03:34 +0000)]
Documentation cleanup: added \verbatim...\verbatim markup to fix the
formatting of Doxygen's output for StringLiteralParser::StringLiteralParser.

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

12 years agoDocumentation cleanup:
James Dennett [Sun, 17 Jun 2012 03:26:26 +0000 (03:26 +0000)]
Documentation cleanup:
* Escaped #pragma (as \#pragma) in Doxygen comments;
* Added \code...\endcode annotations around code examples in doc comments.

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

12 years agoDocumentation cleanup: escaped # characters in Doxygen comments.
James Dennett [Sun, 17 Jun 2012 03:22:59 +0000 (03:22 +0000)]
Documentation cleanup: escaped # characters in Doxygen comments.

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

12 years agoFor compatibility with gcc, accept -maltivec as an alias of -faltivec.
Hal Finkel [Sun, 17 Jun 2012 02:29:23 +0000 (02:29 +0000)]
For compatibility with gcc, accept -maltivec as an alias of -faltivec.

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

12 years ago-Wuninitialized bugfix: when entering the scope of a variable with no
Richard Smith [Sat, 16 Jun 2012 23:34:14 +0000 (23:34 +0000)]
-Wuninitialized bugfix: when entering the scope of a variable with no
initializer, it is uninitialized, even if we may be coming from somewhere where
it was initialized.

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

12 years agoGuard private fields that are unused in Release builds with #ifndef NDEBUG.
Benjamin Kramer [Sat, 16 Jun 2012 21:48:23 +0000 (21:48 +0000)]
Guard private fields that are unused in Release builds with #ifndef NDEBUG.

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

12 years agoclang/lib/Basic/FileManager.cpp: Detect the root directory with PathV2. It should...
NAKAMURA Takumi [Sat, 16 Jun 2012 06:04:10 +0000 (06:04 +0000)]
clang/lib/Basic/FileManager.cpp: Detect the root directory with PathV2. It should be better fix for PR10331, or, "clang X:\foo.c" fails.

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

12 years agoToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode on msvc...
NAKAMURA Takumi [Sat, 16 Jun 2012 06:04:05 +0000 (06:04 +0000)]
ToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode on msvc. LangOpts.MicrosoftExt still appends "class type_info;".

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

12 years agoExplicitly build __builtin_va_list.
Meador Inge [Sat, 16 Jun 2012 03:34:49 +0000 (03:34 +0000)]
Explicitly build __builtin_va_list.

The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.

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

12 years agoFix Sema and IRGen for atomic compound assignment so it has the right semantics when...
Eli Friedman [Sat, 16 Jun 2012 02:19:17 +0000 (02:19 +0000)]
Fix Sema and IRGen for atomic compound assignment so it has the right semantics when promotions are involved.
(As far as I can tell, this only affects some edge cases.)

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

12 years ago[analyzer] Array CompoundLiteralExprs need to be treated like lvalues.
Jordan Rose [Sat, 16 Jun 2012 01:28:03 +0000 (01:28 +0000)]
[analyzer] Array CompoundLiteralExprs need to be treated like lvalues.

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

12 years ago[analyzer] Return an UnknownVal when we try to get the binding for a VLA.
Jordan Rose [Sat, 16 Jun 2012 01:28:00 +0000 (01:28 +0000)]
[analyzer] Return an UnknownVal when we try to get the binding for a VLA.

This happens in C++ mode right at the declaration of a struct VLA;
MallocChecker sees a bind and tries to get see if it's an escaping bind.
It's likely that our handling of this is still incomplete, but it fixes a
crash on valid without disturbing anything else for now.

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

12 years ago[AST/libclang] Fix the selector locations that are reported for a
Argyrios Kyrtzidis [Sat, 16 Jun 2012 00:46:02 +0000 (00:46 +0000)]
[AST/libclang] Fix the selector locations that are reported for a
method definition that has its '{' attached to the method name without
a space.

With a method like:

-(id)meth{
.....
}

the logic in ObjCMethodDecl that determined the selector locations got
confused because it was initialized based on an end location for '{' but
that end location changed to '}' after the method was finished.

Fix this by having an immutable end location for the declarator and
for getLocEnd() get the end location from the body itself.

Fixes rdar://11659739.

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

12 years agoMake the analyzer site a single point of reference for info
Anna Zaks [Sat, 16 Jun 2012 00:30:21 +0000 (00:30 +0000)]
Make the analyzer site a single point of reference for info
on controlling diagnostics.

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

12 years ago[analyzer] Buffers passed to CGBitmapContextCreate can escape.
Jordan Rose [Sat, 16 Jun 2012 00:09:20 +0000 (00:09 +0000)]
[analyzer] Buffers passed to CGBitmapContextCreate can escape.

Specifically, although the bitmap context does not take ownership of the
buffer (unlike CGBitmapContextCreateWithData), the data buffer can be extracted
out of the created CGContextRef. Thus the buffer is not leaked even if its
original pointer goes out of scope, as long as
- the context escapes, or
- it is retrieved via CGBitmapContextGetData and freed.

Actually implementing that logic is beyond the current scope of MallocChecker,
so for now CGBitmapContextCreate goes on our system function exception list.

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

12 years agoMake the ".*" operator work correctly when the base is a prvalue and the field has...
Eli Friedman [Fri, 15 Jun 2012 23:51:06 +0000 (23:51 +0000)]
Make the ".*" operator work correctly when the base is a prvalue and the field has a non-trivial copy constructor.  PR13097.

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

12 years agoRecover when correcting an unknown type name to a keyword like "struct".
Kaelyn Uhrain [Fri, 15 Jun 2012 23:45:58 +0000 (23:45 +0000)]
Recover when correcting an unknown type name to a keyword like "struct".

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

12 years agoMove isCXXSimpleTypeSpecifier from Parser to Sema and tweak it for wider use.
Kaelyn Uhrain [Fri, 15 Jun 2012 23:45:51 +0000 (23:45 +0000)]
Move isCXXSimpleTypeSpecifier from Parser to Sema and tweak it for wider use.

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

12 years ago[-E] Emit a rewritten _Pragma on its own line.
Jordan Rose [Fri, 15 Jun 2012 23:33:51 +0000 (23:33 +0000)]
[-E] Emit a rewritten _Pragma on its own line.

1. Teach Lexer that pragma lexers are like macro expansions at EOF.
2. Treat pragmas like #define/#undef when printing.
3. If we just printed a directive, add a newline before any more tokens.
(4. Miscellaneous cleanup in PrintPreprocessedOutput.cpp)

PR10594 and <rdar://problem/11562490> (two separate related problems)

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

12 years agoDocumentation cleanup: escape < characters in Doxygen comments.
James Dennett [Fri, 15 Jun 2012 22:43:14 +0000 (22:43 +0000)]
Documentation cleanup: escape < characters in Doxygen comments.

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

12 years agoDocumentation cleanup: Escaped # characters in Doxygen comments.
James Dennett [Fri, 15 Jun 2012 22:38:06 +0000 (22:38 +0000)]
Documentation cleanup: Escaped # characters in Doxygen comments.

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

12 years agoDocumentation cleanup: Escaped backslashes in Doxygen comments.
James Dennett [Fri, 15 Jun 2012 22:33:08 +0000 (22:33 +0000)]
Documentation cleanup: Escaped backslashes in Doxygen comments.

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

12 years agoDocumentation cleanup: fix a type, LocatioinE -> LocationE
James Dennett [Fri, 15 Jun 2012 22:32:14 +0000 (22:32 +0000)]
Documentation cleanup: fix a type, LocatioinE -> LocationE

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

12 years agoDocumentation cleanup: escape Objective-C @keywords in Doxygen comments.
James Dennett [Fri, 15 Jun 2012 22:30:14 +0000 (22:30 +0000)]
Documentation cleanup: escape Objective-C @keywords in Doxygen comments.

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

12 years agoDocumentation cleanup: Made a parameter name in a \param command match the code
James Dennett [Fri, 15 Jun 2012 22:28:09 +0000 (22:28 +0000)]
Documentation cleanup: Made a parameter name in a \param command match the code

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

12 years agoDocumentation cleanup:
James Dennett [Fri, 15 Jun 2012 22:23:43 +0000 (22:23 +0000)]
Documentation cleanup:
* Escaped "::" and "<" as needed in Doxygen comments;
* Marked up code examples with \code...\endcode;
* Documented a \param that is current, instead of a few that aren't;
* Fixed up some \file and \brief comments.

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

12 years agoDocumentation cleanup:
James Dennett [Fri, 15 Jun 2012 22:10:14 +0000 (22:10 +0000)]
Documentation cleanup:
* Escaped Objective-C @keywords in Doxygen comments;
* Documented more accurate \params;
* Exposed some more summaries using \brief.

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

12 years agoAdd a missing initializer in ASTBitCodes.h
Dmitri Gribenko [Fri, 15 Jun 2012 22:07:06 +0000 (22:07 +0000)]
Add a missing initializer in ASTBitCodes.h

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

12 years agoDocumentation cleanup:
James Dennett [Fri, 15 Jun 2012 21:59:54 +0000 (21:59 +0000)]
Documentation cleanup:
* Escaped # characters in Doxygen comments;
* Added Doxygen markup (\brief, \code, \file, \namespace).

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

12 years agoDocumentation cleanup: fixed/created some /brief function summaries.
James Dennett [Fri, 15 Jun 2012 21:54:36 +0000 (21:54 +0000)]
Documentation cleanup: fixed/created some /brief function summaries.

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

12 years agoDocumentation cleanup: escape # in a Doxygen comment.
James Dennett [Fri, 15 Jun 2012 21:48:19 +0000 (21:48 +0000)]
Documentation cleanup: escape # in a Doxygen comment.

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

12 years agoDocumentation cleanup:
James Dennett [Fri, 15 Jun 2012 21:43:55 +0000 (21:43 +0000)]
Documentation cleanup:
* Escaped the # of #define in Doxygen comments;
* Formatting: Annotated __VA_ARGS__ with \c;
* Converted docs to use \brief to provide summaries;
* Fixed a typo: disbles -> disables.

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

12 years agoDocumentation cleanup: escape backslashes in Doxygen comments.
James Dennett [Fri, 15 Jun 2012 21:36:54 +0000 (21:36 +0000)]
Documentation cleanup: escape backslashes in Doxygen comments.

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

12 years agoDocumentation cleanup: delete doc comments from source files where they are
James Dennett [Fri, 15 Jun 2012 21:30:06 +0000 (21:30 +0000)]
Documentation cleanup: delete doc comments from source files where they are
broken duplicates of comments that are in the corresponding header files.

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

12 years agoDocumentation cleanup: escape # in a Doxygen comment.
James Dennett [Fri, 15 Jun 2012 21:28:23 +0000 (21:28 +0000)]
Documentation cleanup: escape # in a Doxygen comment.

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

12 years agoDocumentation cleanup: escape @ in a Doxygen comment.
James Dennett [Fri, 15 Jun 2012 21:27:44 +0000 (21:27 +0000)]
Documentation cleanup: escape @ in a Doxygen comment.

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

12 years agoDocumentation fix (cleaning up my own breakage): close <tt> with </tt>,
James Dennett [Fri, 15 Jun 2012 21:23:13 +0000 (21:23 +0000)]
Documentation fix (cleaning up my own breakage): close <tt> with </tt>,
not with another <tt>.

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

12 years agoStop referring to functions as methods in per-function fallthrough-checking.
Sean Hunt [Fri, 15 Jun 2012 21:22:05 +0000 (21:22 +0000)]
Stop referring to functions as methods in per-function fallthrough-checking.

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

12 years ago[completion] Add completions for @"..." and @(...), and tidy up @[] and @{}.
Jordan Rose [Fri, 15 Jun 2012 18:19:56 +0000 (18:19 +0000)]
[completion] Add completions for @"..." and @(...), and tidy up @[] and @{}.

Specifically, @[] and @{} didn't have a type associated with them; we now
use "NSArray *" and "NSDictionary *", respectively. @"" has the type
"NSString *". @(), unfortunately, has type "id", since it (currently) may
be either an NSNumber or an NSString.

Add a test for all the Objective-C at-expression completions.

<rdar://problem/11507708&11507668&11507711>

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

12 years ago[analyzer] RetainCount: don't track objects init'd with a delegate
Jordan Rose [Fri, 15 Jun 2012 18:19:52 +0000 (18:19 +0000)]
[analyzer] RetainCount: don't track objects init'd with a delegate

We already didn't track objects that have delegates or callbacks or
objects that are passed through void * "context pointers". It's a
not-uncommon pattern to release the object in its callback, and so
the leak message we give is not very helpful.

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

12 years agoWarn when a static variable is referenced in a non-static inline function.
Jordan Rose [Fri, 15 Jun 2012 18:19:48 +0000 (18:19 +0000)]
Warn when a static variable is referenced in a non-static inline function.

This is explicitly forbidden in C99 6.7.4p3. This is /not/ forbidden in C++,
probably because by default file-scope const/constexpr variables have internal
linkage, while functions have external linkage. There's also the issue of
anonymous namespaces to consider. Nevertheless, there should probably be a
similar warning, since the semantics of inlining a function that references
a variable with internal linkage do not seem well-defined.

<rdar://problem/11577619>

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

12 years agoTest that -Wauto-var-id fires in value-dependent contexts.
Jordan Rose [Fri, 15 Jun 2012 18:19:43 +0000 (18:19 +0000)]
Test that -Wauto-var-id fires in value-dependent contexts.

There was already a test that it did not fire in type-dependent contexts.
This was already behaving correctly.

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

12 years agoCheck the parameter lists and return type of both blocks and lambdas
Douglas Gregor [Fri, 15 Jun 2012 16:59:29 +0000 (16:59 +0000)]
Check the parameter lists and return type of both blocks and lambdas
for unexpanded parameter packs. Fixes the crash-on-invalid in
PR13117.

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

12 years agoHeaders/xopintrin.h: Try to fix r158492. Did you mean, mm256?
NAKAMURA Takumi [Fri, 15 Jun 2012 13:37:44 +0000 (13:37 +0000)]
Headers/xopintrin.h: Try to fix r158492. Did you mean, mm256?

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