]> granicus.if.org Git - clang/log
clang
11 years ago[Modules] Don't eagerly load and associate all the module header files.
Argyrios Kyrtzidis [Wed, 13 Mar 2013 21:13:51 +0000 (21:13 +0000)]
[Modules] Don't eagerly load and associate all the module header files.

In a module-enabled Cocoa PCH file, we spend a lot of time stat'ing the headers
in order to associate the FileEntries with their modules and support implicit
module import.

Use a more lazy scheme by enhancing HeaderInfoTable to store extra info about
the module that a header belongs to, and associate it with its module only when
there is a request for loading the header info for a particular file.

Part of rdar://13391765

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

11 years ago[Modules] Resolve top-headers of modules lazily.
Argyrios Kyrtzidis [Wed, 13 Mar 2013 21:13:43 +0000 (21:13 +0000)]
[Modules] Resolve top-headers of modules lazily.

This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

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

11 years agoCause the mips16/nomips16 attribute to be passed to LLVM from Clang
Reed Kotler [Wed, 13 Mar 2013 20:40:30 +0000 (20:40 +0000)]
Cause the mips16/nomips16 attribute to be passed to LLVM from Clang
in the LLVM assembly language output.

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

11 years ago[analyzer] BugReporter - more precise tracking of C++ references
Anna Zaks [Wed, 13 Mar 2013 20:20:14 +0000 (20:20 +0000)]
[analyzer] BugReporter - more precise tracking of C++ references

When BugReporter tracks C++ references involved in a null pointer violation, we
want to differentiate between a null reference and a reference to a null pointer. In the
first case, we want to track the region for the reference location; in the second, we want
to track the null pointer.

In addition, the core creates CXXTempObjectRegion to represent the location of the
C++ reference, so teach FindLastStoreBRVisitor about it.

This helps null pointer suppression to kick in.

(Patch by Anna and Jordan.)

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

11 years agoRemove stray space.
Ted Kremenek [Wed, 13 Mar 2013 20:05:52 +0000 (20:05 +0000)]
Remove stray space.

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

11 years ago[analyzer] Handle Objc Fast enumeration for "loop is executed 0 times".
Ted Kremenek [Wed, 13 Mar 2013 20:03:31 +0000 (20:03 +0000)]
[analyzer] Handle Objc Fast enumeration for "loop is executed 0 times".

Fixes <rdar://problem/12322528>

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

11 years agoFix incorrect cast identification.
Daniel Jasper [Wed, 13 Mar 2013 17:13:53 +0000 (17:13 +0000)]
Fix incorrect cast identification.

Before: int a = sizeof(int *)+ b;"
After:  int a = sizeof(int *) + b;

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

11 years ago[analyzer] fixed the logic changed by r176949
Anton Yartsev [Wed, 13 Mar 2013 17:07:32 +0000 (17:07 +0000)]
[analyzer] fixed the logic changed by r176949

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

11 years agorelax check to allow for attributes (fix buildbot for elf-ppc64)
Adrian Prantl [Wed, 13 Mar 2013 16:14:44 +0000 (16:14 +0000)]
relax check to allow for attributes (fix buildbot for elf-ppc64)

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

11 years agoFix comment indentation before labels.
Daniel Jasper [Wed, 13 Mar 2013 15:53:12 +0000 (15:53 +0000)]
Fix comment indentation before labels.

Before:
switch (x) {
  // if 1, do f()
case 1:
  f();
}

After:
switch (x) {
// if 1, do f()
case 1:
  f();
}

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

11 years agoFix formatting issue with builder-type calls.
Daniel Jasper [Wed, 13 Mar 2013 15:37:48 +0000 (15:37 +0000)]
Fix formatting issue with builder-type calls.

Before:
->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() - aaaaaaaaa()->aaaaaa()
                                                             ->aaaaa());

After:
a->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() -
                         aaaaaaaaa()->aaaaaa()->aaaaa());

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

11 years agoAdded AnnotatedToken::isOneOf + a few other refactorings
Alexander Kornienko [Wed, 13 Mar 2013 14:41:29 +0000 (14:41 +0000)]
Added AnnotatedToken::isOneOf + a few other refactorings

Summary: <subj>

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D536

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

11 years agoRefactoring:
Anton Yartsev [Wed, 13 Mar 2013 14:39:10 +0000 (14:39 +0000)]
Refactoring:
+ Individual Report* method for each bug type
+ Comment improved: missing non-trivial alloca() case annotated
+ 'range' parameter of ReportBadFree() capitalized
+ 'SymbolRef Sym = State->getSVal(A, C.getLocationContext()).getAsSymbol();' shorten to 'SymbolRef Sym = C.getSVal(A).getAsSymbol();'

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

