]> granicus.if.org Git - clang/log
clang
11 years agoclang/GlobalModuleIndex: Don't open the same file twice. Use raw_fd_ostream(fd, ...
NAKAMURA Takumi [Thu, 24 Jan 2013 08:20:11 +0000 (08:20 +0000)]
clang/GlobalModuleIndex: Don't open the same file twice. Use raw_fd_ostream(fd, ...) instead.

FIXME: PathV2::unique_file() is assumed to open the file with binary mode on win32.

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

11 years agoclang/test/Modules/global_index.m: XFAILing on win32 when investigating for now.
NAKAMURA Takumi [Thu, 24 Jan 2013 07:04:14 +0000 (07:04 +0000)]
clang/test/Modules/global_index.m: XFAILing on win32 when investigating for now.

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

11 years agoGive warn_redecl_library_builtin a flag name: -Wincompatible-library-redeclaration.
Nick Lewycky [Thu, 24 Jan 2013 03:43:15 +0000 (03:43 +0000)]
Give warn_redecl_library_builtin a flag name: -Wincompatible-library-redeclaration.

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

11 years agoStart checking nonnull (as well as format and argument_with_type_tag) on
Nick Lewycky [Thu, 24 Jan 2013 02:03:08 +0000 (02:03 +0000)]
Start checking nonnull (as well as format and argument_with_type_tag) on
overloaded binary operators.

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

11 years agoFix some wonky formatting, remove spurious emacs major mode marker. No
Nick Lewycky [Thu, 24 Jan 2013 01:12:16 +0000 (01:12 +0000)]
Fix some wonky formatting, remove spurious emacs major mode marker. No
functionality change!

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

11 years agoMicro cleanup: use an array of const char, rather than an array of char, as the
Richard Smith [Wed, 23 Jan 2013 23:38:20 +0000 (23:38 +0000)]
Micro cleanup: use an array of const char, rather than an array of char, as the
type of the string literal implicitly used for a raw user-defined literal call.
No test; this has no semantic impact.

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

11 years agoDon't check lines beginning with '#', since they could contain a path with the unexpe...
Bill Wendling [Wed, 23 Jan 2013 23:07:21 +0000 (23:07 +0000)]
Don't check lines beginning with '#', since they could contain a path with the unexpected word in them.

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

11 years agoDon't check lines beginning with '#', since they could contain a path with the unexpe...
Bill Wendling [Wed, 23 Jan 2013 23:06:28 +0000 (23:06 +0000)]
Don't check lines beginning with '#', since they could contain a path with the unexpected word in them.

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

11 years agoThe diagnostic is now a warning instead of an error. Also don't check lines beginning...
Bill Wendling [Wed, 23 Jan 2013 23:04:29 +0000 (23:04 +0000)]
The diagnostic is now a warning instead of an error. Also don't check lines beginning with '#', since they could contain a path with the unexpected word in them.

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

11 years agoFix for case-sensitive file systems. Ugh
Douglas Gregor [Wed, 23 Jan 2013 22:45:24 +0000 (22:45 +0000)]
Fix for case-sensitive file systems. Ugh

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

11 years agoImplement the writer side of the global module index.
Douglas Gregor [Wed, 23 Jan 2013 22:38:11 +0000 (22:38 +0000)]
Implement the writer side of the global module index.

The global module index is a "global" index for all of the module
files within a particular subdirectory in the module cache, which
keeps track of all of the "interesting" identifiers and selectors
known in each of the module files. One can perform a fast lookup in
the index to determine which module files will have more information
about entities with a particular name/selector. This information can
help eliminate redundant lookups into module files (a serious
performance problem) and help with creating auto-import/auto-include
Fix-Its.

The global module index is created or updated at the end of a
translation unit that has triggered a (re)build of a module by
scraping all of the .pcm files out of the module cache subdirectory,
so it catches everything. As with module rebuilds, we use the file
system's atomicity to synchronize.

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

11 years agoAdd a test case for 'analyzer_noreturn' on category methods.
Ted Kremenek [Wed, 23 Jan 2013 21:29:13 +0000 (21:29 +0000)]
Add a test case for 'analyzer_noreturn' on category methods.

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

