Commit Graph

43045 Commits

Author SHA1 Message Date
Chad Rosier 709863514e Temporarily XFAIL this test; the compiler will segfault if the target-specific
parser is not included in the compiler. Thanks to Renato for discovering the
underlying issue.

llvm-svn: 173365
2013-01-24 20:33:35 +00:00
Chad Rosier 282d675b28 [ms-inline asm] Add an error when trying to compile MS-style inline assembly
for an unsupported architecture.
rdar://13063988

llvm-svn: 173364
2013-01-24 20:24:34 +00:00
Chad Rosier 633dcdc52d [driver] Associate a JobAction with each result file. This enables the driver
to delete result files for only those commands that fail.
Part of rdar://12984531

llvm-svn: 173361
2013-01-24 19:14:47 +00:00
Michael Han 9931593299 PR14922: when printing an attribute, use the real syntax of the attribute (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax.
Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. 
This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute.
When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and
name, then passed to Attr that will use the index to print itself. 

Thanks to Richard Smith for the idea and review.

llvm-svn: 173358
2013-01-24 16:46:58 +00:00
Joey Gouly 130a91e494 Fix a non-conformant OpenCL test case.
Program scope variables must be declared in the constant address space
and are required to be initialized.

llvm-svn: 173354
2013-01-24 15:24:54 +00:00
Joey Gouly 7b79dff544 Properly remove this test file, that I copied over to test/SemaOpenCL in r173352.
llvm-svn: 173353
2013-01-24 15:19:51 +00:00
Joey Gouly f9283a51b8 Fix an OpenCL test case that was OpenCL conformant.
It had program scope variables that were not in the constant address space,
make them to be function scope variables instead.
Also move the test to the SemaOpenCL directory.

llvm-svn: 173352
2013-01-24 15:14:22 +00:00
NAKAMURA Takumi e00c986897 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.
llvm-svn: 173330
2013-01-24 08:20:11 +00:00
NAKAMURA Takumi 7a23231e6b clang/test/Modules/global_index.m: XFAILing on win32 when investigating for now.
llvm-svn: 173326
2013-01-24 07:04:14 +00:00
Nick Lewycky 4db15f5101 Give warn_redecl_library_builtin a flag name: -Wincompatible-library-redeclaration.
llvm-svn: 173319
2013-01-24 03:43:15 +00:00
Nick Lewycky d24d5f2b79 Start checking nonnull (as well as format and argument_with_type_tag) on
overloaded binary operators.

llvm-svn: 173315
2013-01-24 02:03:08 +00:00
Nick Lewycky e112151a35 Fix some wonky formatting, remove spurious emacs major mode marker. No
functionality change!

llvm-svn: 173314
2013-01-24 01:12:16 +00:00
Richard Smith be8229c8c0 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.

llvm-svn: 173309
2013-01-23 23:38:20 +00:00
Bill Wendling 8879c43a53 Don't check lines beginning with '#', since they could contain a path with the unexpected word in them.
llvm-svn: 173307
2013-01-23 23:07:21 +00:00
Bill Wendling 1f631645f8 Don't check lines beginning with '#', since they could contain a path with the unexpected word in them.
llvm-svn: 173306
2013-01-23 23:06:28 +00:00
Bill Wendling 958d8f2fcd 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.
llvm-svn: 173305
2013-01-23 23:04:29 +00:00
Douglas Gregor 8ec343ccb1 Fix for case-sensitive file systems. Ugh
llvm-svn: 173303
2013-01-23 22:45:24 +00:00
Douglas Gregor 5e306b1233 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.

llvm-svn: 173301
2013-01-23 22:38:11 +00:00
Ted Kremenek aa300017e1 Add a test case for 'analyzer_noreturn' on category methods.
llvm-svn: 173295
2013-01-23 21:29:13 +00:00
Ted Kremenek 15b47bc872 Always process an index.html file if we have HTML output. Patch by Justin Bogner.
llvm-svn: 173294
2013-01-23 21:22:14 +00:00
Ted Kremenek 5b4500b43a Add missing null check. Not sure why my tests passed before.
llvm-svn: 173292
2013-01-23 21:12:49 +00:00
Ted Kremenek 54cd3c6811 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>.

llvm-svn: 173291
2013-01-23 21:00:27 +00:00
Daniel Jasper 39e2738c8b Add extra indent for nested calls inside if's.
Before:
if (aaaaaaaaaa(
    aaaaaaaaaa)) {}

After:
if (aaaaaaaaaa(
        aaaaaaaaaa)) {}

llvm-svn: 173290
2013-01-23 20:41:06 +00:00
Dmitri Gribenko 6c926ccbd2 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.

llvm-svn: 173286
2013-01-23 20:02:51 +00:00
Douglas Gregor bfd73d74b9 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.

llvm-svn: 173283
2013-01-23 18:53:14 +00:00
Sean Silva cc8fbbf129 docs: clear up ambiguity
Anybody using clang is a "developer".

llvm-svn: 173282
2013-01-23 18:28:48 +00:00
Argyrios Kyrtzidis 1ffbc3a92a [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

llvm-svn: 173281
2013-01-23 18:21:56 +00:00
Dmitri Gribenko 18d8a461e5 Documentation: add a note that -cc1 options are not guaranteed to be stable
llvm-svn: 173280
2013-01-23 18:02:28 +00:00
Dmitri Gribenko d15bb30dba libclang: change return type of getCursorDecl() to 'const Decl *'
llvm-svn: 173278
2013-01-23 17:25:27 +00:00
Dmitri Gribenko fe0483dbea Use 'const Decl *' throughout code completion in Sema
llvm-svn: 173277
2013-01-23 17:21:11 +00:00
Dmitri Gribenko aeeca770b3 Add constness for NestedNameSpecifier::Create parameter
llvm-svn: 173274
2013-01-23 17:06:56 +00:00
Daniel Jasper a836b90aa7 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.

llvm-svn: 173273
2013-01-23 16:58:21 +00:00
Dmitri Gribenko b53f37c978 Constify some getters in RedeclarableTemplateDecl
llvm-svn: 173272
2013-01-23 16:52:57 +00:00
Dmitri Gribenko f930448bf6 Remove uneeded casts
llvm-svn: 173269
2013-01-23 15:56:07 +00:00
Daniel Jasper 1565eb3e38 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.

llvm-svn: 173268
2013-01-23 15:55:19 +00:00
Manuel Klimek d053c5b43a Fix handling of macro definitions.
Now correctly formats:
 #define A (1)

llvm-svn: 173264
2013-01-23 14:37:36 +00:00
Manuel Klimek c1237a8b8f 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.

llvm-svn: 173262
2013-01-23 14:08:21 +00:00
Daniel Jasper 420d7d333e Fix the formatting of pointer/reference types in range-based for loops.
Before: for (int & a : Values) {}
After:  for (int &a : Values) {}
llvm-svn: 173259
2013-01-23 12:58:14 +00:00
Daniel Jasper 43b6548ce0 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));