11 years agoDocumentation: formatting fixes
Dmitri Gribenko [Wed, 13 Mar 2013 14:26:35 +0000 (14:26 +0000)]
Documentation: formatting fixes

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

11 years agoReverting r176944 until Author fixes test failure.
Edwin Vane [Wed, 13 Mar 2013 13:48:47 +0000 (13:48 +0000)]
Reverting r176944 until Author fixes test failure.

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

11 years agoClangTool output cleanup
Edwin Vane [Wed, 13 Mar 2013 13:36:56 +0000 (13:36 +0000)]
ClangTool output cleanup

Information messages sent to stdout by ClangTool now only happen when the -debug
flag is set.

Error messages that used to go to stdout now go to stderr.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>

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

11 years agoAdd llvm-symbolizer as test dependency.
Evgeniy Stepanov [Wed, 13 Mar 2013 09:36:02 +0000 (09:36 +0000)]
Add llvm-symbolizer as test dependency.

It is required when building tests with ASan or MSan.

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

11 years agoFix formatting of new arrays of pointers.
Daniel Jasper [Wed, 13 Mar 2013 07:49:51 +0000 (07:49 +0000)]
Fix formatting of new arrays of pointers.

Before:
A = new SomeType * [Length];
A = new SomeType *[Length]();

After:
A = new SomeType *[Length];
A = new SomeType *[Length]();

Small formatting cleanups with clang-format.

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

11 years agoSet symbolizer path in the test environment.
Evgeniy Stepanov [Wed, 13 Mar 2013 07:10:36 +0000 (07:10 +0000)]
Set symbolizer path in the test environment.

This is needed to get symbolized stack traces when running Clang tests under (A|M)San.

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

11 years agoRemove trailing comma in enum list.
John McCall [Wed, 13 Mar 2013 05:02:21 +0000 (05:02 +0000)]
Remove trailing comma in enum list.

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

11 years agoTighten up the rules for precise lifetime and document
John McCall [Wed, 13 Mar 2013 03:10:54 +0000 (03:10 +0000)]
Tighten up the rules for precise lifetime and document
the requirements on the ARC optimizer.

rdar://13407451

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

11 years agoTest for LLVM r176911
Matt Beaumont-Gay [Tue, 12 Mar 2013 23:56:16 +0000 (23:56 +0000)]
Test for LLVM r176911

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

11 years agoObjective-C: In my last path, also check
Fariborz Jahanian [Tue, 12 Mar 2013 22:22:38 +0000 (22:22 +0000)]
Objective-C: In my last path, also check
for existence of user setter before
issuing the warning about non-synthesizable
property. // rdar://13388503

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

11 years agoMake modules.m test portable, now that autolinking is dependent on whether or not...
Ted Kremenek [Tue, 12 Mar 2013 21:49:29 +0000 (21:49 +0000)]
Make modules.m test portable, now that autolinking is dependent on whether or not the target uses the integrated assembler.

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

11 years agoEliminate backend dependency in CFE testcase.
Adrian Prantl [Tue, 12 Mar 2013 21:40:00 +0000 (21:40 +0000)]
Eliminate backend dependency in CFE testcase.

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

11 years ago[driver] Only enable -fmodules-autolink if we are using the integrated assembler.
Ted Kremenek [Tue, 12 Mar 2013 21:08:08 +0000 (21:08 +0000)]
[driver] Only enable -fmodules-autolink if we are using the integrated assembler.

Fixes <rdar://problem/13289240>

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

11 years agoWhitespace cleanup.
Rafael Espindola [Tue, 12 Mar 2013 21:06:00 +0000 (21:06 +0000)]
Whitespace cleanup.

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

11 years agoForce column info to be generated for call expressions so we can
Adrian Prantl [Tue, 12 Mar 2013 20:43:25 +0000 (20:43 +0000)]
Force column info to be generated for call expressions so we can
differentiate multiple inlined call sites on the same line
in the debug info.

Fixes rdar://problem/13036237

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

11 years agoDriver: -ccc-install-dir should affect cc1 -resource-dir
Jim Grosbach [Tue, 12 Mar 2013 20:17:58 +0000 (20:17 +0000)]
Driver: -ccc-install-dir should affect cc1 -resource-dir

-ccc-install-dir is supposed to cause the compiler to behave as-if it
were installed in the indicated location. It almost does, but misses
anything that's relying on the resource directory (libc++ header search,
in particular). The resource dir is resolved too early, before command
line args are handled.

