]> granicus.if.org Git - clang/log
clang
11 years ago[analyzer] Adds cplusplus.NewDelete checker that check for memory leaks, double free...
Anton Yartsev [Mon, 25 Mar 2013 01:35:45 +0000 (01:35 +0000)]
[analyzer] Adds cplusplus.NewDelete checker that check for memory leaks, double free, and use-after-free problems of memory managed by new/delete.

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

11 years ago[analyzer] Teach ConstraintManager to ignore NonLoc <> NonLoc comparisons.
Jordan Rose [Sun, 24 Mar 2013 20:25:22 +0000 (20:25 +0000)]
[analyzer] Teach ConstraintManager to ignore NonLoc <> NonLoc comparisons.

These aren't generated by default, but they are needed when either side of
the comparison is tainted.

Should fix our internal buildbot.

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

11 years agoSimplify code. No functionality change.
Benjamin Kramer [Sun, 24 Mar 2013 16:04:55 +0000 (16:04 +0000)]
Simplify code. No functionality change.

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

11 years agoReject -no-integrated-as on windows.
Rafael Espindola [Sun, 24 Mar 2013 15:06:53 +0000 (15:06 +0000)]
Reject -no-integrated-as on windows.

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

11 years agoGenerate metadata to implement the -cl-kernel-arg-info option.
Guy Benyei [Sun, 24 Mar 2013 13:58:12 +0000 (13:58 +0000)]
Generate metadata to implement the -cl-kernel-arg-info option.
OpenCL 1.2 spec. 5.7.3.

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

11 years agoDon't actually invoke codegen in driver test.
Benjamin Kramer [Sun, 24 Mar 2013 11:30:15 +0000 (11:30 +0000)]
Don't actually invoke codegen in driver test.

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

11 years agoMake clang to mark static stack allocations with lifetime markers to enable a more...
Nadav Rotem [Sat, 23 Mar 2013 06:43:35 +0000 (06:43 +0000)]
Make clang to mark static stack allocations with lifetime markers to enable a more aggressive stack coloring.
Patch by John McCall with help by Shuxin Yang.
rdar://13115369

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

11 years agoRevert svn r176894 and r177658.
Bob Wilson [Sat, 23 Mar 2013 05:17:59 +0000 (05:17 +0000)]
Revert svn r176894 and r177658.

Changing -ccc-install-dir to affect cc1's resource-dir setting broke our
internal LNT tests. After discussing the situation with Jim, we've decided to
pursue an alternate approach. We really want the resource-dir to be located
relative to clang, even when using -ccc-install-dir, but we're going to
add a fallback setting for the libc++ headers if they don't exist alongside
the compiler.

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

11 years agoUnder ARC, when we're passing the address of a strong variable
John McCall [Sat, 23 Mar 2013 02:35:54 +0000 (02:35 +0000)]
Under ARC, when we're passing the address of a strong variable
to an out-parameter using the indirect-writeback conversion,
and we copied the current value of the variable to the temporary,
make sure that we register an intrinsic use of that value with
the optimizer so that the value won't get released until we have
a chance to retain it.

rdar://13195034

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

11 years agoStrip off local qualifiers when converting from RecordType to
Richard Trieu [Sat, 23 Mar 2013 01:38:36 +0000 (01:38 +0000)]
Strip off local qualifiers when converting from RecordType to
TemplateSpecializationType during template type diffing.  This allows the
correct printing of diffing qualifiers on templates.

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

11 years ago[analyzer] Teach constraint managers about unsigned comparisons.
Jordan Rose [Sat, 23 Mar 2013 01:21:33 +0000 (01:21 +0000)]
[analyzer] Teach constraint managers about unsigned comparisons.

In C, comparisons between signed and unsigned numbers are always done in
unsigned-space. Thus, we should know that "i >= 0U" is always true, even
if 'i' is signed. Similarly, "u >= 0" is also always true, even though '0'
is signed.

Part of <rdar://problem/13239003> (false positives related to std::vector)

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

11 years ago[analyzer] Loc-Loc operations (subtraction or comparison) produce a NonLoc.
Jordan Rose [Sat, 23 Mar 2013 01:21:29 +0000 (01:21 +0000)]
[analyzer] Loc-Loc operations (subtraction or comparison) produce a NonLoc.

For two concrete locations, we were producing another concrete location and
then casting it to an integer. We should just create a nonloc::ConcreteInt
to begin with.

No functionality change.

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

11 years ago[analyzer] CmpRuns.py: Accept single files as input.
Jordan Rose [Sat, 23 Mar 2013 01:21:26 +0000 (01:21 +0000)]
[analyzer] CmpRuns.py: Accept single files as input.