llvm-svn: 173257
2013-01-23 12:27:43 +00:00
Daniel Jasper 5b49f47835 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.

llvm-svn: 173256
2013-01-23 12:10:53 +00:00
Joey Gouly dd7f4566b1 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.

llvm-svn: 173254
2013-01-23 11:56:20 +00:00
Daniel Jasper b9c0908f7c 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; }
llvm-svn: 173252
2013-01-23 11:15:14 +00:00
Manuel Klimek 390805731f Fixes incorrect handling of the declaration context stack.
llvm-svn: 173250
2013-01-23 11:03:04 +00:00
Manuel Klimek d33516ef32 Fix segfaults in the formatter.
Also: expletive deleted.
llvm-svn: 173247
2013-01-23 10:09:28 +00:00
Daniel Jasper e941b169db Add option to allow putting all parameters onto the next line.
This only affects styles where BinPackParameters is false.

With AllowAllParametersOnNextLine:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaa);

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

llvm-svn: 173246
2013-01-23 10:08:28 +00:00
Manuel Klimek 0a3a3c9900 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); }

llvm-svn: 173243
2013-01-23 09:32:48 +00:00
Bill Wendling e4e2e59740 Explicitly cast away the const-ness instead of doing it implicitly.
llvm-svn: 173241
2013-01-23 08:58:23 +00:00
Bill Wendling eade362f30 Explicitly cast away the const-ness instead of doing it implicitly.
llvm-svn: 173232
2013-01-23 08:25:41 +00:00
Bill Wendling ce2f9c5c63 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.