The fix is simply to move handling of the resource dir until after we
know if a -ccc-install-dir is present.

rdar://13402696

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

11 years agoRevert "Revert r166370 and r166540 now that Xcode 4.6 has been available for a while."
Bob Wilson [Tue, 12 Mar 2013 20:00:34 +0000 (20:00 +0000)]
Revert "Revert r166370 and r166540 now that Xcode 4.6 has been available for a while."

This reverts commit 176887.  Nico asked for more time to move to Xcode 4.6.

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

11 years agoMake C++11 status page more consistent: we mark entries as "done" if we
Richard Smith [Tue, 12 Mar 2013 19:56:09 +0000 (19:56 +0000)]
Make C++11 status page more consistent: we mark entries as "done" if we
implement correct functionality, even if it's not optimal. On this basis, mark
"data dependency ordering" as done. Add footnotes for cases where our
implementation is known to be suboptimal.

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

11 years agoAdd an interesting testcase we already handle correctly.
Rafael Espindola [Tue, 12 Mar 2013 19:50:10 +0000 (19:50 +0000)]
Add an interesting testcase we already handle correctly.

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

11 years agoObjective-C: Issue warning in couple of obscure cases
Fariborz Jahanian [Tue, 12 Mar 2013 19:46:17 +0000 (19:46 +0000)]
Objective-C: Issue warning in couple of obscure cases
when property autosynthesis does not synthesize a property.
When property is declared 'readonly' in a super class and
is redeclared 'readwrite' in a subclass. When a property
autosynthesis causes it to share 'ivar' with another property.
// rdar://13388503

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

11 years agoMove the extern "C" sema tests to a new file.
Rafael Espindola [Tue, 12 Mar 2013 19:45:57 +0000 (19:45 +0000)]
Move the extern "C" sema tests to a new file.

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

11 years agoRevert r166370 and r166540 now that Xcode 4.6 has been available for a while.
Bob Wilson [Tue, 12 Mar 2013 19:39:19 +0000 (19:39 +0000)]
Revert r166370 and r166540 now that Xcode 4.6 has been available for a while.

Those changes were added as a temporary workaround for Xcode 4.5 passing the
-Wno-arc-abi option.  Xcode 4.6 does not pass that option so this should no
longer be necessary.

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

11 years agoObjective-C: Fixes a comment.
Fariborz Jahanian [Tue, 12 Mar 2013 17:43:00 +0000 (17:43 +0000)]
Objective-C: Fixes a comment.

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

11 years agoRevert "Disallow using -fmodules with -no-integrated-as."
Ted Kremenek [Tue, 12 Mar 2013 17:02:12 +0000 (17:02 +0000)]
Revert "Disallow using -fmodules with -no-integrated-as."

Per comment from Benjamin Kramer, this isn't portable (yet).  I'll come up
with a better fix.

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

11 years agoWe already reported an error for
Rafael Espindola [Tue, 12 Mar 2013 16:45:13 +0000 (16:45 +0000)]
We already reported an error for

extern "C" {
  void test5_f() {
    extern int test5_b;
  }
}
static float test5_b;

This patch makes us report one for

extern "C" {
  void test6_f() {
    extern int test6_b;
  }
}
extern "C" {
  static float test6_b;
}

Not because we think the declaration would be extern C, but because of the rule:

An entity with C language linkage shall not be declared with the same name as an entity in global scope...

We were just not looking past the extern "C" to see if the decl was in global
scope.

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

11 years agoImplemented formatting of rvalue references
Alexander Kornienko [Tue, 12 Mar 2013 16:28:18 +0000 (16:28 +0000)]
Implemented formatting of rvalue references

Summary:
Handle "&&" usage as rvalue reference, added tests and fixed incorrect
tests that interfere with this feature.

http://llvm.org/bugs/show_bug.cgi?id=15051

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D531

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

11 years ago[docs] Add rtags to the external examples.
Sean Silva [Tue, 12 Mar 2013 16:07:31 +0000 (16:07 +0000)]
[docs] Add rtags to the external examples.

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

11 years agoModify comment in user test.
Fariborz Jahanian [Tue, 12 Mar 2013 15:53:46 +0000 (15:53 +0000)]
Modify comment in user test.

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

11 years agoCorrectly compute linkage of decls forward declared extern C.
Rafael Espindola [Tue, 12 Mar 2013 15:22:39 +0000 (15:22 +0000)]
Correctly compute linkage of decls forward declared extern C.