This allows us to compare two direct invocations of the analyzer on a
single source file without having to wrap the output plists in their
own directories.

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

11 years ago[analyzer] Also transform "a < b" to "(b - a) > 0" in the constraint manager.
Jordan Rose [Sat, 23 Mar 2013 01:21:23 +0000 (01:21 +0000)]
[analyzer] Also transform "a < b" to "(b - a) > 0" in the constraint manager.

We can support the full range of comparison operations between two locations
by canonicalizing them as subtraction, as in the previous commit.

This won't work (well) if either location includes an offset, or (again)
if the comparisons are not consistent about which region comes first.

<rdar://problem/13239003>

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

11 years agoAdd reverseComparisonOp and negateComparisonOp to BinaryOperator.
Jordan Rose [Sat, 23 Mar 2013 01:21:20 +0000 (01:21 +0000)]
Add reverseComparisonOp and negateComparisonOp to BinaryOperator.

...and adopt them in the analyzer.

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

11 years ago[analyzer] Translate "a != b" to "(b - a) != 0" in the constraint manager.
Jordan Rose [Sat, 23 Mar 2013 01:21:16 +0000 (01:21 +0000)]
[analyzer] Translate "a != b" to "(b - a) != 0" in the constraint manager.

Canonicalizing these two forms allows us to better model containers like
std::vector, which use "m_start != m_finish" to implement empty() but
"m_finish - m_start" to implement size(). The analyzer should have a
consistent interpretation of these two symbolic expressions, even though
it's not properly reasoning about either one yet.