11 years agoAlways process an index.html file if we have HTML output. Patch by Justin Bogner.
Ted Kremenek [Wed, 23 Jan 2013 21:22:14 +0000 (21:22 +0000)]
Always process an index.html file if we have HTML output.  Patch by Justin Bogner.

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

11 years agoAdd missing null check. Not sure why my tests passed before.
Ted Kremenek [Wed, 23 Jan 2013 21:12:49 +0000 (21:12 +0000)]
Add missing null check.  Not sure why my tests passed before.

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

11 years agoHonor attribute 'analyzer_noreturn' on Objective-C methods.
Ted Kremenek [Wed, 23 Jan 2013 21:00:27 +0000 (21:00 +0000)]
Honor attribute 'analyzer_noreturn' on Objective-C methods.

This isn't likely a full solution, but it catches the common cases
and can be refined over time.

Fixes <rdar://problem/11634353>.

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

11 years agoAdd extra indent for nested calls inside if's.
Daniel Jasper [Wed, 23 Jan 2013 20:41:06 +0000 (20:41 +0000)]
Add extra indent for nested calls inside if's.

Before:
if (aaaaaaaaaa(
    aaaaaaaaaa)) {}

After:
if (aaaaaaaaaa(
        aaaaaaaaaa)) {}

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

11 years agoImplement -Wvla correctly
Dmitri Gribenko [Wed, 23 Jan 2013 20:02:51 +0000 (20:02 +0000)]
Implement -Wvla correctly

GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA,
for example, if they are forbidden by coding guidelines).  Currently Clang
implements -Wvla as "warn on VLA when it is an extension".

The attached patch makes our behavior match GCC.  The existing vla extwarn is
moved under -Wvla-extension and is still included into -Wgnu.

This fixes PR5953.

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

11 years agoFactor the trait for lookup into the on-based hash table of
Douglas Gregor [Wed, 23 Jan 2013 18:53:14 +0000 (18:53 +0000)]
Factor the trait for lookup into the on-based hash table of
identifiers into two parts: the part that involves dealing with the
key (which can be re-used) and the ASTReader-specific part that
creates the IdentifierInfos. While I'm at it, StringRef'ify this code,
which was using pair<const char*, unsigned>. No functionality change.

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

11 years agodocs: clear up ambiguity
Sean Silva [Wed, 23 Jan 2013 18:28:48 +0000 (18:28 +0000)]
docs: clear up ambiguity

Anybody using clang is a "developer".

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

11 years ago[PCH] Temporarily disable the "ambiguous macro" warning that is currently bogus with...
Argyrios Kyrtzidis [Wed, 23 Jan 2013 18:21:56 +0000 (18:21 +0000)]
[PCH] Temporarily disable the "ambiguous macro" warning that is currently bogus with a PCH
that redefined a macro without undef'ing it first.

Proper reconstruction of the macro info history from modules will properly fix this in subsequent commits.

rdar://13016031

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

11 years agoDocumentation: add a note that -cc1 options are not guaranteed to be stable
Dmitri Gribenko [Wed, 23 Jan 2013 18:02:28 +0000 (18:02 +0000)]
Documentation: add a note that -cc1 options are not guaranteed to be stable

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

11 years agolibclang: change return type of getCursorDecl() to 'const Decl *'
Dmitri Gribenko [Wed, 23 Jan 2013 17:25:27 +0000 (17:25 +0000)]
libclang: change return type of getCursorDecl() to 'const Decl *'

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

11 years agoUse 'const Decl *' throughout code completion in Sema
Dmitri Gribenko [Wed, 23 Jan 2013 17:21:11 +0000 (17:21 +0000)]
Use 'const Decl *' throughout code completion in Sema

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

11 years agoAdd constness for NestedNameSpecifier::Create parameter
Dmitri Gribenko [Wed, 23 Jan 2013 17:06:56 +0000 (17:06 +0000)]
Add constness for NestedNameSpecifier::Create parameter

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