This fixes a crash in

namespace {
  struct X {};
}
extern "C" X test2_b;
X test2_b

before we would assign different linkages to each of the test2_b decls.

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

11 years agoError if an extern C declaration matches a previous hidden extern C declaration.
Rafael Espindola [Tue, 12 Mar 2013 15:13:56 +0000 (15:13 +0000)]
Error if an extern C declaration matches a previous hidden extern C declaration.

Without this patch we produce an error for

extern "C" {
  void f() {
    extern int b;
  }
}
extern "C" {
  extern float b;
}

but not for

extern "C" {
  void f() {
    extern int b;
  }
}
extern "C" {
  float b;
}

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

11 years agoRemove a bogus assert so we don't crash in
Rafael Espindola [Tue, 12 Mar 2013 15:06:22 +0000 (15:06 +0000)]
Remove a bogus assert so we don't crash in

namespace {
  struct X {};
}
extern "C" {
  X b = X();
}

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

11 years agoRemove bad space after "default".
Daniel Jasper [Tue, 12 Mar 2013 12:26:55 +0000 (12:26 +0000)]
Remove bad space after "default".

Before:
switch (x) {
default : {}
}

After:
switch (x) {
default: {}
}

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

11 years agoRemove driver support for Hexagon V2 and V3
Matthew Curtis [Tue, 12 Mar 2013 11:52:09 +0000 (11:52 +0000)]
Remove driver support for Hexagon V2 and V3

Driver will now error when trying to compile for V2 or V3.

Removal of V2 and V3 support will allow us to simplify the hexagon
back-end.

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

11 years ago[docs] Add SourceWeb as external example.
Sean Silva [Tue, 12 Mar 2013 02:11:17 +0000 (02:11 +0000)]
[docs] Add SourceWeb as external example.

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

11 years agoObjective-C: When using super.prop, property should be
Fariborz Jahanian [Mon, 11 Mar 2013 22:26:33 +0000 (22:26 +0000)]
Objective-C: When using super.prop, property should be
looked up the current class's super class.
// rdar://13349296

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

11 years ago[analyzer] Look for calls along with lvalue nodes in trackNullOrUndefValue.
Jordan Rose [Mon, 11 Mar 2013 21:31:46 +0000 (21:31 +0000)]
[analyzer] Look for calls along with lvalue nodes in trackNullOrUndefValue.

r176737 fixed bugreporter::trackNullOrUndefValue to find nodes for an lvalue
even if the rvalue node had already been collected. This commit extends that
to call statement nodes as well, so that if a call is contained within
implicit casts we can still track the return value.

No test case because node reclamation is extremely finicky (dependent on
how the AST and CFG are built, and then on our current reclamation rules,
and /then/ on how many nodes were generated by the analyzer core and the
current set of checkers). I consider this a low-risk change, though, and
it will only happen in cases of reclamation when the rvalue node isn't
available.

<rdar://problem/13340764>

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

11 years agoDisallow using -fmodules with -no-integrated-as.
Ted Kremenek [Mon, 11 Mar 2013 20:51:52 +0000 (20:51 +0000)]
Disallow using -fmodules with -no-integrated-as.

Modules enables features such as auto-linking, and we simply do not want to
support a matrix of subtly enabled/disabled features depending on whether or
not a user is using the integrated assembler.

It isn't clear if this is the best place to do this check.  For one thing,
these kind of errors are not caught by the serialized diagnostics.

Fixes <rdar://problem/13289240>

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

11 years agoImprove the caching of debuginfo Objective C interface types.
Adrian Prantl [Mon, 11 Mar 2013 18:33:46 +0000 (18:33 +0000)]
Improve the caching of debuginfo Objective C interface types.
Generate forward declarations that are RAUW'd by finalize().
We thus avoid outputting the same type several times in multiple
stages of completion.

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

11 years agoAdd -Wc99-compat warning for C11 unicode string and character literals.
Richard Smith [Mon, 11 Mar 2013 18:01:42 +0000 (18:01 +0000)]
Add -Wc99-compat warning for C11 unicode string and character literals.

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

11 years agoPartly revert "Move clang tests that depend on llvm/ADT/Statistic.h to a subdir".
Jan Wen Voung [Mon, 11 Mar 2013 17:48:03 +0000 (17:48 +0000)]
Partly revert "Move clang tests that depend on llvm/ADT/Statistic.h to a subdir".

This reverts commit 176730, and uses "REQUIRES: asserts" instead.

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

