]> granicus.if.org Git - clang/log
clang
11 years agoHighlight various parts of the AST dump with color. Colors are controlled by
Richard Trieu [Sat, 26 Jan 2013 01:31:20 +0000 (01:31 +0000)]
Highlight various parts of the AST dump with color.  Colors are controlled by
-f(no-)color-diagnostics.  In addition, dumpColor() function calls are added
to force color printing.  No structural changes to -ast-dump.

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

11 years ago[analyzer] Track null object lvalues back through C++ method calls.
Jordan Rose [Sat, 26 Jan 2013 01:28:23 +0000 (01:28 +0000)]
[analyzer] Track null object lvalues back through C++ method calls.

The expression 'a->b.c()' contains a call to the 'c' method of 'a->b'.
We emit an error if 'a' is NULL, but previously didn't actually track
the null value back through the 'a->b' expression, which caused us to
miss important false-positive-suppression cases, including
<rdar://problem/12676053>.

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

11 years ago[analyzer] bugreporter::getDerefExpr now takes a Stmt, not an ExplodedNode.
Jordan Rose [Sat, 26 Jan 2013 01:28:19 +0000 (01:28 +0000)]
[analyzer] bugreporter::getDerefExpr now takes a Stmt, not an ExplodedNode.

This allows it to be used in places where the interesting statement
doesn't match up with the current node. No functionality change.

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

11 years ago[analyzer] Add 'prune-paths' config option to disable path pruning.
Jordan Rose [Sat, 26 Jan 2013 01:28:15 +0000 (01:28 +0000)]
[analyzer] Add 'prune-paths' config option to disable path pruning.

This should be used for testing only. Path pruning is still on by default.

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

11 years ago[analyzer] Rename PruneNullReturnPaths to SuppressNullReturnPaths.
Jordan Rose [Sat, 26 Jan 2013 01:28:09 +0000 (01:28 +0000)]
[analyzer] Rename PruneNullReturnPaths to SuppressNullReturnPaths.

"Prune" is the term for eliminating pieces of a path that are not
relevant to the user. "Suppress" means don't show that path at all.

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

11 years agoFix up the test.
Fariborz Jahanian [Sat, 26 Jan 2013 01:25:32 +0000 (01:25 +0000)]
Fix up the test.
for // rdar://11861085

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

11 years agoSince we're stuck with realpath for the header <-> module mapping,
Douglas Gregor [Sat, 26 Jan 2013 00:55:12 +0000 (00:55 +0000)]
Since we're stuck with realpath for the header <-> module mapping,
factor the realpath calls into FileManager::getCanonicalName() so we
can cache the results of this epically slow operation. 5% speedup on
my modules test, and realpath drops out of the profile.

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

11 years agoRevert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add a
Richard Smith [Sat, 26 Jan 2013 00:39:02 +0000 (00:39 +0000)]
Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add a
testcase for a situation it caused us to miss.

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

11 years agoComment parsing: actually check for a block command after "\param x"
Dmitri Gribenko [Sat, 26 Jan 2013 00:36:14 +0000 (00:36 +0000)]
Comment parsing: actually check for a block command after "\param x"

This fixes PR15068.

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

11 years agoPreserve Sema::UndefinedInternals across PCH boundaries. Fixes
Nick Lewycky [Sat, 26 Jan 2013 00:35:08 +0000 (00:35 +0000)]
Preserve Sema::UndefinedInternals across PCH boundaries. Fixes
-Wundefined-internal warnings with PCH.

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