11 years agoDon't try to align builder-type continuations on assignments.
Daniel Jasper [Wed, 23 Jan 2013 16:58:21 +0000 (16:58 +0000)]
Don't try to align builder-type continuations on assignments.

Before:
int aaaa = aaaaa().aaaaa() // force break
           .aaaaa();
After:
int aaaa = aaaaa().aaaaa() // force break
    .aaaaa();

The other indent is just wrong and confusing.

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

11 years agoConstify some getters in RedeclarableTemplateDecl
Dmitri Gribenko [Wed, 23 Jan 2013 16:52:57 +0000 (16:52 +0000)]
Constify some getters in RedeclarableTemplateDecl

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

11 years agoRemove uneeded casts
Dmitri Gribenko [Wed, 23 Jan 2013 15:56:07 +0000 (15:56 +0000)]
Remove uneeded casts

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

11 years agoDon't try to do a hanging ident after assignments.
Daniel Jasper [Wed, 23 Jan 2013 15:55:19 +0000 (15:55 +0000)]
Don't try to do a hanging ident after assignments.

Before:
bool aaaa = aaaaaaaaaaa(
                aaaaaaaaaaaaaaaaa);

After:
bool aaaa = aaaaaaaaaaa(
    aaaaaaaaaaaaaaaaa);

The other indentation was a nice attempt but doesn't work in many cases.
Not sure what the right long term solution is as the "After: " is still
not nice. We either need to figure out what to do in the cases where it
"doesn't work" or come up with a third solution, e.g. falling back to:

bool aaaa =
    aaaaaaaaaaa(
        aaaaaaaaaaaaaaaaa);

which should always work and nicely highlight the structure.

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

11 years agoFix handling of macro definitions.
Manuel Klimek [Wed, 23 Jan 2013 14:37:36 +0000 (14:37 +0000)]
Fix handling of macro definitions.

Now correctly formats:
 #define A (1)

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

11 years agoFixes layouting regression and invalid-read.
Manuel Klimek [Wed, 23 Jan 2013 14:08:21 +0000 (14:08 +0000)]
Fixes layouting regression and invalid-read.

Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.

Also fixes an invalid-read found by the valgrind bot.

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

11 years agoFix the formatting of pointer/reference types in range-based for loops.
Daniel Jasper [Wed, 23 Jan 2013 12:58:14 +0000 (12:58 +0000)]
Fix the formatting of pointer/reference types in range-based for loops.

Before: for (int & a : Values) {}
After:  for (int &a : Values) {}

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

11 years agoRemoving the penalty for breaking after "=".
Daniel Jasper [Wed, 23 Jan 2013 12:27:43 +0000 (12:27 +0000)]
Removing the penalty for breaking after "=".

Having seen more cases, this actually was not a good thing to do in the
first place. We can still improve on what we do now, but breaking after
the "=" is good in many cases.

Before:
aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa(
                    aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaa =
    aa->aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

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

11 years agoFix another regression for pointer types.
Daniel Jasper [Wed, 23 Jan 2013 12:10:53 +0000 (12:10 +0000)]
Fix another regression for pointer types.

Before: if (int * a = &b) ...
After:  if (int *a = &b) ...

Also changed all the existing tests to test the expressions in question
both in a declaration and in an expression context.

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

11 years agoAdd a new LangOpt NativeHalfType. This option allows for native half/fp16
Joey Gouly [Wed, 23 Jan 2013 11:56:20 +0000 (11:56 +0000)]
Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.

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

11 years agoFix regression in formatting pointer types.
Daniel Jasper [Wed, 23 Jan 2013 11:15:14 +0000 (11:15 +0000)]
Fix regression in formatting pointer types.

We will need a more principled solution, but we should not leave this
unfixed until we come up with one.

Before: void f() { int * a; }
After:  void f() { int *a; }

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

11 years agoFixes incorrect handling of the declaration context stack.
Manuel Klimek [Wed, 23 Jan 2013 11:03:04 +0000 (11:03 +0000)]
Fixes incorrect handling of the declaration context stack.

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

11 years agoFix segfaults in the formatter.
Manuel Klimek [Wed, 23 Jan 2013 10:09:28 +0000 (10:09 +0000)]
Fix segfaults in the formatter.

Also: expletive deleted.

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

11 years agoAdd option to allow putting all parameters onto the next line.
Daniel Jasper [Wed, 23 Jan 2013 10:08:28 +0000 (10:08 +0000)]
Add option to allow putting all parameters onto the next line.

This only affects styles where BinPackParameters is false.

With AllowAllParametersOnNextLine:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Without it:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaa,
                                         aaaaaaaaaa,
                                         aaaaaaaaaa,
                                         aaaaaaaaaaa,
                                         aaaaaaaaaaa);

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

