Commit Graph

43055 Commits

Author SHA1 Message Date
Douglas Gregor e41d7feaf5 Optimize ModuleManager::visit() by precomputing the visitation order
and limiting ourselves to two memory allocations. 10% speedup in
-fsyntax-only time for modules.

With this change, we can actually see some performance different from
the global module index, but it's still about 1%.

llvm-svn: 173512
2013-01-25 22:25:23 +00:00
Dmitri Gribenko c9f860d124 Remove useless 'XPASS: *' from tests
llvm-svn: 173511
2013-01-25 22:20:24 +00:00
Renato Golin 7b80076b79 Temporarily disabling ms-asm test
llvm-svn: 173510
2013-01-25 22:13:50 +00:00
Dmitri Gribenko 699ad11c58 This test actually passes, just add the missing expected-error
llvm-svn: 173504
2013-01-25 22:08:24 +00:00
Dmitri Gribenko 472661479a Migrate test from grep to -fdiagnostics-parseable-fixits
llvm-svn: 173496
2013-01-25 21:41:29 +00:00
Daniel Dunbar 23af2b1a2c [utils] Remove the OptionalTests subdir no one runs.
llvm-svn: 173491
2013-01-25 21:12:20 +00:00
Daniel Dunbar e462e0f665 [utils] Remove C++Tests that I don't think anyone uses anymore.
llvm-svn: 173490
2013-01-25 21:12:17 +00:00
Alexander Kornienko 09f15f3edf Silence unintended fallthrough diagnostic on a case label preceded with a normal label.
Summary:
It's unlikely that a fallthrough is unintended in the following code:
switch (n) {
...
  label:
  case 1:
...
    goto label;
...
}

Reviewers: rsmith, doug.gregor

Reviewed By: doug.gregor

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D329

llvm-svn: 173486
2013-01-25 20:44:56 +00:00
Dmitri Gribenko f079de0a08 FileCheck'ize tests
llvm-svn: 173484
2013-01-25 20:34:08 +00:00
Dmitri Gribenko d9c7ceebde Migrate tests to -verify and merge them
llvm-svn: 173482
2013-01-25 20:33:53 +00:00
Daniel Dunbar b7eaa6b8ac [tests] Force a triple to ensure /usr/include is one of the entries.
llvm-svn: 173469
2013-01-25 18:50:18 +00:00
Daniel Dunbar bd5dfe4511 [tests] Add a test for -iwithprefix.
- This just scratches the surface, We have pretty horrible test coverage in
   this area it seems like, but this at least covers the change in r173410.

llvm-svn: 173464
2013-01-25 18:08:53 +00:00
Fariborz Jahanian d0ed6c249d Add space after ';'.
llvm-svn: 173462
2013-01-25 17:47:49 +00:00
Fariborz Jahanian 740396437b Improve diagnsotic further on integer overflow.
llvm-svn: 173461
2013-01-25 17:19:07 +00:00
Alexander Kornienko 5548879324 Don't suggest to insert [[clang::fallthrough]] before empty cases. Fix for multiple case labels.
llvm-svn: 173458
2013-01-25 15:49:34 +00:00
Daniel Jasper 7a31af140b Fix some alignment and line break decisions.
This combines two small changes:
1) Put a penalty on breaking after "<"
2) Only produce a hanging indent when parameters are separated by
commas.