llvm-svn: 173229
2013-01-23 06:15:10 +00:00
Nick Lewycky c77c8e95e3 Make __attribute__((nonnull)) use the general expression evaluator to search for
nulls instead of limiting itself to the language-defined "null pointer
constant".

llvm-svn: 173227
2013-01-23 05:08:29 +00:00
NAKAMURA Takumi 7f63983da6 clang/test/Driver/output-file-is-dir.c: This requires shell due to 'cd'.
llvm-svn: 173218
2013-01-23 01:25:23 +00:00
Daniel Dunbar 582b2ab0dd [Driver] Don't remove non-regular files that were outputs.
llvm-svn: 173215
2013-01-23 01:08:23 +00:00
James Dennett f8317679cb 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.

llvm-svn: 173213
2013-01-23 00:45:44 +00:00
Bill Wendling 9a6779294f Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.

llvm-svn: 173211
2013-01-23 00:21:06 +00:00
Douglas Gregor 01c7cfa2c0 Fix compilation on Linux, which defines PATH_MAX in a weird place,
from Saleem Abdulrasool!

llvm-svn: 173208
2013-01-22 23:49:45 +00:00
Chad Rosier 10280a5ef4 Add a triple, per Ben's suggestion.
llvm-svn: 173198
2013-01-22 21:39:58 +00:00
Chad Rosier 163ca0e95e Second attempt to fix ppc bots.
llvm-svn: 173193
2013-01-22 20:57:10 +00:00
Chad Rosier 0c0c02c479 Add x86 requirement to hopefully fix ppc bots.
llvm-svn: 173190
2013-01-22 20:16:41 +00:00
Adhemerval Zanella 5d874aeea9 PowerPC: fix __builtin_eh_return_data_regno return
llvm-svn: 173188
2013-01-22 20:02:45 +00:00
Chad Rosier e3aac2c864 [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.

llvm-svn: 173186
2013-01-22 19:38:32 +00:00
Ted Kremenek c0da34e6ab 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>.

llvm-svn: 173184
2013-01-22 19:32:27 +00:00
Dmitri Gribenko c6f1e56745 Update docs: nullptr conversion tool landed
llvm-svn: 173183
2013-01-22 19:22:22 +00:00
Fariborz Jahanian 177480645a Small code change to improve performance
in my last patch, suggested by Argyrios.

llvm-svn: 173182
2013-01-22 19:05:17 +00:00
Fariborz Jahanian 02447d80e4 objectiveC (take two): don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

llvm-svn: 173179
2013-01-22 18:35:43 +00:00
Chad Rosier 33a6e11c21 [ms-inline asm] Remove a warning about ms-style inline assembly not being
supported.

llvm-svn: 173177
2013-01-22 18:18:22 +00:00
Douglas Gregor 7a6e20070d Make getDefinitiveDeclContext() actually return a DeclContext, as one
would expect, and clean up the return/break inconsistencies. Thanks,
Sebastian!

llvm-svn: 173171
2013-01-22 17:08:30 +00:00
Nico Weber bbe1394c96 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>!

llvm-svn: 173170
2013-01-22 17:00:09 +00:00
Nico Weber 6029d4f3ae Formatter: Remove a fixme klimek fixed in r173168.
Add a few comments to the ObjC test cases.

llvm-svn: 173169
2013-01-22 16:53:59 +00:00
Manuel Klimek f92f7bc540 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.

llvm-svn: 173168
2013-01-22 16:31:55 +00:00
Daniel Jasper 50e7ab7185 Let the formatter be more restrictive for breaking around . and ->
Before:
aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa)
    .aaaaaaaaaaaaaaaaaa();

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

llvm-svn: 173160
2013-01-22 14:28:24 +00:00
Daniel Jasper 0b8206029b Fix "*" formatting when creating arrays of pointers.
Before: A = new int * [10]();
After:  A = new int *[10]();
llvm-svn: 173150
2013-01-22 11:46:26 +00:00
Tim Northover 178723a687 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.