11 years agoAllow us to better guess the context of an unwrapped line.
Manuel Klimek [Wed, 23 Jan 2013 09:32:48 +0000 (09:32 +0000)]
Allow us to better guess the context of an unwrapped line.

This gives us the ability to guess better defaults for whether a *
between identifiers is a pointer dereference or binary operator.

Now correctly formats:
void f(a *b);
void f() { f(a * b); }

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

11 years agoExplicitly cast away the const-ness instead of doing it implicitly.
Bill Wendling [Wed, 23 Jan 2013 08:58:23 +0000 (08:58 +0000)]
Explicitly cast away the const-ness instead of doing it implicitly.

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

11 years agoExplicitly cast away the const-ness instead of doing it implicitly.
Bill Wendling [Wed, 23 Jan 2013 08:25:41 +0000 (08:25 +0000)]
Explicitly cast away the const-ness instead of doing it implicitly.

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

11 years agoRemove the last of uses that use the Attribute object as a collection of attributes.
Bill Wendling [Wed, 23 Jan 2013 06:15:10 +0000 (06:15 +0000)]
Remove the last of uses that use the Attribute object as a collection of attributes.

Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.

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

11 years agoMake __attribute__((nonnull)) use the general expression evaluator to search for
Nick Lewycky [Wed, 23 Jan 2013 05:08:29 +0000 (05:08 +0000)]
Make __attribute__((nonnull)) use the general expression evaluator to search for
nulls instead of limiting itself to the language-defined "null pointer
constant".

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

11 years agoclang/test/Driver/output-file-is-dir.c: This requires shell due to 'cd'.
NAKAMURA Takumi [Wed, 23 Jan 2013 01:25:23 +0000 (01:25 +0000)]
clang/test/Driver/output-file-is-dir.c: This requires shell due to 'cd'.

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

11 years ago[Driver] Don't remove non-regular files that were outputs.
Daniel Dunbar [Wed, 23 Jan 2013 01:08:23 +0000 (01:08 +0000)]
[Driver] Don't remove non-regular files that were outputs.

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

11 years agoDocumentation cleanup: fixing documentation for FrontendAction.
James Dennett [Wed, 23 Jan 2013 00:45:44 +0000 (00:45 +0000)]
Documentation cleanup: fixing documentation for FrontendAction.
* Fix a typo, s/BeginSourceAction/BeginSourceFile/, so that the documentation
  for FrontendAction::BeginSourceFileAction links correctly to BeginSourceFile;
* Add some basic \file documentation for FrontendAction.h;
* More use of "\brief" instead of repeating the name of the entity being
  documented;
* Stop using Doxygen-style "///" comments in FrontendAction.cpp, as they were
  polluting the documentation for BeginSourceFile;
* Drop incorrect "\see" markup that broke Doxygen's formatting;
* Other minor documentation fixes.

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

11 years agoUse the AttributeSet when adding multiple attributes and an Attribute::AttrKind
Bill Wendling [Wed, 23 Jan 2013 00:21:06 +0000 (00:21 +0000)]
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.

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

11 years agoFix compilation on Linux, which defines PATH_MAX in a weird place,
Douglas Gregor [Tue, 22 Jan 2013 23:49:45 +0000 (23:49 +0000)]
Fix compilation on Linux, which defines PATH_MAX in a weird place,
from Saleem Abdulrasool!

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