Before:
aaaaaaaaaaaaaaaaaaaaaaaa<
    aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa>(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaa(new Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
               aaaaaaaaaaaaaaaaaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa>(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaa(new Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaa));

This changes one ObjC test, but AFAICT this is not according to any
style guide (neither before nor after). We probably should be aligning
on the ":" there according to:
http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml?showone=Method_Invocations#Method_Invocations

llvm-svn: 173457
2013-01-25 15:43:32 +00:00
NAKAMURA Takumi e8f83dbbd8 Lexer.cpp: Fix a warning with ptrdiff_t on i686. [-Wsign-compare]
llvm-svn: 173447
2013-01-25 14:57:21 +00:00
NAKAMURA Takumi e83aea35ba clang/test/PCH/modified-header-error.c: Disable it again. It had been problematic on win32 for while.
llvm-svn: 173439
2013-01-25 11:07:42 +00:00
Daniel Jasper 45797021b7 Allow breaking after "::" if absolutely necessary.
Otherwise, really long nested name specifiers can easily lead to a
violation of the column limit.

Not sure about the rules for indentation in those cases, so input is
appreciated (see tests.).

llvm-svn: 173438
2013-01-25 10:57:27 +00:00
NAKAMURA Takumi a6202a23e6 ConvertUTF.h: Suppress a warning with ptrdiff_t on i686. [-Wsign-compare]
llvm-svn: 173436
2013-01-25 10:01:35 +00:00
NAKAMURA Takumi 10ee17d6f8 clang/test/Driver/output-file-cleanup.c: Add arm and powerpc to XFAIL.
..."ppc" was not recognized here.

llvm-svn: 173435
2013-01-25 09:43:17 +00:00
Nick Lewycky 29bcacd79d Add missing InGroup for this warning.
llvm-svn: 173429
2013-01-25 07:31:12 +00:00
NAKAMURA Takumi 2a99463b0f clang/test/Driver/output-file-cleanup.c: Mark it as XFAIL:*-mingw32, ppc, for now.
llvm-svn: 173428
2013-01-25 06:56:45 +00:00
NAKAMURA Takumi dc0c1c3d75 clang/test/Index/crash-recovery-*.c: Drop 'REQUIRES:shell". "test !" is available on Lit win32 since r173421.
llvm-svn: 173422
2013-01-25 06:31:02 +00:00
NAKAMURA Takumi d7512b347a clang/test: Drop "REQUIRES:shell" in three tests. They can run on win32.
llvm-svn: 173419
2013-01-25 06:02:11 +00:00
NAKAMURA Takumi eed02e944c clang/test/CodeGenCXX/debug-info-static-member.cpp: Appease targetting msvc to add explicit -target x86_64-unknown-unknown.
with -target i686-win32, you will see;

debug-info-static-member.cpp:11:22: error: in-class initializer for static data member of type 'const float' requires 'constexpr' specifier [-Wstatic-float-init]
  const static float const_b = 3.14;
                     ^         ~~~~
  constexpr

llvm-svn: 173418
2013-01-25 05:58:53 +00:00
NAKAMURA Takumi 2d765204d9 Create clang/test/Driver/lit.local.cfg.
These files had been ignored.

  - clang_f_opts.h
  - debug-comp-dir.S
  - debug-main-file.S

llvm-svn: 173416
2013-01-25 05:09:37 +00:00
Richard Smith cf656385ea Sync 'in class initialization of static const double' extension up with GCC,
and split it out of -Wgnu into its own warning flag.

 * In C++11, this is now a hard error (GCC has no extension here in C++11 mode).
   The error can be disabled with -Wno-static-float-init, and has a fixit to
   add 'constexpr'.

 * In C++98, this is still an ExtWarn, but is now controlled by
   -Wstatic-float-init as well as -Wgnu.

llvm-svn: 173414
2013-01-25 04:22:16 +00:00
Daniel Dunbar 606420e869 [Frontend] Remove another IsUserSpecified member variable that is now unused.
llvm-svn: 173412
2013-01-25 01:50:47 +00:00
Daniel Dunbar 6b04f1d1be [Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.
llvm-svn: 173411
2013-01-25 01:50:39 +00:00
Daniel Dunbar c9c57e9181 [Frontend] The -iwithprefix option belongs in the After category, according to
GCC docs.
 - Found by inspection.

llvm-svn: 173410
2013-01-25 01:50:34 +00:00
Daniel Dunbar ae4feb62e0 [Lex] Remove DirectoryLookup.UserSpecified, which is unused.
llvm-svn: 173409
2013-01-25 01:50:28 +00:00
NAKAMURA Takumi f0add23a0e Serialization/GlobalModuleIndex.cpp: Fixup r173405, <cstdio>
llvm-svn: 173408
2013-01-25 01:47:07 +00:00
Douglas Gregor e060e57bf7 Implement the reader of the global module index and wire it into the
AST reader.

The global module index tracks all of the identifiers known to a set
of module files. Lookup of those identifiers looks first in the global
module index, which returns the set of module files in which that
identifier can be found. The AST reader only needs to look into those
module files and any module files not known to the global index (e.g.,
because they were (re)built after the global index), reducing the
number of on-disk hash tables to visit. For an example source I'm
looking at, we go from 237844 total identifier lookups into on-disk
hash tables down to 126817.

Unfortunately, this does not translate into a performance advantage.
At best, it's a wash once the global module index has been built, but
that's ignore the cost of building the global module index (which
is itself fairly large). Profiles show that the global module index
code is far less efficient than it should be; optimizing it might give
enough of an advantage to justify its continued inclusion.

llvm-svn: 173405
2013-01-25 01:03:03 +00:00
Douglas Gregor c1bbec85a8 Rename the -cc1 option "-generate-module-index" to
"-fmodules-global-index" and expand its behavior to include both the
use and generation of the global module index.

llvm-svn: 173404
2013-01-25 00:45:27 +00:00
Douglas Gregor 00a50f742a Track the number of lookups and hits into the on-disk hash tables for
identifiers within the AST file reader.

llvm-svn: 173403
2013-01-25 00:38:33 +00:00
Jordan Rose 8b4af2ae88 Clarify comment: "diagnose" is better than "warn" when emitting an error.
Thanks, Dmitri.

llvm-svn: 173400
2013-01-25 00:20:28 +00:00
Richard Smith f3814ad426 Clean up: since we have FunctionDecl::IsInline, make it store the right value
for template instantiations, and use it to simplify the implementation of
FunctionDecl::isInlined().

This incidentally changes the result of isInlined on a declared-but-not-defined
non-inline member function from true to false. This is sort of a bug fix, but
currently isInlined is only called on function definitions, so it has no visible
effects.

llvm-svn: 173397
2013-01-25 00:08:28 +00:00
Dmitri Gribenko e29dadb640 FileCheck'ize test
llvm-svn: 173396
2013-01-25 00:06:54 +00:00
Dmitri Gribenko a5ef1517d9 FileCheck'ize test
llvm-svn: 173393
2013-01-24 23:44:04 +00:00
Anna Zaks 69aec48baa [analyzer] Fixup for r173385 and r173386 - initialize the members.
llvm-svn: 173392
2013-01-24 23:40:17 +00:00
Dmitri Gribenko dfbd119c8b FileCheck'ize test
llvm-svn: 173391
2013-01-24 23:34:51 +00:00
Dmitri Gribenko 53616ad42d FileCheck'ize test
llvm-svn: 173389
2013-01-24 23:29:37 +00:00
Fariborz Jahanian ee19ceb409 Fixes text of diagnostics in integer overflow patch.
llvm-svn: 173388
2013-01-24 23:24:32 +00:00
Dmitri Gribenko 4a44beb5fd FileCheck'ize test/SemaCXX/qualified-names-print.cpp and merge it to other
-ast-print tests

llvm-svn: 173387
2013-01-24 23:21:11 +00:00
Anna Zaks 36d988f023 [analyzer] Add "-analyzer-config mode=[deep|shallow] ".
The idea is to introduce a higher level "user mode" option for
different use scenarios. For example, if one wants to run the analyzer
for a small project each time the code is built, they would use
the "shallow" mode. 

The user mode option will influence the default settings for the
lower-level analyzer options. For now, this just influences the ipa
modes, but we plan to find more optimal settings for them.

llvm-svn: 173386
2013-01-24 23:15:34 +00:00
Anna Zaks 6bab4ef4e8 [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".
The idea is to eventually place all analyzer options under
"analyzer-config". In addition, this lays the ground for introduction of
a high-level analyzer mode option, which will influence the
default setting for IPAMode.

llvm-svn: 173385
2013-01-24 23:15:30 +00:00
Anna Zaks c7f5e69e50 [analyzer] refactor: access IPAMode through the accessor.
llvm-svn: 173384
2013-01-24 23:15:25 +00:00
Jordan Rose b18179da33 scan-build: Add a --keep-empty option for better testing.
SATestBuild expects to compare output directories for each invocation of
scan-build that it runs, but scan-build clears out empty directories by
default. We were coincidentally not getting that behavior until r173294.

llvm-svn: 173383
2013-01-24 23:07:59 +00:00
David Blaikie 35d0e27b78 FileCheck-ify some debug info scope related tests.
llvm-svn: 173379
2013-01-24 22:47:48 +00:00