llvm-svn: 173139
2013-01-22 09:46:51 +00:00
Alexander Potapenko 015333f88c [ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic runtime.
llvm-svn: 173137
2013-01-22 09:27:00 +00:00
Alexander Potapenko f6b56972d5 [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.

llvm-svn: 173135
2013-01-22 09:16:03 +00:00
NAKAMURA Takumi 873a63ce19 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."

llvm-svn: 173124
2013-01-22 04:11:33 +00:00
John McCall f593b10d04 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.)

llvm-svn: 173122
2013-01-22 03:56:22 +00:00
NAKAMURA Takumi c6d09603ad clang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind, for now. Working in progress.
llvm-svn: 173121
2013-01-22 03:49:16 +00:00
NAKAMURA Takumi df0b43d1f9 clang/test: [CMake] check-clang doesn't require llvm-dis any more.
llvm-svn: 173116
2013-01-22 01:52:04 +00:00
NAKAMURA Takumi 7b597946b1 clang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1 is sufficient here.
llvm-svn: 173115
2013-01-22 01:51:59 +00:00
NAKAMURA Takumi 73871f6632 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.

llvm-svn: 173114
2013-01-22 01:51:54 +00:00
NAKAMURA Takumi 3bb0aa7625 clang/test/CodeGen/blocks-seq.c: FileCheck-ize.
llvm-svn: 173113
2013-01-22 01:51:48 +00:00
Daniel Jasper 304a986a72 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..

llvm-svn: 173100
2013-01-21 22:49:20 +00:00
Bill Wendling b7abb30d77 Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
This further restricts the use of the Attribute class to the Attribute family of
classes.

llvm-svn: 173099
2013-01-21 22:45:00 +00:00
Fariborz Jahanian 60ccb9b2a9 objectiveC: don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

llvm-svn: 173097
2013-01-21 22:32:29 +00:00
Bill Wendling 304f6f0a59 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.

llvm-svn: 173095
2013-01-21 21:57:40 +00:00
Douglas Gregor bdb259d223 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.

llvm-svn: 173081
2013-01-21 20:07:12 +00:00
Douglas Gregor b898209086 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.

llvm-svn: 173079
2013-01-21 19:42:21 +00:00
Nico Weber 767c8d3570 Formatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.
llvm-svn: 173078
2013-01-21 19:35:06 +00:00
Nico Weber ed272de0f2 Formatter: Rename LSquare to Left to make parseSquare() more consistent with the other paren parsing methods.
llvm-svn: 173077
2013-01-21 19:29:31 +00:00
Manuel Klimek 2cec01916c 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;
}

llvm-svn: 173075
2013-01-21 19:17:52 +00:00
Douglas Gregor 90d3442784 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.

llvm-svn: 173073
2013-01-21 19:05:22 +00:00
Argyrios Kyrtzidis 3ad52ede46 [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!

llvm-svn: 173071
2013-01-21 18:45:42 +00:00
Jordan Rose a60e9268b6 [analyzer] Fix test for r173067.
Note to self: don't remove comments /after/ updating the line-sensitive
part of a test.

llvm-svn: 173070
2013-01-21 18:41:05 +00:00
Douglas Gregor a669ab9856 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).

llvm-svn: 173068
2013-01-21 18:35:55 +00:00
Jordan Rose 78328be4b7 [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'.

llvm-svn: 173067
2013-01-21 18:28:30 +00:00
Chris Lattner 15c3e7dab5 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.

llvm-svn: 173066
2013-01-21 18:28:26 +00:00
Douglas Gregor c8a992f727 Revert r173056; it breaks one of the CodeGen-with-PCH tests.
llvm-svn: 173058
2013-01-21 16:52:34 +00:00
Douglas Gregor d8666e49cc 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.

llvm-svn: 173056
2013-01-21 16:47:11 +00:00
Manuel Klimek a4fe1c13c0 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.

llvm-svn: 173055
2013-01-21 16:42:44 +00:00
Douglas Gregor fe732d538f 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.

llvm-svn: 173054
2013-01-21 16:16:40 +00:00