11 years agopatch for PR9027 and // rdar://11861085
Fariborz Jahanian [Fri, 25 Jan 2013 23:57:05 +0000 (23:57 +0000)]
patch for PR9027 and // rdar://11861085
Title: [PR9027] volatile struct bug: member is not loaded at -O;
This is caused by last flag passed to @llvm.memcpy being false,
not honoring that aggregate has at least one 'volatile' data member
(even though aggregate itself has not been qualified as 'volatile'.
As a result, optimization optimizes away the memcpy altogether.
Patch review by John MaCall (I still need to fix up a test though).

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

11 years agoclang/test/Index/annotate-comments-typedef.m: Remove CommentXMLValid in CHECKs. Don...
NAKAMURA Takumi [Fri, 25 Jan 2013 23:56:54 +0000 (23:56 +0000)]
clang/test/Index/annotate-comments-typedef.m: Remove CommentXMLValid in CHECKs. Don't assume libxml2 here.

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

11 years agoARM says that the array cookie should always be eight bytes.
John McCall [Fri, 25 Jan 2013 23:36:19 +0000 (23:36 +0000)]
ARM says that the array cookie should always be eight bytes.
ARM is not thinking about over-aligned structures.
Overrule ARM in both our generic-ARM and iOS ABI implementations.

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

11 years agoMove the decision about the kind of CGCXXABI to make inside
John McCall [Fri, 25 Jan 2013 23:36:14 +0000 (23:36 +0000)]
Move the decision about the kind of CGCXXABI to make inside
the family-specific files.

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

11 years agoImprove coordination between the module manager and the global module
Douglas Gregor [Fri, 25 Jan 2013 23:32:03 +0000 (23:32 +0000)]
Improve coordination between the module manager and the global module
index, optimizing the operation that skips lookup in modules where we
know the identifier will not be found. This makes the global module
index optimization actually useful, providing an 8.5% speedup over
modules without the global module index for -fsyntax-only.

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

11 years agoclang/test/Preprocessor/iwithprefix.c: Tweak default includes not to use /usr/include.
NAKAMURA Takumi [Fri, 25 Jan 2013 23:17:20 +0000 (23:17 +0000)]
clang/test/Preprocessor/iwithprefix.c: Tweak default includes not to use /usr/include.

You may see such a message on non-posix system;
  ignoring nonexistent directory "/usr/local/include"
  ignoring nonexistent directory "/usr/include"

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

11 years ago[utils] Kill another no-longer-useful utility script.
Daniel Dunbar [Fri, 25 Jan 2013 23:12:17 +0000 (23:12 +0000)]
[utils] Kill another no-longer-useful utility script.

 - We are long past the days of getting clang to fail in mass on swaths of code,
   fortunately.

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

11 years agosimplify code by removing excessive bracing.
Fariborz Jahanian [Fri, 25 Jan 2013 23:08:39 +0000 (23:08 +0000)]
simplify code by removing excessive bracing.

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

11 years agoAttach enum's documentation to its typedef if
Fariborz Jahanian [Fri, 25 Jan 2013 22:48:32 +0000 (22:48 +0000)]
Attach enum's documentation to its typedef if
latter does not have one of its own. // rdar://13067629

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

11 years agoThe standard ARM C++ ABI dictates that inline functions are
John McCall [Fri, 25 Jan 2013 22:31:03 +0000 (22:31 +0000)]
The standard ARM C++ ABI dictates that inline functions are
never key functions.  We did not implement that rule for the
iOS ABI, which was driven by what was implemented in gcc-4.2.
However, implement it now for other ARM-based platforms.

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

11 years agoFirst pass at abstracting out a class for the target C++ ABI.
John McCall [Fri, 25 Jan 2013 22:30:49 +0000 (22:30 +0000)]
First pass at abstracting out a class for the target C++ ABI.

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

11 years agoOptimize ModuleManager::visit() by precomputing the visitation order
Douglas Gregor [Fri, 25 Jan 2013 22:25:23 +0000 (22:25 +0000)]
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%.

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

11 years agoRemove useless 'XPASS: *' from tests
Dmitri Gribenko [Fri, 25 Jan 2013 22:20:24 +0000 (22:20 +0000)]
Remove useless 'XPASS: *' from tests

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

11 years agoTemporarily disabling ms-asm test
Renato Golin [Fri, 25 Jan 2013 22:13:50 +0000 (22:13 +0000)]
Temporarily disabling ms-asm test

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

11 years agoThis test actually passes, just add the missing expected-error
Dmitri Gribenko [Fri, 25 Jan 2013 22:08:24 +0000 (22:08 +0000)]
This test actually passes, just add the missing expected-error

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

11 years agoMigrate test from grep to -fdiagnostics-parseable-fixits
Dmitri Gribenko [Fri, 25 Jan 2013 21:41:29 +0000 (21:41 +0000)]
Migrate test from grep to -fdiagnostics-parseable-fixits

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

11 years agoRemove empty directories.
Daniel Dunbar [Fri, 25 Jan 2013 21:15:32 +0000 (21:15 +0000)]
Remove empty directories.

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

11 years ago[utils] Remove the OptionalTests subdir no one runs.
Daniel Dunbar [Fri, 25 Jan 2013 21:12:20 +0000 (21:12 +0000)]
[utils] Remove the OptionalTests subdir no one runs.

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

11 years ago[utils] Remove C++Tests that I don't think anyone uses anymore.
Daniel Dunbar [Fri, 25 Jan 2013 21:12:17 +0000 (21:12 +0000)]
[utils] Remove C++Tests that I don't think anyone uses anymore.

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

11 years agoSilence unintended fallthrough diagnostic on a case label preceded with a normal...
Alexander Kornienko [Fri, 25 Jan 2013 20:44:56 +0000 (20:44 +0000)]
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

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

11 years agoFileCheck'ize tests
Dmitri Gribenko [Fri, 25 Jan 2013 20:34:08 +0000 (20:34 +0000)]
FileCheck'ize tests

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

11 years agoMigrate tests to -verify and merge them
Dmitri Gribenko [Fri, 25 Jan 2013 20:33:53 +0000 (20:33 +0000)]
Migrate tests to -verify and merge them

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

11 years ago[tests] Force a triple to ensure /usr/include is one of the entries.
Daniel Dunbar [Fri, 25 Jan 2013 18:50:18 +0000 (18:50 +0000)]
[tests] Force a triple to ensure /usr/include is one of the entries.

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

11 years ago[tests] Add a test for -iwithprefix.
Daniel Dunbar [Fri, 25 Jan 2013 18:08:53 +0000 (18:08 +0000)]
[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.

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

11 years agoAdd space after ';'.
Fariborz Jahanian [Fri, 25 Jan 2013 17:47:49 +0000 (17:47 +0000)]
Add space after ';'.

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

11 years agoImprove diagnsotic further on integer overflow.
Fariborz Jahanian [Fri, 25 Jan 2013 17:19:07 +0000 (17:19 +0000)]
Improve diagnsotic further on integer overflow.

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

11 years agoDon't suggest to insert [[clang::fallthrough]] before empty cases. Fix for multiple...
Alexander Kornienko [Fri, 25 Jan 2013 15:49:34 +0000 (15:49 +0000)]
Don't suggest to insert [[clang::fallthrough]] before empty cases. Fix for multiple case labels.

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

11 years agoFix some alignment and line break decisions.
Daniel Jasper [Fri, 25 Jan 2013 15:43:32 +0000 (15:43 +0000)]
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<
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaa(new Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
               aaaaaaaaaaaaaaaaaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>(
    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

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

11 years agoLexer.cpp: Fix a warning with ptrdiff_t on i686. [-Wsign-compare]
NAKAMURA Takumi [Fri, 25 Jan 2013 14:57:21 +0000 (14:57 +0000)]
Lexer.cpp: Fix a warning with ptrdiff_t on i686. [-Wsign-compare]

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

11 years agoclang/test/PCH/modified-header-error.c: Disable it again. It had been problematic...
NAKAMURA Takumi [Fri, 25 Jan 2013 11:07:42 +0000 (11:07 +0000)]
clang/test/PCH/modified-header-error.c: Disable it again. It had been problematic on win32 for while.

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

11 years agoAllow breaking after "::" if absolutely necessary.
Daniel Jasper [Fri, 25 Jan 2013 10:57:27 +0000 (10:57 +0000)]
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.).

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

11 years agoConvertUTF.h: Suppress a warning with ptrdiff_t on i686. [-Wsign-compare]
NAKAMURA Takumi [Fri, 25 Jan 2013 10:01:35 +0000 (10:01 +0000)]
ConvertUTF.h: Suppress a warning with ptrdiff_t on i686. [-Wsign-compare]

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

11 years agoclang/test/Driver/output-file-cleanup.c: Add arm and powerpc to XFAIL.
NAKAMURA Takumi [Fri, 25 Jan 2013 09:43:17 +0000 (09:43 +0000)]
clang/test/Driver/output-file-cleanup.c: Add arm and powerpc to XFAIL.

..."ppc" was not recognized here.

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

11 years agoAdd missing InGroup for this warning.
Nick Lewycky [Fri, 25 Jan 2013 07:31:12 +0000 (07:31 +0000)]
Add missing InGroup for this warning.

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

11 years agoclang/test/Driver/output-file-cleanup.c: Mark it as XFAIL:*-mingw32, ppc, for now.
NAKAMURA Takumi [Fri, 25 Jan 2013 06:56:45 +0000 (06:56 +0000)]
clang/test/Driver/output-file-cleanup.c: Mark it as XFAIL:*-mingw32, ppc, for now.

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

11 years agoclang/test/Index/crash-recovery-*.c: Drop 'REQUIRES:shell". "test !" is available...
NAKAMURA Takumi [Fri, 25 Jan 2013 06:31:02 +0000 (06:31 +0000)]
clang/test/Index/crash-recovery-*.c: Drop 'REQUIRES:shell". "test !" is available on Lit win32 since r173421.

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

11 years agoclang/test: Drop "REQUIRES:shell" in three tests. They can run on win32.
NAKAMURA Takumi [Fri, 25 Jan 2013 06:02:11 +0000 (06:02 +0000)]
clang/test: Drop "REQUIRES:shell" in three tests. They can run on win32.

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

11 years agoclang/test/CodeGenCXX/debug-info-static-member.cpp: Appease targetting msvc to add...
NAKAMURA Takumi [Fri, 25 Jan 2013 05:58:53 +0000 (05:58 +0000)]
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

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

11 years agoCreate clang/test/Driver/lit.local.cfg.
NAKAMURA Takumi [Fri, 25 Jan 2013 05:09:37 +0000 (05:09 +0000)]
Create clang/test/Driver/lit.local.cfg.

These files had been ignored.

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

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

11 years agoSync 'in class initialization of static const double' extension up with GCC,
Richard Smith [Fri, 25 Jan 2013 04:22:16 +0000 (04:22 +0000)]
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.

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

11 years ago[Frontend] Remove another IsUserSpecified member variable that is now unused.
Daniel Dunbar [Fri, 25 Jan 2013 01:50:47 +0000 (01:50 +0000)]
[Frontend] Remove another IsUserSpecified member variable that is now unused.

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

11 years ago[Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.
Daniel Dunbar [Fri, 25 Jan 2013 01:50:39 +0000 (01:50 +0000)]
[Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.

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

11 years ago[Frontend] The -iwithprefix option belongs in the After category, according to
Daniel Dunbar [Fri, 25 Jan 2013 01:50:34 +0000 (01:50 +0000)]
[Frontend] The -iwithprefix option belongs in the After category, according to
GCC docs.
 - Found by inspection.

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

11 years ago[Lex] Remove DirectoryLookup.UserSpecified, which is unused.
Daniel Dunbar [Fri, 25 Jan 2013 01:50:28 +0000 (01:50 +0000)]
[Lex] Remove DirectoryLookup.UserSpecified, which is unused.

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

11 years agoSerialization/GlobalModuleIndex.cpp: Fixup r173405, <cstdio>
NAKAMURA Takumi [Fri, 25 Jan 2013 01:47:07 +0000 (01:47 +0000)]
Serialization/GlobalModuleIndex.cpp: Fixup r173405, <cstdio>

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

11 years agoImplement the reader of the global module index and wire it into the
Douglas Gregor [Fri, 25 Jan 2013 01:03:03 +0000 (01:03 +0000)]
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.

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

11 years agoRename the -cc1 option "-generate-module-index" to
Douglas Gregor [Fri, 25 Jan 2013 00:45:27 +0000 (00:45 +0000)]
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.

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

11 years agoTrack the number of lookups and hits into the on-disk hash tables for
Douglas Gregor [Fri, 25 Jan 2013 00:38:33 +0000 (00:38 +0000)]
Track the number of lookups and hits into the on-disk hash tables for
identifiers within the AST file reader.

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

11 years agoClarify comment: "diagnose" is better than "warn" when emitting an error.
Jordan Rose [Fri, 25 Jan 2013 00:20:28 +0000 (00:20 +0000)]
Clarify comment: "diagnose" is better than "warn" when emitting an error.

Thanks, Dmitri.

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

11 years agoClean up: since we have FunctionDecl::IsInline, make it store the right value
Richard Smith [Fri, 25 Jan 2013 00:08:28 +0000 (00:08 +0000)]
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.

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

11 years agoFileCheck'ize test
Dmitri Gribenko [Fri, 25 Jan 2013 00:06:54 +0000 (00:06 +0000)]
FileCheck'ize test

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

11 years agoFileCheck'ize test
Dmitri Gribenko [Thu, 24 Jan 2013 23:44:04 +0000 (23:44 +0000)]
FileCheck'ize test

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

11 years ago[analyzer] Fixup for r173385 and r173386 - initialize the members.
Anna Zaks [Thu, 24 Jan 2013 23:40:17 +0000 (23:40 +0000)]
[analyzer] Fixup for r173385 and r173386 - initialize the members.

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

11 years agoFileCheck'ize test
Dmitri Gribenko [Thu, 24 Jan 2013 23:34:51 +0000 (23:34 +0000)]
FileCheck'ize test

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

11 years agoFileCheck'ize test
Dmitri Gribenko [Thu, 24 Jan 2013 23:29:37 +0000 (23:29 +0000)]
FileCheck'ize test

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

11 years agoFixes text of diagnostics in integer overflow patch.
Fariborz Jahanian [Thu, 24 Jan 2013 23:24:32 +0000 (23:24 +0000)]
Fixes text of diagnostics in integer overflow patch.

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

11 years agoFileCheck'ize test/SemaCXX/qualified-names-print.cpp and merge it to other
Dmitri Gribenko [Thu, 24 Jan 2013 23:21:11 +0000 (23:21 +0000)]
FileCheck'ize test/SemaCXX/qualified-names-print.cpp and merge it to other
-ast-print tests

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

11 years ago[analyzer] Add "-analyzer-config mode=[deep|shallow] ".
Anna Zaks [Thu, 24 Jan 2013 23:15:34 +0000 (23:15 +0000)]
[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.

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

11 years ago[analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".
Anna Zaks [Thu, 24 Jan 2013 23:15:30 +0000 (23:15 +0000)]
[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.

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

11 years ago[analyzer] refactor: access IPAMode through the accessor.
Anna Zaks [Thu, 24 Jan 2013 23:15:25 +0000 (23:15 +0000)]
[analyzer] refactor: access IPAMode through the accessor.

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

11 years agoscan-build: Add a --keep-empty option for better testing.
Jordan Rose [Thu, 24 Jan 2013 23:07:59 +0000 (23:07 +0000)]
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.

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

11 years agoFileCheck-ify some debug info scope related tests.
David Blaikie [Thu, 24 Jan 2013 22:47:48 +0000 (22:47 +0000)]
FileCheck-ify some debug info scope related tests.

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

11 years agoremoved duplicated comment.
Fariborz Jahanian [Thu, 24 Jan 2013 22:26:55 +0000 (22:26 +0000)]
removed duplicated comment.

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

11 years agoPatch to check for integer overflow. It has been
Fariborz Jahanian [Thu, 24 Jan 2013 22:11:45 +0000 (22:11 +0000)]
Patch to check for integer overflow. It has been
commented on and approved by Richard Smith.

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

11 years agoMove 'convertUTF8Sequence' helper into the C++ section of the header file.
Jordan Rose [Thu, 24 Jan 2013 21:48:50 +0000 (21:48 +0000)]
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.

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

11 years ago[mips] Do not emit i32 padding if target ABI is O32. This was causing backend
Akira Hatanaka [Thu, 24 Jan 2013 21:47:33 +0000 (21:47 +0000)]
[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.

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

11 years agoTest fix-it ranges for Unicode characters.
Jordan Rose [Thu, 24 Jan 2013 21:19:51 +0000 (21:19 +0000)]
Test fix-it ranges for Unicode characters.

Also, remove stray -fdiagnostics-parseable-fixits from ucn-pp-identifier.

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

11 years agoAdd a fixit for \U1234 -> \u1234.
Jordan Rose [Thu, 24 Jan 2013 20:50:52 +0000 (20:50 +0000)]
Add a fixit for \U1234 -> \u1234.

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

11 years agoAs an extension, treat Unicode whitespace characters as whitespace.
Jordan Rose [Thu, 24 Jan 2013 20:50:50 +0000 (20:50 +0000)]
As an extension, treat Unicode whitespace characters as whitespace.

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

11 years agoHandle universal character names and Unicode characters outside of literals.
Jordan Rose [Thu, 24 Jan 2013 20:50:46 +0000 (20:50 +0000)]
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.

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

11 years agoUnify diagnostics for \x, \u, and \U without any following hex digits.
Jordan Rose [Thu, 24 Jan 2013 20:50:13 +0000 (20:50 +0000)]
Unify diagnostics for \x, \u, and \U without any following hex digits.

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

11 years agoFail these tests in a way that doesn't cause unexpected successes, per Daniel's
Chad Rosier [Thu, 24 Jan 2013 20:46:39 +0000 (20:46 +0000)]
Fail these tests in a way that doesn't cause unexpected successes, per Daniel's
suggestion.

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

11 years agoTemporarily XFAIL this test; the compiler will segfault if the target-specific
Chad Rosier [Thu, 24 Jan 2013 20:33:35 +0000 (20:33 +0000)]
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.

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

11 years ago[ms-inline asm] Add an error when trying to compile MS-style inline assembly
Chad Rosier [Thu, 24 Jan 2013 20:24:34 +0000 (20:24 +0000)]
[ms-inline asm] Add an error when trying to compile MS-style inline assembly
for an unsupported architecture.
rdar://13063988

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

11 years ago[driver] Associate a JobAction with each result file. This enables the driver
Chad Rosier [Thu, 24 Jan 2013 19:14:47 +0000 (19:14 +0000)]
[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

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

11 years agoPR14922: when printing an attribute, use the real syntax of the attribute (GNU, C...
Michael Han [Thu, 24 Jan 2013 16:46:58 +0000 (16:46 +0000)]
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.

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

11 years agoFix a non-conformant OpenCL test case.
Joey Gouly [Thu, 24 Jan 2013 15:24:54 +0000 (15:24 +0000)]
Fix a non-conformant OpenCL test case.
Program scope variables must be declared in the constant address space
and are required to be initialized.

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

11 years agoProperly remove this test file, that I copied over to test/SemaOpenCL in r173352.
Joey Gouly [Thu, 24 Jan 2013 15:19:51 +0000 (15:19 +0000)]
Properly remove this test file, that I copied over to test/SemaOpenCL in r173352.

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

11 years agoFix an OpenCL test case that was OpenCL conformant.
Joey Gouly [Thu, 24 Jan 2013 15:14:22 +0000 (15:14 +0000)]
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.

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

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