11 years agoAdd a triple, per Ben's suggestion.
Chad Rosier [Tue, 22 Jan 2013 21:39:58 +0000 (21:39 +0000)]
Add a triple, per Ben's suggestion.

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

11 years agoSecond attempt to fix ppc bots.
Chad Rosier [Tue, 22 Jan 2013 20:57:10 +0000 (20:57 +0000)]
Second attempt to fix ppc bots.

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

11 years agoAdd x86 requirement to hopefully fix ppc bots.
Chad Rosier [Tue, 22 Jan 2013 20:16:41 +0000 (20:16 +0000)]
Add x86 requirement to hopefully fix ppc bots.

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

11 years agoPowerPC: fix __builtin_eh_return_data_regno return
Adhemerval Zanella [Tue, 22 Jan 2013 20:02:45 +0000 (20:02 +0000)]
PowerPC: fix __builtin_eh_return_data_regno return

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

11 years ago[ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-style
Chad Rosier [Tue, 22 Jan 2013 19:38:32 +0000 (19:38 +0000)]
[ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag.  MS-style
inline assembly can be enable with -fasm-blocks or -fms-extensions alone.

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

11 years agoSplit "discards qualifiers" warnings of -Wincompatible-pointer-types into subgroup.
Ted Kremenek [Tue, 22 Jan 2013 19:32:27 +0000 (19:32 +0000)]
Split "discards qualifiers" warnings of -Wincompatible-pointer-types into subgroup.

This allows users to promote -Wincompatible-pointer-type warnings to
errors but keep those for "discard qualifiers" as warnings (if they
so desire).

Addresses <rdar://problem/13062738>.

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

11 years agoUpdate docs: nullptr conversion tool landed
Dmitri Gribenko [Tue, 22 Jan 2013 19:22:22 +0000 (19:22 +0000)]
Update docs: nullptr conversion tool landed

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

11 years agoSmall code change to improve performance
Fariborz Jahanian [Tue, 22 Jan 2013 19:05:17 +0000 (19:05 +0000)]
Small code change to improve performance
in my last patch, suggested by Argyrios.

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

11 years agoobjectiveC (take two): don't warn when in -Wselector mode and
Fariborz Jahanian [Tue, 22 Jan 2013 18:35:43 +0000 (18:35 +0000)]
objectiveC (take two): don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

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

11 years ago[ms-inline asm] Remove a warning about ms-style inline assembly not being
Chad Rosier [Tue, 22 Jan 2013 18:18:22 +0000 (18:18 +0000)]
[ms-inline asm] Remove a warning about ms-style inline assembly not being
supported.

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

11 years agoMake getDefinitiveDeclContext() actually return a DeclContext, as one
Douglas Gregor [Tue, 22 Jan 2013 17:08:30 +0000 (17:08 +0000)]
Make getDefinitiveDeclContext() actually return a DeclContext, as one
would expect, and clean up the return/break inconsistencies. Thanks,
Sebastian!

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

11 years agoFix a bug in VarDecl::getSourceRange() for static member arrays with an element
Nico Weber [Tue, 22 Jan 2013 17:00:09 +0000 (17:00 +0000)]
Fix a bug in VarDecl::getSourceRange() for static member arrays with an element
type with an implicit initializer expression.

Patch from Will Wilson <will@indefiant.com>!

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

11 years agoFormatter: Remove a fixme klimek fixed in r173168.
Nico Weber [Tue, 22 Jan 2013 16:53:59 +0000 (16:53 +0000)]
Formatter: Remove a fixme klimek fixed in r173168.

Add a few comments to the ObjC test cases.

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

11 years agoImplements more principled comment parsing.
Manuel Klimek [Tue, 22 Jan 2013 16:31:55 +0000 (16:31 +0000)]
Implements more principled comment parsing.

Changing nextToken() in the UnwrappedLineParser to get the next
non-comment token. This allows us to correctly layout a whole class of
snippets, like:

if /* */(/* */ a /* */) /* */
  f() /* */; /* */
else /* */
  g();

Fixes a bug in the formatter where we would assume there is a previous
non-comment token.
Also adds the indent level of an unwrapped line to the debug output in
the parser.

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

11 years agoLet the formatter be more restrictive for breaking around . and ->
Daniel Jasper [Tue, 22 Jan 2013 14:28:24 +0000 (14:28 +0000)]
Let the formatter be more restrictive for breaking around . and ->

Before:
aaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
    .aaaaaaaaaaaaaaaaaa();

After:
aaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,
                aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa();

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

11 years agoFix "*" formatting when creating arrays of pointers.
Daniel Jasper [Tue, 22 Jan 2013 11:46:26 +0000 (11:46 +0000)]
Fix "*" formatting when creating arrays of pointers.

Before: A = new int * [10]();
After:  A = new int *[10]();

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

11 years agoSwitch to APFloat constructor taking fltSemantics.
Tim Northover [Tue, 22 Jan 2013 09:46:51 +0000 (09:46 +0000)]
Switch to APFloat constructor taking fltSemantics.

This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.

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

11 years ago[ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic...
Alexander Potapenko [Tue, 22 Jan 2013 09:27:00 +0000 (09:27 +0000)]
[ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic runtime.

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

11 years ago[ASan] Link with the dynamic runtime on OS X
Alexander Potapenko [Tue, 22 Jan 2013 09:16:03 +0000 (09:16 +0000)]
[ASan] Link with the dynamic runtime on OS X
This patch changes the behavior of the -fsanitize=address flag, making it use the dynamic runtime library (libclang_rt.asan_osx_dynamic.dylib) instead of the static one. It also drops the CoreFoundation dependency, since the dynamic runtime doesn't need it.

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

11 years agolibclang: Update comment about USEDLIBS in c-*-test/Makefile.
NAKAMURA Takumi [Tue, 22 Jan 2013 04:11:33 +0000 (04:11 +0000)]
libclang: Update comment about USEDLIBS in c-*-test/Makefile.

"Note that 'USEDLIBS' must include all of the core clang libraries when -static is given to linker on cygming."

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

11 years agoUse the correct field to copy/dispose a __block variable.
John McCall [Tue, 22 Jan 2013 03:56:22 +0000 (03:56 +0000)]
Use the correct field to copy/dispose a __block variable.

We were previously hard-coding a particular field index.  This was
fine before (because we were obviously guaranteed the presence
of a copy/dispose member) except for (1) alignment padding and
(2) future extensions adding extra members to the header, such
as the extended-layout pointer.

Note that we only introduce the extended-layout pointer in the
presence of structs.  (We also seem to be introducing it even
in the presence of an all-non-object layout, but that's a
different potential issue.)

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

11 years agoclang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind...
NAKAMURA Takumi [Tue, 22 Jan 2013 03:49:16 +0000 (03:49 +0000)]
clang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind, for now. Working in progress.

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

11 years agoclang/test: [CMake] check-clang doesn't require llvm-dis any more.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:52:04 +0000 (01:52 +0000)]
clang/test: [CMake] check-clang doesn't require llvm-dis any more.

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

11 years agoclang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1...
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:59 +0000 (01:51 +0000)]
clang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1 is sufficient here.

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

11 years agoclang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileChec...
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:54 +0000 (01:51 +0000)]
clang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileCheck-ize.

@llvm.stacksave is emitted regardless of "opt -std-compile-opts". We have optimizers' tests in llvm/test/Transforms.

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

11 years agoclang/test/CodeGen/blocks-seq.c: FileCheck-ize.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:48 +0000 (01:51 +0000)]
clang/test/CodeGen/blocks-seq.c: FileCheck-ize.

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

11 years agoRemove "incorrect" aligning of trailing comments.
Daniel Jasper [Mon, 21 Jan 2013 22:49:20 +0000 (22:49 +0000)]
Remove "incorrect" aligning of trailing comments.

We used to align trailing comments belong to different things.
Before:
void f() { // some function..
}
int a;     // some variable..

After:
void f() { // some function..
}
int a; // some variable..

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

11 years agoHave AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
Bill Wendling [Mon, 21 Jan 2013 22:45:00 +0000 (22:45 +0000)]
Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.

This further restricts the use of the Attribute class to the Attribute family of
classes.

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

11 years agoobjectiveC: don't warn when in -Wselector mode and
Fariborz Jahanian [Mon, 21 Jan 2013 22:32:29 +0000 (22:32 +0000)]
objectiveC: don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

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

11 years agoMake AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
Bill Wendling [Mon, 21 Jan 2013 21:57:40 +0000 (21:57 +0000)]
Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.

This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.

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

11 years agoGive ModuleFiles an index, so that we can use indexed vectors rather
Douglas Gregor [Mon, 21 Jan 2013 20:07:12 +0000 (20:07 +0000)]
Give ModuleFiles an index, so that we can use indexed vectors rather
than DenseMaps and SmallPtrSets for module-visitation data. ~2.6%
speedup for modules.

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

11 years agoEliminate Sema::CompareProperties(), which was walking over a pile of
Douglas Gregor [Mon, 21 Jan 2013 19:42:21 +0000 (19:42 +0000)]
Eliminate Sema::CompareProperties(), which was walking over a pile of
lexical declarations looking for properties when we could more
efficiently check for property mismatches at property declaration
time. Good for ~1% of -fsyntax-only time when most of the properties
we're checking against come from an AST file.

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

11 years agoFormatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.
Nico Weber [Mon, 21 Jan 2013 19:35:06 +0000 (19:35 +0000)]
Formatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.

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

11 years agoFormatter: Rename LSquare to Left to make parseSquare() more consistent with the...
Nico Weber [Mon, 21 Jan 2013 19:29:31 +0000 (19:29 +0000)]
Formatter: Rename LSquare to Left to make parseSquare() more consistent with the other paren parsing methods.

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

11 years agoFixes various problems around enum parsing.
Manuel Klimek [Mon, 21 Jan 2013 19:17:52 +0000 (19:17 +0000)]
Fixes various problems around enum parsing.

Very similar to what we do for record definitions:
- tighten down what is an enum definition, so that we don't mistake a
  function for an enum
- allow common idioms around declarations (we'll want to handle that
  more centrally in the future)

We now correctly format:
enum X f() {
  a();
  return 42;
}

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

11 years agoEliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, which
Douglas Gregor [Mon, 21 Jan 2013 19:05:22 +0000 (19:05 +0000)]
Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, which
did a redundant traversal of the lexical declarations in the
superclass. Instead, when we declare a new property, look into the
superclass to see whether we're redeclaring the property. Goot for 1%
of -fsyntax-only time on Cocoa.h and a little less than 3% on my
modules test case.

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

11 years ago[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if...
Argyrios Kyrtzidis [Mon, 21 Jan 2013 18:45:42 +0000 (18:45 +0000)]
[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if Precompilepreamble
is set to true because there is no FileManager at that point.

Patch by Hurcan Solter!

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

11 years ago[analyzer] Fix test for r173067.
Jordan Rose [Mon, 21 Jan 2013 18:41:05 +0000 (18:41 +0000)]
[analyzer] Fix test for r173067.

Note to self: don't remove comments /after/ updating the line-sensitive
part of a test.

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

11 years agoReplace some unnecessary O(N^2) lookups for properties with
Douglas Gregor [Mon, 21 Jan 2013 18:35:55 +0000 (18:35 +0000)]
Replace some unnecessary O(N^2) lookups for properties with
DeclContext lookups. The performance win is negligible in my tests,
but it's the Right Thing To Do (TM).

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

11 years ago[analyzer] Show notes inside implicit calls at the last explicit call site.
Jordan Rose [Mon, 21 Jan 2013 18:28:30 +0000 (18:28 +0000)]
[analyzer] Show notes inside implicit calls at the last explicit call site.

Before:
  struct Wrapper { <-- 2. Calling default constructor for 'NonTrivial'.
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.

After:
  struct Wrapper {
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.
             ^-- 2. Calling default constructor for 'NonTrivial'.

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

11 years agoReadSourceManagerBlock is skipping over records that can contain Blobs. Not passing
Chris Lattner [Mon, 21 Jan 2013 18:28:26 +0000 (18:28 +0000)]
ReadSourceManagerBlock is skipping over records that can contain Blobs.  Not passing
in a StringRef to bind to them forces them to be unpacked into the Record as individual
bytes.  This is wasteful, but not likely to be measurable in this instance.

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

11 years agoRevert r173056; it breaks one of the CodeGen-with-PCH tests.
Douglas Gregor [Mon, 21 Jan 2013 16:52:34 +0000 (16:52 +0000)]
Revert r173056; it breaks one of the CodeGen-with-PCH tests.

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

11 years agoWhen loading an identifier from an AST file solely for the purpose of
Douglas Gregor [Mon, 21 Jan 2013 16:47:11 +0000 (16:47 +0000)]
When loading an identifier from an AST file solely for the purpose of
forming the identifier, e.g., as part of a selector or a declaration
name, don't actually deserialize any information about the
identifier. Instead, simply mark it "out-of-date" and we'll load the
the information on demand. 2% speedup on the modules testcase I'm
looking at; should also help PCH.

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

11 years agoFixes formatting of empty blocks.
Manuel Klimek [Mon, 21 Jan 2013 16:42:44 +0000 (16:42 +0000)]
Fixes formatting of empty blocks.

We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement

Note that we usually don't put record definitions into a single line, as
there's usually at least one more token (the semicolon) after the
closing brace. This doesn't hold when we are in a context where there is
no semicolon, like "enum E {}".

There were some missing tests around joining lines around the corner
cases of the allowed number of columns, so this patch adds some.

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

11 years agoWhen deserializing a declaration, don't look for redeclarations if its
Douglas Gregor [Mon, 21 Jan 2013 16:16:40 +0000 (16:16 +0000)]
When deserializing a declaration, don't look for redeclarations if its
kind indicates that it can never be redeclared. Good for a 1% speedup,
and redeclaration searching drops off the profile.

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

11 years agoIntroduce a fast path for the ASTReader's name lookup within a
Douglas Gregor [Mon, 21 Jan 2013 15:25:38 +0000 (15:25 +0000)]
Introduce a fast path for the ASTReader's name lookup within a
DeclContext. When the DeclContext is of a kind that can only be
defined once and never updated, we limit the search to the module file
that conatins the lookup table. Provides a 15% speedup in one
modules-heavy source file.

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

11 years agoFix parsing of templated declarations.
Daniel Jasper [Mon, 21 Jan 2013 14:39:22 +0000 (14:39 +0000)]
Fix parsing of templated declarations.

Before: template <template <typename T>, typename P > class X;
After:  template <template <typename T>, typename P> class X;

More importantly, the token annotations for the second ">" are now computed
correctly.

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

11 years agoFixes indent in linkage specification blocks.
Manuel Klimek [Mon, 21 Jan 2013 14:32:05 +0000 (14:32 +0000)]
Fixes indent in linkage specification blocks.

We now indent:
extern "C" {
int a;
}

without additional indent inside the extern "C" block.

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

11 years agoFix bug discovered by valgrind.
Daniel Jasper [Mon, 21 Jan 2013 14:18:28 +0000 (14:18 +0000)]
Fix bug discovered by valgrind.

When trying to merge lines, we should not touch lines that are invalid,
as we don't know how long they might be.

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

11 years agoAdd regression test.
Manuel Klimek [Mon, 21 Jan 2013 14:16:56 +0000 (14:16 +0000)]
Add regression test.

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

11 years agoAST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]
NAKAMURA Takumi [Mon, 21 Jan 2013 14:15:24 +0000 (14:15 +0000)]
AST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]

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

11 years agoFixes detection of class template specializations.
Manuel Klimek [Mon, 21 Jan 2013 13:58:54 +0000 (13:58 +0000)]
Fixes detection of class template specializations.

Now correctly formats:
template <> class A<int> {} a;

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