11 years ago[docs] Add ellipsis.
Sean Silva [Mon, 11 Mar 2013 17:07:47 +0000 (17:07 +0000)]
[docs] Add ellipsis.

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

11 years ago[libclang] Fix a test and a warning on windows.
Argyrios Kyrtzidis [Mon, 11 Mar 2013 16:03:17 +0000 (16:03 +0000)]
[libclang] Fix a test and a warning on windows.

Patch by Guy Benyei!

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

11 years agoAdd a test case for the 'vec_type_hint' attribute that was introduced in
Joey Gouly [Mon, 11 Mar 2013 12:38:45 +0000 (12:38 +0000)]
Add a test case for the 'vec_type_hint' attribute that was introduced in
r176686. I missed this file in the previous commit.

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

11 years agoPR15480: fixed second parameter types of vec_lde, vec_lvebx, vec_lvehx, and vec_lvewx...
Anton Yartsev [Sun, 10 Mar 2013 16:25:43 +0000 (16:25 +0000)]
PR15480: fixed second parameter types of vec_lde, vec_lvebx, vec_lvehx, and vec_lvewx according to AltiVec Programming Interface Manual

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

11 years agoDriver: do not strip file extensions when printing diagnostics.
Benjamin Kramer [Sun, 10 Mar 2013 13:16:18 +0000 (13:16 +0000)]
Driver: do not strip file extensions when printing diagnostics.

Before: clang-3: error: no input files
After:  clang-3.3: error: no input files

This means that we'll also print clang.exe on windows, but I don't see a problem
with that.

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

11 years agoFix indirect byval passing of records in address spaced memory. Allocate memory on...
Guy Benyei [Sun, 10 Mar 2013 12:59:00 +0000 (12:59 +0000)]
Fix indirect byval passing of records in address spaced memory. Allocate memory on stack, and memcpy the actual value before the call.

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

11 years agowww tweaks to embiggen up our near-complete C++11 and C11 support.
Richard Smith [Sun, 10 Mar 2013 00:11:00 +0000 (00:11 +0000)]
www tweaks to embiggen up our near-complete C++11 and C11 support.

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

11 years agoWhen lexing in C11 mode, accept unicode character and string literals, per C11
Richard Smith [Sat, 9 Mar 2013 23:56:02 +0000 (23:56 +0000)]
When lexing in C11 mode, accept unicode character and string literals, per C11
6.4.4.4/1 and 6.4.5/1.

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

11 years agoHandle _Pragma on a u8, u, or U string literal per the C11 specification. Also
Richard Smith [Sat, 9 Mar 2013 23:30:15 +0000 (23:30 +0000)]
Handle _Pragma on a u8, u, or U string literal per the C11 specification. Also
handle raw string literals here. C++11 doesn't yet specify how they will
behave, but discussion on core suggests that we should just strip off
everything but the r-char-sequence.

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

11 years agoRemove unused diagnostic.
Benjamin Kramer [Sat, 9 Mar 2013 18:44:47 +0000 (18:44 +0000)]
Remove unused diagnostic.

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

11 years agoMake helper function static.
Benjamin Kramer [Sat, 9 Mar 2013 15:15:22 +0000 (15:15 +0000)]
Make helper function static.

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

11 years ago[analyzer] Make Suppress IDC checker aware that it might not start from the same...
Anna Zaks [Sat, 9 Mar 2013 03:23:19 +0000 (03:23 +0000)]
[analyzer] Make Suppress IDC checker aware that it might not start from the same node it was registered at

The visitor used to assume that the value it’s tracking is null in the first node it examines. This is not true.
If we are registering the Suppress Inlined Defensive checks visitor while traversing in another visitor
(such as FindlastStoreVisitor). When we restart with the IDC visitor, the invariance of the visitor does
not hold since the symbol we are tracking no longer exists at that point.

I had to pass the ErrorNode when creating the IDC visitor, because, in some cases, node N is
neither the error node nor will be visible along the path (we had not finalized the path at that point
and are dealing with ExplodedGraph.)

We should revisit the other visitors which might not be aware that they might get nodes, which are
later in path than the trigger point.

This suppresses a number of inline defensive checks in JavaScriptCore.

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

11 years ago[analyzer] Rename AttrNonNullChecker -> NonNullParamChecker
Anna Zaks [Sat, 9 Mar 2013 03:23:14 +0000 (03:23 +0000)]
[analyzer] Rename AttrNonNullChecker -> NonNullParamChecker

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

11 years ago[analyzer] Add test case for reference to null pointer param check
Anna Zaks [Sat, 9 Mar 2013 03:23:10 +0000 (03:23 +0000)]
[analyzer] Add test case for reference to null pointer param check