The other unfortunate thing is that while the size() expression will only
ever be written "m_finish - m_start", the comparison may be written
"m_finish == m_start" or "m_start == m_finish". Right now the analyzer does
not attempt to canonicalize those two expressions, since it doesn't know
which length expression to pick. Doing this correctly will probably require
implementing unary minus as a new SymExpr kind (<rdar://problem/12351075>).

For now, the analyzer inverts the order of arguments in the comparison to
build the subtraction, on the assumption that "begin() != end()" is
written more often than "end() != begin()". This is purely speculation.

<rdar://problem/13239003>

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

11 years ago[analyzer] Use SymExprs to represent '<loc> - <loc>' and '<loc> == <loc>'.
Jordan Rose [Sat, 23 Mar 2013 01:21:05 +0000 (01:21 +0000)]
[analyzer] Use SymExprs to represent '<loc> - <loc>' and '<loc> == <loc>'.

We just treat this as opaque symbols, but even that allows us to handle
simple cases where the same condition is tested twice. This is very common
in the STL, which means that any project using the STL gets spurious errors.

Part of <rdar://problem/13239003>.

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

11 years agodocumentation parsing: when providing code completion comment
Fariborz Jahanian [Sat, 23 Mar 2013 01:10:45 +0000 (01:10 +0000)]
documentation parsing: when providing code completion comment
for a getter used in property-dot syntax, if geter has its own
comment use it. // rdar://12791315

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

11 years ago[analyzer] Warn when a nil key or value are passed to NSMutableDictionary and ensure...
Anna Zaks [Sat, 23 Mar 2013 00:39:21 +0000 (00:39 +0000)]
[analyzer] Warn when a nil key or value are passed to NSMutableDictionary and ensure it works with subscripting.

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

11 years ago[analyzer] Correct the stale comment.
Anna Zaks [Sat, 23 Mar 2013 00:39:17 +0000 (00:39 +0000)]
[analyzer] Correct the stale comment.

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

11 years agoIf a .syms file is available alongside a sanitizer runtime, pass it to the
Richard Smith [Sat, 23 Mar 2013 00:30:08 +0000 (00:30 +0000)]
If a .syms file is available alongside a sanitizer runtime, pass it to the
linker via --dynamic-list instead of using --export-dynamic. This reduces the
size of the dynamic symbol table, and thus of the binary (in some cases by up
to ~30%).

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

11 years agoUse RequireCompleteType() instead of isIncompleteType().
Bill Wendling [Fri, 22 Mar 2013 21:33:46 +0000 (21:33 +0000)]
Use RequireCompleteType() instead of isIncompleteType().

isIncompleteType() returns true or false for template types depending on whether
the type is instantiated yet. In this context, that's arbitrary. The better way
to check for a complete type is RequireCompleteType().

Thanks to Eli Friedman for noticing this!

<rdar://problem/12700799>

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

11 years agoAdd test case for PR 12921.
Ted Kremenek [Fri, 22 Mar 2013 21:30:22 +0000 (21:30 +0000)]
Add test case for PR 12921.

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

11 years ago<rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.
Douglas Gregor [Fri, 22 Mar 2013 21:26:48 +0000 (21:26 +0000)]
<rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.

This eliminates excessive rebuilds of the global module cache.

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

11 years agoRevert "[analyzer] Break cycles (optionally) when trimming an ExplodedGraph."
Jordan Rose [Fri, 22 Mar 2013 21:15:33 +0000 (21:15 +0000)]
Revert "[analyzer] Break cycles (optionally) when trimming an ExplodedGraph."

The algorithm used here was ridiculously slow when a potential back-edge
pointed to a node that already had a lot of successors. The previous commit
makes this feature unnecessary anyway.

This reverts r177468 / f4cf6b10f863b9bc716a09b2b2a8c497dcc6aa9b.

Conflicts:

lib/StaticAnalyzer/Core/BugReporter.cpp

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

11 years ago[analyzer] Use a forward BFS instead of a reverse BFS to find shortest paths.
Jordan Rose [Fri, 22 Mar 2013 21:15:28 +0000 (21:15 +0000)]
[analyzer] Use a forward BFS instead of a reverse BFS to find shortest paths.

For a given bug equivalence class, we'd like to emit the report with the
shortest path. So far to do this we've been trimming the ExplodedGraph to
only contain relevant nodes, then doing a reverse BFS (starting at all the
error nodes) to find the shortest paths from the root. However, this is
fairly expensive when we are suppressing many bug reports in the same
equivalence class.

r177468-9 tried to solve this problem by breaking cycles during graph
trimming, then updating the BFS priorities after each suppressed report
instead of recomputing the whole thing. However, breaking cycles is not
a cheap operation because an analysis graph minus cycles is still a DAG,
not a tree.

This fix changes the algorithm to do a single forward BFS (starting from the
root) and to use that to choose the report with the shortest path by looking
at the error nodes with the lowest BFS priorities. This was Anna's idea, and
has the added advantage of requiring no update step: we can just pick the
error node with the next lowest priority to produce the next bug report.

<rdar://problem/13474689>

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

11 years ago[analyzer] Fix test to actually test what was intended.
Jordan Rose [Fri, 22 Mar 2013 21:15:26 +0000 (21:15 +0000)]
[analyzer] Fix test to actually test what was intended.

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

11 years ago[analyzer] Fix ExprEngine::ViewGraph to handle C++ initializers.
Jordan Rose [Fri, 22 Mar 2013 21:15:16 +0000 (21:15 +0000)]
[analyzer] Fix ExprEngine::ViewGraph to handle C++ initializers.

Debugging aid only, no functionality change.

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

11 years ago[PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.
Argyrios Kyrtzidis [Fri, 22 Mar 2013 21:12:57 +0000 (21:12 +0000)]
[PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.

-Serialize the macro directives history into its own section
-Get rid of the macro updates section
-When de/serializing an identifier from a module, associate only one macro per
 submodule that defined+exported it.

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

11 years ago[modules] When a MacroInfo object is deserialized, allocate and store its submodule ID.
Argyrios Kyrtzidis [Fri, 22 Mar 2013 21:12:51 +0000 (21:12 +0000)]
[modules] When a MacroInfo object is deserialized, allocate and store its submodule ID.

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

11 years ago[ms-cxxabi] Implement member data pointers for non-dynamic classes
Reid Kleckner [Fri, 22 Mar 2013 19:02:54 +0000 (19:02 +0000)]
[ms-cxxabi] Implement member data pointers for non-dynamic classes

Summary:
For non-dynamic classes (no virtual bases), member data pointers are
simple offsets from the base of the record.  Dynamic classes use an
aggregate for member data pointers and are therefore currently
unsupported.

Unlike Itanium, the ms ABI uses 0 to represent null for polymorphic
classes.  Non-polymorphic classes use -1 like Itanium, since 0 is a
valid field offset.

Reviewers: rjmccall

CC: timurrrr, cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D558

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

11 years ago<rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex interaction to...
Douglas Gregor [Fri, 22 Mar 2013 18:50:14 +0000 (18:50 +0000)]
<rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex interaction to eliminate a pile of extraneous stats().

The refactoring in r177367 introduced a serious performance bug where
the "lazy" resolution of module file names in the global module index
to actual module file entries in the module manager would perform
repeated negative stats(). The new interaction requires the module
manager to inform the global module index when a module file has been
loaded, eliminating the extraneous stat()s and a bunch of bookkeeping
on both sides.

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

11 years agodocumentation parsing. Provide code completion comment
Fariborz Jahanian [Fri, 22 Mar 2013 17:55:27 +0000 (17:55 +0000)]
documentation parsing. Provide code completion comment
for self.GetterName where GetterName is the getter method
for a property with name different from the property name
(declared via a property getter attribute) // rdar://12791315

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

11 years agoThese tests fail on our Window64 machine.
Fariborz Jahanian [Fri, 22 Mar 2013 17:42:39 +0000 (17:42 +0000)]
These tests fail on our Window64 machine.
Feel free to revert them (or let me know and I will revert)
if they shouldn't be.

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

11 years agoBetter fix for r177725.
Daniel Jasper [Fri, 22 Mar 2013 16:55:40 +0000 (16:55 +0000)]
Better fix for r177725.

It turns out that

-foo;

can be an objective C method declaration. So instead of the previous
solution, recognize objective C methods only if we are in a declaration
scope.

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

11 years agoAlign comments to surrounding unformatted comments.
Daniel Jasper [Fri, 22 Mar 2013 16:25:51 +0000 (16:25 +0000)]
Align comments to surrounding unformatted comments.

Before:
int a; // not formatted
// formatting this line only

After:
int a; // not formatted
       // formatting this line only

This makes clang-format stable independent of whether the whole
file or single lines are formatted in most cases.

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

11 years ago[cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching it
Reid Kleckner [Fri, 22 Mar 2013 16:13:10 +0000 (16:13 +0000)]
[cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching it

As the comment says, it's a little silly to cache it in the ABI code.

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

11 years agoUpdate docs after moving clang-format from clang-tools-extra to cfe.
Daniel Jasper [Fri, 22 Mar 2013 12:44:20 +0000 (12:44 +0000)]
Update docs after moving clang-format from clang-tools-extra to cfe.

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

11 years agoAdd clang-format to the corresponding Makefile.
Daniel Jasper [Fri, 22 Mar 2013 11:43:51 +0000 (11:43 +0000)]
Add clang-format to the corresponding Makefile.

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

11 years agoMore precisely recognize ObjC method declarations.
Daniel Jasper [Fri, 22 Mar 2013 10:44:43 +0000 (10:44 +0000)]
More precisely recognize ObjC method declarations.

Otherwise, +/- and the beginning of constants can be recognized
incorrectly.

Before:  #define A - 1
After:   #define A -1

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

11 years agoDocumentation: fix a typo and formatting
Dmitri Gribenko [Fri, 22 Mar 2013 10:25:15 +0000 (10:25 +0000)]
Documentation: fix a typo and formatting

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

11 years agoFix DeclRefExpr::getFoundDecl() for usages by reference.
Daniel Jasper [Fri, 22 Mar 2013 10:01:35 +0000 (10:01 +0000)]
Fix DeclRefExpr::getFoundDecl() for usages by reference.

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

11 years agoMake clang-format understand more line comments.
Daniel Jasper [Fri, 22 Mar 2013 10:01:29 +0000 (10:01 +0000)]
Make clang-format understand more line comments.

Apparently one needs to set LangOptions.LineComment.

Before "//* */" got reformatted to "/ /* */" as the lexer was returning
the token sequence (slash, comment). This could also lead to weird other
stuff, e.g. for people that like to using comments like:
//****************

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

11 years agoAdd future directions for modules
Douglas Gregor [Fri, 22 Mar 2013 07:08:56 +0000 (07:08 +0000)]
Add future directions for modules

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

11 years agoMore modules documentation, including the straw-man import declaration syntax and...
Douglas Gregor [Fri, 22 Mar 2013 07:05:07 +0000 (07:05 +0000)]
More modules documentation, including the straw-man import declaration syntax and "how to modularize a platform".

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

11 years agoOpenMP threadprivate directive parsing and semantic analysis
Alexey Bataev [Fri, 22 Mar 2013 06:34:35 +0000 (06:34 +0000)]
OpenMP threadprivate directive parsing and semantic analysis

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

11 years agoMore documentation on the module map language.
Douglas Gregor [Fri, 22 Mar 2013 06:21:35 +0000 (06:21 +0000)]
More documentation on the module map language.

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

11 years agotest commit
Alexey Bataev [Fri, 22 Mar 2013 05:24:29 +0000 (05:24 +0000)]
test commit

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

11 years agoWarn about attempts to reinterpret_cast between two types that are
John McCall [Fri, 22 Mar 2013 02:58:14 +0000 (02:58 +0000)]
Warn about attempts to reinterpret_cast between two types that are
hierarchy-related at a possibly nonzero offset.

Patch by Alexander Zinenko!

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

11 years agoFix a crash-on-valid where a block capture copy expression was
John McCall [Fri, 22 Mar 2013 02:10:40 +0000 (02:10 +0000)]
Fix a crash-on-valid where a block capture copy expression was
picking up cleanups from earlier in the statement.  Also fix a
crash-on-invalid where a reference to an invalid decl from an
enclosing scope was causing an expression to fail to build, but
only *after* a cleanup was registered from that statement,
causing an assertion downstream.

The crash-on-valid is rdar://13459289.

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

11 years agoubsan: Pass floating-point arguments to the runtime by value if they fit the
Richard Smith [Fri, 22 Mar 2013 00:47:07 +0000 (00:47 +0000)]
ubsan: Pass floating-point arguments to the runtime by value if they fit the
value argument. If not, be sure we don't accidentally use a dynamic alloca.

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

11 years ago<rdar://problem/13479214> Make Clang's <stddef.h> robust against system headers defin...
Douglas Gregor [Fri, 22 Mar 2013 00:10:49 +0000 (00:10 +0000)]
<rdar://problem/13479214> Make Clang's <stddef.h> robust against system headers defining size_t/ptrdiff_t/wchar_t.

Clang's <stddef.h> provides definitions for the C standard library
types size_t, ptrdiff_t, and wchar_t. However, the system's C standard
library headers tend to provide the same typedefs, and the two
generally avoid each other using the macros
_SIZE_T/_PTRDIFF_T/_WCHAR_T. With modules, however, we need to see
*all* of the places where these types are defined, so provide the
typedefs (ignoring the macros) when modules are enabled.

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

11 years ago[analyzer] scan-build: emit errors on stderr, and exit(1) instead of exit(0).
Jordan Rose [Thu, 21 Mar 2013 23:14:26 +0000 (23:14 +0000)]
[analyzer] scan-build: emit errors on stderr, and exit(1) instead of exit(0).

PR14963

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

11 years agoUpdate debug info test case for more incoming DIBuilder changes
David Blaikie [Thu, 21 Mar 2013 23:07:47 +0000 (23:07 +0000)]
Update debug info test case for more incoming DIBuilder changes

Switching the DIFile field in DISubprogram to refer to the raw
filename/directory pair instead of a DIFile.

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

11 years agoUpdate debug info test case for an incoming change to DIBuilder in LLVM
David Blaikie [Thu, 21 Mar 2013 22:28:46 +0000 (22:28 +0000)]
Update debug info test case for an incoming change to DIBuilder in LLVM

(this will produce some transient test failure/skew)

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

11 years ago<rdar://problem/13477190> Give the Clang module cache directory some structure, so...
Douglas Gregor [Thu, 21 Mar 2013 21:48:48 +0000 (21:48 +0000)]
<rdar://problem/13477190> Give the Clang module cache directory some structure, so it's easier to find.

We now put the Clang module cache in
<system-temp-directory>/org.llvm.clang/ModuleCache. Perhaps some day
there will be other caches under <system-temp-directory>/org.llvm.clang>.

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

11 years agoFix indentation
David Blaikie [Thu, 21 Mar 2013 21:35:15 +0000 (21:35 +0000)]
Fix indentation

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

11 years agoObjective-C: Tighten the rules when warning
Fariborz Jahanian [Thu, 21 Mar 2013 20:50:53 +0000 (20:50 +0000)]
Objective-C: Tighten the rules when warning
is issused for on overriding 'readwrite'
property which is not auto-synthesized.
Buttom line is that if hueristics determine
that there will be a user implemented setter,
no warning will be issued. // rdar://13388503

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

11 years agoGeneralize debug info tests to be forward compatible with future DISubprogram changes
David Blaikie [Thu, 21 Mar 2013 20:20:15 +0000 (20:20 +0000)]
Generalize debug info tests to be forward compatible with future DISubprogram changes

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

11 years agoThis ugly regex is required because on Windows, the paths come out as \\ delimited...
Aaron Ballman [Thu, 21 Mar 2013 20:12:19 +0000 (20:12 +0000)]
This ugly regex is required because on Windows, the paths come out as \\ delimited instead of / delimited.  Fixes a test breakage since r176894.

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

11 years agoRemove unused variable.
Benjamin Kramer [Thu, 21 Mar 2013 19:47:38 +0000 (19:47 +0000)]
Remove unused variable.

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

11 years agoAvoid warnings from compilers that think you can drop off the end of a fully covered...
Benjamin Kramer [Thu, 21 Mar 2013 19:45:46 +0000 (19:45 +0000)]
Avoid warnings from compilers that think you can drop off the end of a fully covered switch.

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

11 years agoDelayed template parsing is not supported by the AST serialization system yet, so...
Aaron Ballman [Thu, 21 Mar 2013 19:38:59 +0000 (19:38 +0000)]
Delayed template parsing is not supported by the AST serialization system yet, so turning it off.  This fixes a test breakage caused by r177336.

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

11 years ago[analyzer] Print return values from debug.DumpCalls checker.
Jordan Rose [Thu, 21 Mar 2013 18:16:59 +0000 (18:16 +0000)]
[analyzer] Print return values from debug.DumpCalls checker.

Debug utility only, no functionality change.

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

11 years agoBetter block comment formatting.
Alexander Kornienko [Thu, 21 Mar 2013 12:28:10 +0000 (12:28 +0000)]
Better block comment formatting.

Summary:
1. When splitting one-line block comment, use indentation and *s.
2. Remove trailing whitespace from all lines of a comment, not only the ones being splitted.
3. Add backslashes for all lines if a comment is used insed a preprocessor directive.

Reviewers: djasper

Reviewed By: djasper

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

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

11 years ago[ASan] Let the users to invoke `clang -fsanitize=address` to link binaries targeting...
Alexander Potapenko [Thu, 21 Mar 2013 10:49:06 +0000 (10:49 +0000)]
[ASan] Let the users to invoke `clang -fsanitize=address` to link binaries targeting the iOS simulator.

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

11 years agoFix a typo.
Bob Wilson [Thu, 21 Mar 2013 06:09:09 +0000 (06:09 +0000)]
Fix a typo.

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

11 years ago<rdar://problem/13037793> Allow the names of modules to differ from the name of their...
Douglas Gregor [Thu, 21 Mar 2013 01:08:50 +0000 (01:08 +0000)]
<rdar://problem/13037793> Allow the names of modules to differ from the name of their subdirectory in the include path.

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

11 years agoFurther weaken block conversion rules to permit blocks with
John McCall [Thu, 21 Mar 2013 00:10:07 +0000 (00:10 +0000)]
Further weaken block conversion rules to permit blocks with
enum return type to be converted to blocks with any integer type
of the same size.

rdar://13463504

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

11 years agoAdd more testing cases for tbaa.struct
Manman Ren [Thu, 21 Mar 2013 00:09:50 +0000 (00:09 +0000)]
Add more testing cases for tbaa.struct

Testing cases for structs of structs and unions of structs.

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

11 years agoDebug info - generalize namespace test to not depend on a DW_TAG_file_type entry
David Blaikie [Wed, 20 Mar 2013 23:57:15 +0000 (23:57 +0000)]
Debug info - generalize namespace test to not depend on a DW_TAG_file_type entry

This isn't necessary & with the next change to LLVM the DW_TAG_file_type entry
won't be emitted at all - only the raw filename/directory pair, so match on
that directly instead.

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

11 years agoSplit ubsan runtime into three pieces (clang part):
Richard Smith [Wed, 20 Mar 2013 23:49:07 +0000 (23:49 +0000)]
Split ubsan runtime into three pieces (clang part):
 * libclang_rt-san-* is sanitizer_common, and is linked in only if no other
   sanitizer runtime is present.
 * libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on
   a C++ ABI library, and is always linked in.
 * libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a
   C++ ABI library, and is only linked in when linking a C++ binary.

This change also switches us to using -whole-archive for the ubsan runtime
(which is made possible by the above split), and switches us to only linking
the sanitizer runtime into the main binary and not into DSOs (which is made
possible by using -whole-archive).

The motivation for this is to only link a single copy of sanitizer_common
into any binary. This is becoming important now because we want to share
more state between multiple sanitizers in the same process (for instance,
we want a single shared output mutex).

The Darwin ubsan runtime is unchanged; because we use a DSO there, we don't
need this complexity.

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

11 years ago[ms-cxxabi] Mangle function pointer template arguments correctly
Reid Kleckner [Wed, 20 Mar 2013 22:29:42 +0000 (22:29 +0000)]
[ms-cxxabi] Mangle function pointer template arguments correctly

Reviewers: rjmccall

CC: timurrrr, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D554

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

11 years ago[analyzer] Appease buildbots: include template arguments in base class ref.
Jordan Rose [Wed, 20 Mar 2013 21:44:17 +0000 (21:44 +0000)]
[analyzer] Appease buildbots: include template arguments in base class ref.

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

11 years agoDocumentation cleanup for MacroInfo.
James Dennett [Wed, 20 Mar 2013 21:30:03 +0000 (21:30 +0000)]
Documentation cleanup for MacroInfo.
* Clarify what MacroInfo::isBuiltinMacro means, as it really means something
  more like "isMagicalMacro" or "requiresProcessingBeforeExpansion" -- the
  macros defined in "<built-in>" are not considered built-in by this function;
* Escape __LINE__ as \__LINE__ in Doxygen comments so that the underscores
  don't get replaced by *bold* output;
* Turn comments in MacroInfo.cpp into non-Doxygen comments, so that they
  don't result in duplicated/badly formatted Doxygen output;
* Clean up a bunch of \brief formatting, and add a \file comment for
  MacroInfo.h.

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

11 years ago<rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn...
Douglas Gregor [Wed, 20 Mar 2013 21:10:35 +0000 (21:10 +0000)]
<rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module.

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

11 years ago[analyzer] Don't invalidate globals when there's no call involved.
Jordan Rose [Wed, 20 Mar 2013 20:36:01 +0000 (20:36 +0000)]
[analyzer] Don't invalidate globals when there's no call involved.

This fixes some mistaken condition logic in RegionStore that caused
global variables to be invalidated when /any/ region was invalidated,
rather than only as part of opaque function calls. This was only
being used by CStringChecker, and so users will now see that strcpy()
and friends do not invalidate global variables.

Also, add a test case we don't handle properly: explicitly-assigned
global variables aren't being invalidated by opaque calls. This is
being tracked by <rdar://problem/13464044>.

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

11 years ago[analyzer] Track malloc'd memory into struct fields.
Jordan Rose [Wed, 20 Mar 2013 20:35:57 +0000 (20:35 +0000)]
[analyzer] Track malloc'd memory into struct fields.

Due to improper modelling of copy constructors (specifically, their
const reference arguments), we were producing spurious leak warnings
for allocated memory stored in structs. In order to silence this, we
decided to consider storing into a struct to be the same as escaping.
However, the previous commit has fixed this issue and we can now properly
distinguish leaked memory that happens to be in a struct from a buffer
that escapes within a struct wrapper.

Originally applied in r161511, reverted in r174468.
<rdar://problem/12945937>

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

11 years ago[analyzer] Invalidate regions indirectly accessible through const pointers.
Jordan Rose [Wed, 20 Mar 2013 20:35:53 +0000 (20:35 +0000)]
[analyzer] Invalidate regions indirectly accessible through const pointers.

In this case, the value of 'x' may be changed after the call to indirectAccess:

  struct Wrapper {
    int *ptr;
  };

  void indirectAccess(const Wrapper &w);

  void test() {
    int x = 42;
    Wrapper w = { x };

    clang_analyzer_eval(x == 42); // TRUE
    indirectAccess(w);
    clang_analyzer_eval(x == 42); // UNKNOWN
  }

This is important for modelling return-by-value objects in C++, to show
that the contents of the struct are escaping in the return copy-constructor.

<rdar://problem/13239826>

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

11 years ago[analyzer] Remove strip of ElementRegion in CallEvent::invalidateRegions.
Jordan Rose [Wed, 20 Mar 2013 20:35:48 +0000 (20:35 +0000)]
[analyzer] Remove strip of ElementRegion in CallEvent::invalidateRegions.

This is a bit of old code trying to deal with the fact that functions that
take pointers often use them to access an entire array via pointer
arithmetic. However, RegionStore already conservatively assumes you can use
pointer arithmetic to access any part of a region.

Some day we may want to go back to handling this specifically for calls,
but we can do that in the future.

No functionality change.

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

11 years agorefactoring file/directory for namespace debug info
David Blaikie [Wed, 20 Mar 2013 19:38:29 +0000 (19:38 +0000)]
refactoring file/directory for namespace debug info

(this is a paired commit with an LLVM change to DIBuilder - expect some
buildbot skew/fallout)

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

11 years agoEnhance debug info namespace test to check for context/scope reference
David Blaikie [Wed, 20 Mar 2013 19:10:57 +0000 (19:10 +0000)]
Enhance debug info namespace test to check for context/scope reference

The #line directive is mostly for backend testing (keeping these files matching
should simplify maintenance somewhat) though the corresponding backend test
improvement/update doesn't verify the file information directly just yet.
Coming in a later iteration.

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

11 years agoDo the error recovery for @end only.
Fariborz Jahanian [Wed, 20 Mar 2013 18:45:49 +0000 (18:45 +0000)]
Do the error recovery for @end only.
I am not sure how much we can improve for
when a randon ObjC keyword is thrown into the
ivar decl. block. // rdar://6854840

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

11 years ago[docs] Point inquisitive users to existing module.map files.
Sean Silva [Wed, 20 Mar 2013 18:37:47 +0000 (18:37 +0000)]
[docs] Point inquisitive users to existing module.map files.

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

11 years ago[docs] Prominently note that modules are expemental.
Sean Silva [Wed, 20 Mar 2013 18:37:42 +0000 (18:37 +0000)]
[docs] Prominently note that modules are expemental.

And ask for people to try it out and send us bug reports!

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

11 years agoObjective-C [qoi] more gracefull recovery when
Fariborz Jahanian [Wed, 20 Mar 2013 18:09:33 +0000 (18:09 +0000)]
Objective-C [qoi] more gracefull recovery when
'}' is missing for the ivar declarations.
// rdar://6854840

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

11 years agoPR7256: Provide a fixit for incorrect destructor declarations
David Blaikie [Wed, 20 Mar 2013 17:42:13 +0000 (17:42 +0000)]
PR7256: Provide a fixit for incorrect destructor declarations

Fix by Ismail Pazarbasi (ismail.pazarbasi@gmail.com), review by Dmitri Gribenko.

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

11 years agoFix typo and grammaro in modules documentation
Douglas Gregor [Wed, 20 Mar 2013 17:11:13 +0000 (17:11 +0000)]
Fix typo and grammaro in modules documentation

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

11 years agoOnly introduce the SDKSettings.plist dependency in modules/PCH files that don't depen...
Douglas Gregor [Wed, 20 Mar 2013 16:59:53 +0000 (16:59 +0000)]
Only introduce the SDKSettings.plist dependency in modules/PCH files that don't depend on any other modules or PCH files.

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

11 years agoExploit this-return of a callsite in a this-return function.
Manman Ren [Wed, 20 Mar 2013 16:59:38 +0000 (16:59 +0000)]
Exploit this-return of a callsite in a this-return function.

For constructors/desctructors that return 'this', if there exists a callsite
that returns 'this' and is immediately before the return instruction, make
sure we are using the return value from the callsite.

We don't need to keep 'this' alive through the callsite. It also enables
optimizations in the backend, such as tail call optimization.

Updated from r177211.
rdar://12818789

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

11 years agoSupport for pointers-to-members usage via .*
Alexander Kornienko [Wed, 20 Mar 2013 16:41:56 +0000 (16:41 +0000)]
Support for pointers-to-members usage via .*

Summary: Added support for pointers-to-members usage via .* and a few tests.

Reviewers: djasper

Reviewed By: djasper

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

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

11 years agoRemove assertion that can be triggered on bad input.
Daniel Jasper [Wed, 20 Mar 2013 15:58:10 +0000 (15:58 +0000)]
Remove assertion that can be triggered on bad input.

clang-format can't do anything useful, so it should leave the remainder
of the line unchanged, but it should not assert/segfault.

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

11 years agoFix infinite-loop in unwrapped line parser.
Daniel Jasper [Wed, 20 Mar 2013 15:12:38 +0000 (15:12 +0000)]
Fix infinite-loop in unwrapped line parser.

Discovered when accidentally formatting a python file :-).

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

11 years agoDo not consider comments when adjusting to local indent style.
Daniel Jasper [Wed, 20 Mar 2013 14:31:47 +0000 (14:31 +0000)]
Do not consider comments when adjusting to local indent style.

Before (when only reformatting "int b"):
int a; // comment
       // comment
       int b;

After:
int a; // comment
       // comment
int b;

This also fixes llvm.org/PR15433.

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

11 years agoReduce penalty for breaks after "(" for functions with parameters.
Daniel Jasper [Wed, 20 Mar 2013 13:53:11 +0000 (13:53 +0000)]
Reduce penalty for breaks after "(" for functions with parameters.

Before:
  aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  aaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

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

11 years agoAdd extra indentation for multiline comparisons.
Daniel Jasper [Wed, 20 Mar 2013 12:37:50 +0000 (12:37 +0000)]
Add extra indentation for multiline comparisons.

This seems to be generally more desired.

Before:
if (aaaaaaaa &&
    bbbbbbbb >
    cccccccc) {}
After:
if (aaaaaaaa &&
    bbbbbbbb >
        cccccccc) {}

Also: Some formatting cleanup on clang-format's files.

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

11 years agoDon't remove all indentation when in #defines.
Daniel Jasper [Wed, 20 Mar 2013 10:23:53 +0000 (10:23 +0000)]
Don't remove all indentation when in #defines.

Otherwise, this can become hard to read.

Before: #define A \
        case 1:
After:  #define A \
           case 1:

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

11 years agoAdd clang-format binary to cfe.
Daniel Jasper [Wed, 20 Mar 2013 09:53:23 +0000 (09:53 +0000)]
Add clang-format binary to cfe.

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

11 years agoImprove formatting of function types in template parameters.
Daniel Jasper [Wed, 20 Mar 2013 09:53:18 +0000 (09:53 +0000)]
Improve formatting of function types in template parameters.

Before: A<int * (int)>;
After:  A<int *(int)>;

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

11 years agoFix redundant comparison in gcc::Common::ConstructJob.
Hans Wennborg [Wed, 20 Mar 2013 07:34:27 +0000 (07:34 +0000)]
Fix redundant comparison in gcc::Common::ConstructJob.

We were checking "Arch == llvm::Triple::x86_64 || Arch
== llvm::Triple::x86_64", but the rhs should actually check for
powerpc64.

Found while experimenting with a potential new Clang warning.

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