Commit Graph

43045 Commits

Author SHA1 Message Date
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
Fariborz Jahanian bbcf8548cb removed duplicated comment.
llvm-svn: 173378
2013-01-24 22:26:55 +00:00
Fariborz Jahanian e735ff93e8 Patch to check for integer overflow. It has been
commented on and approved by Richard Smith.

llvm-svn: 173377
2013-01-24 22:11:45 +00:00
Jordan Rose 858bf6eda5 Move 'convertUTF8Sequence' helper into the C++ section of the header file.
It's annotated as "inline", but ConvertUTF.c should still be able to compile
as C89.

llvm-svn: 173376
2013-01-24 21:48:50 +00:00
Akira Hatanaka 4f15fb46a1 [mips] Do not emit i32 padding if target ABI is O32. This was causing backend
to pass floating point arguments to be passed in integer registers.

llvm-svn: 173375
2013-01-24 21:47:33 +00:00
Jordan Rose d4960d3eb1 Test fix-it ranges for Unicode characters.
Also, remove stray -fdiagnostics-parseable-fixits from ucn-pp-identifier.

llvm-svn: 173373
2013-01-24 21:19:51 +00:00
Jordan Rose 62db5066e9 Add a fixit for \U1234 -> \u1234.
llvm-svn: 173371
2013-01-24 20:50:52 +00:00
Jordan Rose 4246ae0089 As an extension, treat Unicode whitespace characters as whitespace.
llvm-svn: 173370
2013-01-24 20:50:50 +00:00
Jordan Rose 7f43dddae0 Handle universal character names and Unicode characters outside of literals.
This is a missing piece for C99 conformance.

This patch handles UCNs by adding a '\\' case to LexTokenInternal and
LexIdentifier -- if we see a backslash, we tentatively try to read in a UCN.
If the UCN is not syntactically well-formed, we fall back to the old
treatment: a backslash followed by an identifier beginning with 'u' (or 'U').

Because the spelling of an identifier with UCNs still has the UCN in it, we
need to convert that to UTF-8 in Preprocessor::LookUpIdentifierInfo.

Of course, valid code that does *not* use UCNs will see only a very minimal
performance hit (checks after each identifier for non-ASCII characters,
checks when converting raw_identifiers to identifiers that they do not
contain UCNs, and checks when getting the spelling of an identifier that it
does not contain a UCN).

This patch also adds basic support for actual UTF-8 in the source. This is
treated almost exactly the same as UCNs except that we consider stray
Unicode characters to be mistakes and offer a fixit to remove them.

llvm-svn: 173369
2013-01-24 20:50:46 +00:00
Jordan Rose aa89cf1a66 Unify diagnostics for \x, \u, and \U without any following hex digits.
llvm-svn: 173368
2013-01-24 20:50:13 +00:00
Chad Rosier 879edcd1a4 Fail these tests in a way that doesn't cause unexpected successes, per Daniel's
suggestion.

llvm-svn: 173367
2013-01-24 20:46:39 +00:00