This tests that we track the original Expr if getDerefExpr fails.

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

11 years ago[analyzer] Be more consistent about Objective-C methods that free memory.
Jordan Rose [Sat, 9 Mar 2013 00:59:10 +0000 (00:59 +0000)]
[analyzer] Be more consistent about Objective-C methods that free memory.

Previously, MallocChecker's pointer escape check and its post-call state
update for Objective-C method calls had a fair amount duplicated logic
and not-entirely-consistent checks. This commit restructures all this to
be more consistent and possibly allow us to be more aggressive in warning
about double-frees.

New policy (applies to system header methods only):
(1) If this is a method we know about, model it as taking/holding ownership
    of the passed-in buffer.
  (1a) ...unless there's a "freeWhenDone:" parameter with a zero (NO) value.
(2) If there's a "freeWhenDone:" parameter (but it's not a method we know
    about), treat the buffer as escaping if the value is non-zero (YES) and
    non-escaping if it's zero (NO).
(3) If the first selector piece ends with "NoCopy" (but it's not a method we
    know about and there's no "freeWhenDone:" parameter), treat the buffer
    as escaping.

The reason that (2) and (3) don't explicitly model the ownership transfer is
because we can't be sure that they will actually free the memory using free(),
and we wouldn't want to emit a spurious "mismatched allocator" warning
(coming in Anton's upcoming patch). In the future, we may have an idea of a
"generic deallocation", i.e. we assume that the deallocator is correct but
still continue tracking the region so that we can warn about double-frees.

Patch by Anton Yartsev, with modifications from me.

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

11 years agoAdjust the special non-C++ enum block return type inference
John McCall [Sat, 9 Mar 2013 00:54:31 +0000 (00:54 +0000)]
Adjust the special non-C++ enum block return type inference
so that it looks through certain syntactic forms and applies
even if normal inference would have succeeded.

There is potential for source incompatibility from this
change, but overall we feel that it produces a much
cleaner and more defensible result, and the block
compatibility rules should curb a lot of the potential
for annoyance.

rdar://13200889

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

11 years agoAdd TagDecl::hasNameForLinkage(), which is true if the tag
John McCall [Sat, 9 Mar 2013 00:54:27 +0000 (00:54 +0000)]
Add TagDecl::hasNameForLinkage(), which is true if the tag
is non-anonymous or is defined in a typedef of itself.

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

11 years agoDocumentation parsing. Some refactoring and code
Fariborz Jahanian [Fri, 8 Mar 2013 23:59:23 +0000 (23:59 +0000)]
Documentation parsing. Some refactoring and code
improvements per Dmtiri's comments. // rdar://12379114

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

11 years ago[analyzer] Look for lvalue nodes when tracking a null pointer.
Jordan Rose [Fri, 8 Mar 2013 23:30:56 +0000 (23:30 +0000)]
[analyzer] Look for lvalue nodes when tracking a null pointer.

r176010 introduced the notion of "interesting" lvalue expressions, whose
nodes are guaranteed never to be reclaimed by the ExplodedGraph. This was
used in bugreporter::trackNullOrUndefValue to find the region that contains
the null or undef value being tracked.

However, the /rvalue/ nodes (i.e. the loads from these lvalues that produce
a null or undef value) /are/ still being reclaimed, and if we couldn't
find the node for the rvalue, we just give up. This patch changes that so
that we look for the node for either the rvalue or the lvalue -- preferring
the former, since it lets us fall back to value-only tracking in cases
where we can't get a region, but allowing the latter as well.

<rdar://problem/13342842>

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

11 years ago[analyzer] Don't rely on finding the correct return statement for suppression.
Jordan Rose [Fri, 8 Mar 2013 23:30:53 +0000 (23:30 +0000)]
[analyzer] Don't rely on finding the correct return statement for suppression.

Previously, ReturnVisitor waited to suppress a null return path until it
had found the inlined "return" statement. Now, it checks up front whether
the return value was NULL, and suppresses the warning right away if so.

We still have to wait until generating the path notes to invalidate the bug
report, or counter-suppression will never be triggered. (Counter-suppression
happens while generating path notes, but the generation won't happen for
reports already marked invalid.)

This isn't actually an issue today because we never reclaim nodes for
top-level statements (like return statements), but it could be an issue
some day in the future. (But, no expected behavioral change and no new
test case.)

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

11 years ago[libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return...
Argyrios Kyrtzidis [Fri, 8 Mar 2013 22:47:41 +0000 (22:47 +0000)]
[libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return an enum,
as suggested by Jordan.

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

11 years ago<rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.
Douglas Gregor [Fri, 8 Mar 2013 22:43:48 +0000 (22:43 +0000)]
<rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.

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

11 years agoMove clang tests that depend on llvm/ADT/Statistic.h to a subdir.
Jan Wen Voung [Fri, 8 Mar 2013 22:42:02 +0000 (22:42 +0000)]
Move clang tests that depend on llvm/ADT/Statistic.h to a subdir.

The subdirectory has a lit.local.cfg that marks the tests unsupported
if llvm was built without Asserts.  There will be a patch in LLVM
that disables statistics gathering when built without Asserts so
that full Release builds can be faster.  Statistics can also
be enabled by building with -DLLVM_ENABLE_STATS.

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

11 years agoSema: Preserve attributes on parameters in instantiated function templates.
Jordan Rose [Fri, 8 Mar 2013 22:25:36 +0000 (22:25 +0000)]
Sema: Preserve attributes on parameters in instantiated function templates.

This was causing correctness issues for ARC and the static analyzer when a
function template has "consumed" Objective-C object parameters (i.e.
parameters that will be released by the function before returning).

The fix is threefold:
(1) Actually copy over the attributes from old ParmVarDecls to new ones.
(2) Have Sema::BuildFunctionType only work for building FunctionProtoTypes,
    which it was doing anyway. This allows us to pass an ExtProtoInfo
    instead of a plain ExtInfo and several flags.
(3) Drop param attributes as part of StripImplicitInstantiation, which is
    used when an implicit instantiation is followed by an explicit one.

<rdar://problem/12685622>

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

11 years ago<rdar://problem/13094134> Don't try to wire up typedef names for invalid anonymous...
Douglas Gregor [Fri, 8 Mar 2013 22:15:15 +0000 (22:15 +0000)]
<rdar://problem/13094134> Don't try to wire up typedef names for invalid anonymous tag declarations encountered during template instantiation.

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

11 years agoArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.
Jordan Rose [Fri, 8 Mar 2013 21:51:21 +0000 (21:51 +0000)]
ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

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

11 years ago<rdar://problem/13140795> Transform the scope type of a pseudo-destructor expression...
Douglas Gregor [Fri, 8 Mar 2013 21:25:01 +0000 (21:25 +0000)]
<rdar://problem/13140795> Transform the scope type of a pseudo-destructor expression within the object scope.

We were transforming the scope type of a pseudo-destructor expression
(e.g., the first T in x->T::~T()) as a freestanding type, which meant
that dependent template specialization types here would stay dependent
even when no template parameters were named. This would eventually
mean that a dependent expression would end up in what should be
fully-instantiated ASTs, causing IRgen to assert.

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

11 years ago[PCH] When complaining that a header from the PCH was modified, also mention
Argyrios Kyrtzidis [Fri, 8 Mar 2013 20:42:38 +0000 (20:42 +0000)]
[PCH] When complaining that a header from the PCH was modified, also mention
the filename of the PCH file.

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

11 years ago[libclang] Modify clang_findReferencesInFile and clang_findIncludesInFile to return...
Argyrios Kyrtzidis [Fri, 8 Mar 2013 20:42:33 +0000 (20:42 +0000)]
[libclang] Modify clang_findReferencesInFile and clang_findIncludesInFile to return a value.

Possible values are:
 1  : if a parameter was invalid
 -1 : if the callback returned CXVisit_Break,
 otherwise returns 0.

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

11 years agoFixes breaking of string literals.
Manuel Klimek [Fri, 8 Mar 2013 18:59:48 +0000 (18:59 +0000)]
Fixes breaking of string literals.

1. We now ignore all non-default string literals, including raw
literals.
2. We do not break inside escape sequences any more.

FIXME: We still break in trigraphs.

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

11 years agoRemove unused variable.
Benjamin Kramer [Fri, 8 Mar 2013 17:04:47 +0000 (17:04 +0000)]
Remove unused variable.

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

11 years agoAdd support for the OpenCL attribute 'vec_type_hint'.
Joey Gouly [Fri, 8 Mar 2013 09:42:32 +0000 (09:42 +0000)]
Add support for the OpenCL attribute 'vec_type_hint'.

Patch by Murat Bolat!

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

11 years ago[libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all ...
Argyrios Kyrtzidis [Fri, 8 Mar 2013 02:32:34 +0000 (02:32 +0000)]
[libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all #import/#include directives in a specific file.

It passes to the visitor, that the caller provides, CXCursor_InclusionDirective cursors for
all the include directives in a particular file.

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

11 years ago[libclang] When calling the function of CXCursorAndRangeVisitor, don't forget to
Argyrios Kyrtzidis [Fri, 8 Mar 2013 02:32:29 +0000 (02:32 +0000)]
[libclang] When calling the function of CXCursorAndRangeVisitor, don't forget to
stop visitation if it returns CXVisit_Break.

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

11 years ago[libclang] Add Logger::operator<< overloads for CXCursor and FileEntry.
Argyrios Kyrtzidis [Fri, 8 Mar 2013 02:32:26 +0000 (02:32 +0000)]
[libclang] Add Logger::operator<< overloads for CXCursor and FileEntry.

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

11 years ago[driver] If we're just linking, don't report --param X as unused option.
Chad Rosier [Fri, 8 Mar 2013 00:05:21 +0000 (00:05 +0000)]
[driver] If we're just linking, don't report --param X as unused option.
PR15327
rdar://13372628

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

11 years agoHeaderDoc: Support more of HeaderDoc documentation
Fariborz Jahanian [Thu, 7 Mar 2013 23:33:11 +0000 (23:33 +0000)]
HeaderDoc: Support more of HeaderDoc documentation
commands; top level tags such as @interface and
their 2nd level tags such as @coclass, etc.
// rdar://12379114

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

11 years agoAdd code completion for @import <rdar://problem/13344306>.
Douglas Gregor [Thu, 7 Mar 2013 23:26:24 +0000 (23:26 +0000)]
Add code completion for @import <rdar://problem/13344306>.

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

11 years agoImprove LLDB's implicit cast-to-id to work with C++11 auto and any Objective-C object...
Douglas Gregor [Thu, 7 Mar 2013 22:57:58 +0000 (22:57 +0000)]
Improve LLDB's implicit cast-to-id to work with C++11 auto and any Objective-C object type <rdar://problem/13338107>.

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

11 years agoWhen possible, move __block variables to the heap rather than copying them.
Douglas Gregor [Thu, 7 Mar 2013 22:38:24 +0000 (22:38 +0000)]
When possible, move __block variables to the heap rather than copying them.

Fixes <rdar://problem/13330126>.

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

11 years agoPromote atomic type sizes up to a power of two, capped by
John McCall [Thu, 7 Mar 2013 21:37:17 +0000 (21:37 +0000)]
Promote atomic type sizes up to a power of two, capped by
MaxAtomicPromoteWidth.  Fix a ton of terrible bugs with
_Atomic types and (non-intrinsic-mediated) loads and stores
thereto.

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

11 years agoMove the atomics code into its own file.
John McCall [Thu, 7 Mar 2013 21:37:12 +0000 (21:37 +0000)]
Move the atomics code into its own file.

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

11 years agoChange hasAggregateLLVMType, which conflates complex and
John McCall [Thu, 7 Mar 2013 21:37:08 +0000 (21:37 +0000)]
Change hasAggregateLLVMType, which conflates complex and
aggregate types in a profoundly wrong way that has to be
worked around in every call site, to getEvaluationKind,
which classifies and distinguishes between all of these
cases.

Also, normalize the API for loading and storing complexes.

I'm working on a larger patch and wanted to pull these
changes out, but it would have be annoying to detangle
them from each other.

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

11 years agoAdd CharUnits::alignmentAtOffset.
John McCall [Thu, 7 Mar 2013 21:37:02 +0000 (21:37 +0000)]
Add CharUnits::alignmentAtOffset.

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

11 years agoEvaluate compound literals directly into the result aggregate
John McCall [Thu, 7 Mar 2013 21:36:54 +0000 (21:36 +0000)]
Evaluate compound literals directly into the result aggregate
when that aggregate isn't potentially aliased.

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

11 years agoRemove temporary std::vectors that ca be replaced with ArrayRef's magic.
Benjamin Kramer [Thu, 7 Mar 2013 21:18:31 +0000 (21:18 +0000)]
Remove temporary std::vectors that ca be replaced with ArrayRef's magic.

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

11 years agoRemove unncessary whitespace when triggered on empty line.
Daniel Jasper [Thu, 7 Mar 2013 20:50:00 +0000 (20:50 +0000)]
Remove unncessary whitespace when triggered on empty line.

With the cursor located at "I", clang-format would not do anything to:

int a;

   I

  int b;

With this patch, it reduces the number of empty lines as necessary, and
removes unnecessary whitespace. It does not change/reformat "int a;" or
"int b;".

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