]> granicus.if.org Git - clang/log
clang
11 years agoThe clang driver has a fairly fancy support for executing gcc instead of
Rafael Espindola [Tue, 9 Oct 2012 20:46:28 +0000 (20:46 +0000)]
The clang driver has a fairly fancy support for executing gcc instead of
clang itself. This dates back to clang's early days and while it looks like
some of it is still used (for kext for example), other parts are probably dead.

Remove the -ccc-clang-archs option and associated code. I don't think there
is any remaining setup where clang doesn't support an architecture but it can
expect an working gcc cross compiler to be available.

A nice side effect is that tests no longer need to differentiate architectures
that are included in production builds of clang and those that are not.

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

11 years agoSimplify the code using SmallVector::append(), as suggested by Benjamin Kramer.
Argyrios Kyrtzidis [Tue, 9 Oct 2012 20:08:43 +0000 (20:08 +0000)]
Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.

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

11 years ago[driver] Remove redundant cases due to overlapping commits between Ted (r165531,...
Chad Rosier [Tue, 9 Oct 2012 20:01:58 +0000 (20:01 +0000)]
[driver] Remove redundant cases due to overlapping commits between Ted (r165531, 165532) and I
(r165534), but leave the test case in place.

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

11 years ago-fcatch-undefined-behavior: emit calls to the runtime library whenever one of the...
Richard Smith [Tue, 9 Oct 2012 19:52:38 +0000 (19:52 +0000)]
-fcatch-undefined-behavior: emit calls to the runtime library whenever one of the checks fails.

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

11 years ago[driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]
Chad Rosier [Tue, 9 Oct 2012 19:43:33 +0000 (19:43 +0000)]
[driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]
options when clang invokes cc1plus for i386 kexts.
rdar://12459188

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

11 years agoDon't forward -Wenum-conversion to cc1plus.
Ted Kremenek [Tue, 9 Oct 2012 19:29:48 +0000 (19:29 +0000)]
Don't forward -Wenum-conversion to cc1plus.

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

11 years agoDon't forward -Wint-conversion to cc1plus.
Ted Kremenek [Tue, 9 Oct 2012 19:29:46 +0000 (19:29 +0000)]
Don't forward -Wint-conversion to cc1plus.

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

11 years agoCreate variable for warning group -Wshorten-64-to-32.
Ted Kremenek [Tue, 9 Oct 2012 18:46:14 +0000 (18:46 +0000)]
Create variable for warning group -Wshorten-64-to-32.

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

11 years agoMove the functionality that looks for ObjC overridden methods from
Argyrios Kyrtzidis [Tue, 9 Oct 2012 18:19:01 +0000 (18:19 +0000)]
Move the functionality that looks for ObjC overridden methods from
ASTContext to the ObjCMethodDecl, and have the more generic
ASTContext::getOverriddenMethods() use the ObjCMethodDecl::getOverriddenMethods()
function.

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

11 years agoMake the order of visitation of the pending bodies in the AST reader
Douglas Gregor [Tue, 9 Oct 2012 17:50:23 +0000 (17:50 +0000)]
Make the order of visitation of the pending bodies in the AST reader
deterministic.

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

11 years agoWhen we load a function or method body from an AST file, we check
Douglas Gregor [Tue, 9 Oct 2012 17:21:28 +0000 (17:21 +0000)]
When we load a function or method body from an AST file, we check
whether that function/method already has a body (loaded from some
other AST file), as introduced in r165137. Delay this check until
after the redeclaration chains have been wired up.

While I'm here, make the loading of method bodies lazy.

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

11 years agoFixup for r165097: build 32-bit ASan compiler-rt library on 64-bit Linux only if...
Alexey Samsonov [Tue, 9 Oct 2012 16:03:52 +0000 (16:03 +0000)]
Fixup for r165097: build 32-bit ASan compiler-rt library on 64-bit Linux only if just-built clang can build simple 32-bit executables

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

11 years agoIf a macro has been #undef'd in a precompiled header, we still need to
Douglas Gregor [Tue, 9 Oct 2012 16:01:50 +0000 (16:01 +0000)]
If a macro has been #undef'd in a precompiled header, we still need to
write out the macro history for that macro. Similarly, we need to cope
with reading a macro definition that has been #undef'd.

Take advantage of this new ability so that global code-completion
results can refer to #undef'd macros, rather than losing them
entirely. For multiply defined/#undef'd macros, we will still get the
wrong result, but it's better than getting no result.

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

11 years agoClearing a SmallPtrSet is still expensive, split it out from OverloadCandidateSet...
Benjamin Kramer [Tue, 9 Oct 2012 15:52:25 +0000 (15:52 +0000)]
Clearing a SmallPtrSet is still expensive, split it out from OverloadCandidateSet::clear and don't do it on destruction.

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

11 years agoWe use the enums to query whether an Attributes object has that attribute. The
Bill Wendling [Tue, 9 Oct 2012 07:45:26 +0000 (07:45 +0000)]
We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.

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

11 years agoCXXMethodDecl::isConst() and CXXMethodDecl::isVolatile() can be const methods
Arnaud A. de Grandmaison [Tue, 9 Oct 2012 07:09:56 +0000 (07:09 +0000)]
CXXMethodDecl::isConst() and CXXMethodDecl::isVolatile() can be const methods

Patch by: Laszlo Nagy

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

11 years agoMove the logic that searches for overridden methods from libclang to
Argyrios Kyrtzidis [Tue, 9 Oct 2012 01:23:50 +0000 (01:23 +0000)]
Move the logic that searches for overridden methods from libclang to
ASTContext so that it can be widely available.

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

11 years agoWhen storing the C++ overridden methods, store them once for the
Argyrios Kyrtzidis [Tue, 9 Oct 2012 01:23:45 +0000 (01:23 +0000)]
When storing the C++ overridden methods, store them once for the
canonical method; avoid storing them again for an out-of-line definition.

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

11 years agoMake sure we allow "#pragma options align=mac68k" in function-local contexts. <rdar...
Eli Friedman [Mon, 8 Oct 2012 23:52:38 +0000 (23:52 +0000)]
Make sure we allow "#pragma options align=mac68k" in function-local contexts.  <rdar://problem/12453134>

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

11 years agoAdd regression test to check if -Wenum-conversion is a subgroup of -Wconversion.
Ted Kremenek [Mon, 8 Oct 2012 23:45:09 +0000 (23:45 +0000)]
Add regression test to check if -Wenum-conversion is a subgroup of -Wconversion.

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

11 years agoIn VarDecl::getSourceRange() make sure to check that the source location
Argyrios Kyrtzidis [Mon, 8 Oct 2012 23:08:41 +0000 (23:08 +0000)]
In VarDecl::getSourceRange() make sure to check that the source location
of the initializer is valid before using it.

Fixes rdar://12455002&12449015 where local variables of objc objects in ARC mode
were not annotated because of the ImplicitValueInitExpr initializer having invalid
source range, resulting in the SourceRange of the VarDecl having invalid end location.

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

11 years agoActually add the -Wenum-conversion group to -Wconversion as r165361
Chandler Carruth [Mon, 8 Oct 2012 22:45:55 +0000 (22:45 +0000)]
Actually add the -Wenum-conversion group to -Wconversion as r165361
seems to have intended.

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

11 years agoSort the subgroups of the diagnostic group for -Wconversion. No
Chandler Carruth [Mon, 8 Oct 2012 22:45:54 +0000 (22:45 +0000)]
Sort the subgroups of the diagnostic group for -Wconversion. No
functionality changed.

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

11 years agoMake Bitrig's clang understand -stdlib= correctly.
Chandler Carruth [Mon, 8 Oct 2012 21:31:38 +0000 (21:31 +0000)]
Make Bitrig's clang understand -stdlib= correctly.
With this patch Bitrig can use a different c++ library without pain and
within the normal commandline parameters.

Original patch by David Hill, with lots of fixes and cleanup by me.

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

11 years agoUse a special path to place the .o files in.
Bill Wendling [Mon, 8 Oct 2012 21:17:59 +0000 (21:17 +0000)]
Use a special path to place the .o files in.

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

11 years agoCompilationDatabaseTest: Fix another Windows path issue.
Daniel Jasper [Mon, 8 Oct 2012 20:32:51 +0000 (20:32 +0000)]
CompilationDatabaseTest: Fix another Windows path issue.

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

11 years agoCompilationDatabase: Use //net paths for tests, as they should be
Daniel Jasper [Mon, 8 Oct 2012 20:08:25 +0000 (20:08 +0000)]
CompilationDatabase: Use //net paths for tests, as they should be
considered absolute on all platforms.

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

11 years agoDon't emit double parentheses in __clang_version__.
Benjamin Kramer [Mon, 8 Oct 2012 18:49:39 +0000 (18:49 +0000)]
Don't emit double parentheses in __clang_version__.

PR14040.

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

11 years agoHopefully appease Windows buildbot with Japanese (?) error message.
Daniel Jasper [Mon, 8 Oct 2012 18:37:21 +0000 (18:37 +0000)]
Hopefully appease Windows buildbot with Japanese (?) error message.

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

11 years agoFileNameMatchTrie: Use StringRef instead of Twines where possible.
Daniel Jasper [Mon, 8 Oct 2012 18:31:54 +0000 (18:31 +0000)]
FileNameMatchTrie: Use StringRef instead of Twines where possible.

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

11 years agoMove TargetData to DataLayout.
Micah Villmow [Mon, 8 Oct 2012 16:25:52 +0000 (16:25 +0000)]
Move TargetData to DataLayout.

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

11 years agoSupport symlinks and relative paths in complilation databases.
Daniel Jasper [Mon, 8 Oct 2012 16:08:15 +0000 (16:08 +0000)]
Support symlinks and relative paths in complilation databases.

Review: http://llvm-reviews.chandlerc.com/D30

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

11 years agoUse a single note diagnostic for all the precedent/parentheses warnings.
David Blaikie [Mon, 8 Oct 2012 01:19:49 +0000 (01:19 +0000)]
Use a single note diagnostic for all the precedent/parentheses warnings.

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

11 years agoStringRef-ify Binary/UnaryOperator::getOpcodeStr
David Blaikie [Mon, 8 Oct 2012 01:11:04 +0000 (01:11 +0000)]
StringRef-ify Binary/UnaryOperator::getOpcodeStr

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

11 years agoPython bindings: fix typo.
Benjamin Kramer [Sun, 7 Oct 2012 11:51:45 +0000 (11:51 +0000)]
Python bindings: fix typo.

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

11 years agoPython bindings: Add missing availability kind.
Benjamin Kramer [Sun, 7 Oct 2012 11:46:37 +0000 (11:46 +0000)]
Python bindings: Add missing availability kind.

Patch by Leo Liu, test case by me.

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

11 years agoUse getArch instead of getArchName + string compare.
Rafael Espindola [Sun, 7 Oct 2012 04:44:33 +0000 (04:44 +0000)]
Use getArch instead of getArchName + string compare.

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

11 years agoUse getArch instead of getArchName.
Rafael Espindola [Sun, 7 Oct 2012 03:23:40 +0000 (03:23 +0000)]
Use getArch instead of getArchName.

The darwin change should be a nop since Triple::getArchTypeForDarwinArchName
doesn't know about amd64.

If things like amd64-mingw32 are to be rejected, we should print a error
earlier on instead of silently using the wrong abi.

Remove old comment that looks out of place, this is "in clang".

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

11 years agoList of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
Dmitri Gribenko [Sat, 6 Oct 2012 17:23:59 +0000 (17:23 +0000)]
List of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
will do the right thing for new[] allocated memory.  Thanks David!

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

11 years agoClang static analyzer docs: fix a couple of HTML markup issues and non-UTF-8
Dmitri Gribenko [Sat, 6 Oct 2012 17:14:39 +0000 (17:14 +0000)]
Clang static analyzer docs: fix a couple of HTML markup issues and non-UTF-8
characters.

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

11 years agoList of potential checkers: more C++11 details for the smart pointer checker.
Dmitri Gribenko [Sat, 6 Oct 2012 16:59:15 +0000 (16:59 +0000)]
List of potential checkers: more C++11 details for the smart pointer checker.

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

11 years agoExpose __builtin_bswap16.
Benjamin Kramer [Sat, 6 Oct 2012 14:42:22 +0000 (14:42 +0000)]
Expose __builtin_bswap16.

GCC has always supported this on PowerPC and 4.8 supports it on all platforms,
so it's a good idea to expose it in clang too. LLVM supports this on all targets.

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

11 years agoPlace warn_impcast_different_enum_types in a new warning group, -Wenum-conversion...
Ted Kremenek [Sat, 6 Oct 2012 05:25:43 +0000 (05:25 +0000)]
Place warn_impcast_different_enum_types in a new warning group, -Wenum-conversion, that is a subgroup of -Wconversion.

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

11 years agoAdd link to potential future checkers.
Ted Kremenek [Sat, 6 Oct 2012 05:11:15 +0000 (05:11 +0000)]
Add link to potential future checkers.

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

11 years agoAdd list of potential checkers. Provided by Anton Yartsev!
Ted Kremenek [Sat, 6 Oct 2012 05:09:43 +0000 (05:09 +0000)]
Add list of potential checkers.  Provided by Anton Yartsev!

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

11 years ago[analyzer] Tweak test to run the retain-count checker even on non-Darwin.
Jordan Rose [Sat, 6 Oct 2012 02:06:17 +0000 (02:06 +0000)]
[analyzer] Tweak test to run the retain-count checker even on non-Darwin.

This should fix the bots.

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

11 years agoParentMap: Restore the ability to update an existing map.
Jordan Rose [Sat, 6 Oct 2012 01:19:36 +0000 (01:19 +0000)]
ParentMap: Restore the ability to update an existing map.

The Clang ASTs are a DAG, not a pure tree. However, ParentMap has to
choose a single parent for each object. In the main (only?) cases in
which the AST forms a DAG, it protects from multiple traversal by using
OpaqueValueExprs. Previously, ParentMap would just unconditionally look
through all OpaqueValueExprs when building its map.

In order to make this behavior better for the analyzer's diagnostics,
ParentMap was changed to not set a statement's parent if there already
was one in the map. However, ParentMap is supposed to allow updating
existing mappings by calling addStmt once again. This change makes the
"transparency" of OpaqueValueExprs explicit, and disables it when it
is not desired, rather than checking the current contents of the map.

This new code seems like a big change, but it should actually have
essentially the same performance as before. Only OpaqueValueExprs and
their users (PseudoObjectExpr and BinaryConditionalOperator) will
have any different behavior.

There should be no user-visible functionality change, though a test
has been added for the current behavior of BinaryConditionalOperator
source locations and accompanying Xcode arrows (which are not so great...).

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

11 years ago[analyzer] Handle implicit statements used for end-of-path nodes' source locs.
Jordan Rose [Sat, 6 Oct 2012 01:19:30 +0000 (01:19 +0000)]
[analyzer] Handle implicit statements used for end-of-path nodes' source locs.

Some implicit statements, such as the implicit 'self' inserted for "free"
Objective-C ivar access, have invalid source locations. If one of these
statements is the location where an issue is reported, we'll now look at
the enclosing statements for a valid source location.

<rdar://problem/12446776>

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

11 years ago[libclang] Fix the comments, as suggested by Dmitri.
Argyrios Kyrtzidis [Sat, 6 Oct 2012 01:18:38 +0000 (01:18 +0000)]
[libclang] Fix the comments, as suggested by Dmitri.

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

11 years ago[libclang] Don't disable the preprocessing record while indexing so as
Argyrios Kyrtzidis [Sat, 6 Oct 2012 01:18:35 +0000 (01:18 +0000)]
[libclang] Don't disable the preprocessing record while indexing so as
to not mess up with module building.

It was not worth trying to combine indexing without preprocessing record
and building modules with one because:

-just importing a module/PCH that was built with a pp record, enables it anyway
-the performance gain of indexing without the preprocessing record is insignificant.

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

11 years agoFix another spot where this test varied for a Release build.
Alex Rosenberg [Fri, 5 Oct 2012 23:56:20 +0000 (23:56 +0000)]
Fix another spot where this test varied for a Release build.

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

11 years agoMake test resilient to Release build temp names.
Alex Rosenberg [Fri, 5 Oct 2012 23:33:39 +0000 (23:33 +0000)]
Make test resilient to Release build temp names.

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

11 years agoPropagate calling convention for aliases and weakrefs.
Alex Rosenberg [Fri, 5 Oct 2012 23:12:53 +0000 (23:12 +0000)]
Propagate calling convention for aliases and weakrefs.

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

11 years agoFileCheckize test
Alex Rosenberg [Fri, 5 Oct 2012 23:12:48 +0000 (23:12 +0000)]
FileCheckize test

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

11 years agoThread-safety analysis: allow attributes on constructors to refer to 'this'.
DeLesley Hutchins [Fri, 5 Oct 2012 22:38:19 +0000 (22:38 +0000)]
Thread-safety analysis: allow attributes on constructors to refer to 'this'.

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

11 years agoAdd color output to 'diagtool tree' to show what warnings are enabled by default.
Ted Kremenek [Fri, 5 Oct 2012 22:07:14 +0000 (22:07 +0000)]
Add color output to 'diagtool tree' to show what warnings are enabled by default.

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

11 years agoChanging line endings from Windows to Unix. No functional changes.
Aaron Ballman [Fri, 5 Oct 2012 19:46:32 +0000 (19:46 +0000)]
Changing line endings from Windows to Unix.  No functional changes.

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

11 years agoAdd intrinsic of MULX in BMI2 header
Michael Liao [Fri, 5 Oct 2012 18:50:09 +0000 (18:50 +0000)]
Add intrinsic of MULX in BMI2 header

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

11 years agoAdded forgotten break.
Abramo Bagnara [Fri, 5 Oct 2012 04:43:29 +0000 (04:43 +0000)]
Added forgotten break.

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

11 years agoMake sure to generate the right kind of MDNode for enum forward declarations.
Eli Friedman [Fri, 5 Oct 2012 01:49:33 +0000 (01:49 +0000)]
Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, clang part.

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

11 years agoWorkaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's...
Richard Smith [Fri, 5 Oct 2012 01:46:25 +0000 (01:46 +0000)]
Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's going on, per Sean Silva's suggestion.

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

11 years agoImplement -Wshift-op-parentheses for: a << b + c
David Blaikie [Fri, 5 Oct 2012 00:41:03 +0000 (00:41 +0000)]
Implement -Wshift-op-parentheses for: a << b + c

This appears to be consistent with GCC's implementation of the same warning
under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user
defined type for compatibility with C++ stream IO. Otherwise suggest
parentheses around the addition or subtraction subexpression.

(this came up when MSVC was complaining (incorrectly, so far as I can tell)
about a perceived violation of this within the LLVM codebase, PR14001)

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

11 years ago[libclang] Now that we have a CXModule object, pass it to the
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:40 +0000 (00:22 +0000)]
[libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

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

11 years ago[libclang] Introduce new C functions that provide information about modules:
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:37 +0000 (00:22 +0000)]
[libclang] Introduce new C functions that provide information about modules:

clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader

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

11 years ago[Modules] Introduce Module::TopHeaders which is a set of top-level headers
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:33 +0000 (00:22 +0000)]
[Modules] Introduce Module::TopHeaders which is a set of top-level headers
that are associated with a (sub)module.

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

11 years ago[preprocessing record] Have PPEntityID be independent of the size of the
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:28 +0000 (00:22 +0000)]
[preprocessing record] Have PPEntityID be independent of the size of the
loaded entities vector, otherwise its meaning will change when a module
is imported and the vector size changes.

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

11 years ago[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:24 +0000 (00:22 +0000)]
[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
import declaration.

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

11 years agoTest case for r165275.
Chad Rosier [Thu, 4 Oct 2012 23:59:54 +0000 (23:59 +0000)]
Test case for r165275.

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

11 years agoIf we flow off the end of a value-returning function:
Richard Smith [Thu, 4 Oct 2012 23:52:29 +0000 (23:52 +0000)]
If we flow off the end of a value-returning function:
 - outside C++, return undef (behavior is not undefined unless the value is used)
 - in C++, with -fcatch-undefined-behavior, perform an appropriate trap
 - in C++, produce an 'unreachable' (behavior is undefined immediately)

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

11 years agolibstdc++-4.6 needs the same common_type fix as libstdc++-4.7. Other than that,
Richard Smith [Thu, 4 Oct 2012 22:23:07 +0000 (22:23 +0000)]
libstdc++-4.6 needs the same common_type fix as libstdc++-4.7. Other than that,
Clang can now cope with its eccentricities in C++11 mode.

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

11 years agoEgriegious hack to support libstdc++4.6's broken <atomic> header, which defines
Richard Smith [Thu, 4 Oct 2012 22:13:39 +0000 (22:13 +0000)]
Egriegious hack to support libstdc++4.6's broken <atomic> header, which defines
a non-inline namespace, then reopens it as inline to try to add its symbols to
the surrounding namespace. In this one special case, permit the namespace to be
reopened as inline, and patch up the name lookup tables to match.

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

11 years agoFixed FunctionTypeLoc source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:42:10 +0000 (21:42 +0000)]
Fixed FunctionTypeLoc source range.

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

11 years agoFixed instantiated operators source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:40:42 +0000 (21:40 +0000)]
Fixed instantiated operators source range.

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

11 years agoFixed friend decl source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:39:47 +0000 (21:39 +0000)]
Fixed friend decl source range.

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

11 years agoFixed ParamDecl source range for implicit typed k&r parameters.
Abramo Bagnara [Thu, 4 Oct 2012 21:38:29 +0000 (21:38 +0000)]
Fixed ParamDecl source range for implicit typed k&r parameters.

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

11 years agoFix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.
Bill Schmidt [Thu, 4 Oct 2012 20:33:57 +0000 (20:33 +0000)]
Fix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.

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

11 years agoAdd a test case for r156143, which enabled general varargs support for the
Bill Schmidt [Thu, 4 Oct 2012 20:18:38 +0000 (20:18 +0000)]
Add a test case for r156143, which enabled general varargs support for the
64-bit PPC SVR4 ABI.

The test verifies passing of structures, items with 16-byte alignment, and
small items that are passed right-justified in the parameter save area slot.

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

11 years agoDriver: Link crtfastmath.o if it's available and -ffast-math is specified.
Benjamin Kramer [Thu, 4 Oct 2012 19:42:20 +0000 (19:42 +0000)]
Driver: Link crtfastmath.o if it's available and -ffast-math is specified.

crtfastmath.o contains routines to set the floating point flags to a faster,
unsafe mode. Linking it in speeds up code dealing with denormals significantly
(PR14024).

For now this is only enabled on linux where I can test it and crtfastmath.o is
widely available. We may want to provide a similar file with compiler-rt
eventually and/or enable it on other platforms too.

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

11 years agoFix scope location when parsing GNU attributes.
Michael Han [Thu, 4 Oct 2012 16:42:52 +0000 (16:42 +0000)]
Fix scope location when parsing GNU attributes.

For GNU attributes, instead of reusing attribute source
location for the scope location, use SourceLocation() since
GNU attributes don not have scope tokens.

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

11 years agoRevert 165129
Preston Gurd [Thu, 4 Oct 2012 15:26:04 +0000 (15:26 +0000)]
Revert 165129

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

11 years agoPrefer StringRef::startswith to the strncmp/strlen contraption.
Benjamin Kramer [Thu, 4 Oct 2012 10:06:38 +0000 (10:06 +0000)]
Prefer StringRef::startswith to the strncmp/strlen contraption.

This may be slightly more efficient and is definitely more readable.

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

11 years agoFix typo in comments.
Logan Chien [Thu, 4 Oct 2012 08:08:56 +0000 (08:08 +0000)]
Fix typo in comments.

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

11 years agoFix r165005: The lexical DeclContext is not the right place to make a decision about...
Axel Naumann [Thu, 4 Oct 2012 07:34:43 +0000 (07:34 +0000)]
Fix r165005: The lexical DeclContext is not the right place to make a decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit.

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

11 years agoAdd missing comment for mangling.
Nick Lewycky [Thu, 4 Oct 2012 04:58:17 +0000 (04:58 +0000)]
Add missing comment for mangling.

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

11 years agoFail early with a clear assert if an operation with multiple uses somehow ends
Lang Hames [Thu, 4 Oct 2012 03:23:25 +0000 (03:23 +0000)]
Fail early with a clear assert if an operation with multiple uses somehow ends
up being contracted during codegen.

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

11 years agoTest file-scoped FP_CONTRACT pragma.
Lang Hames [Thu, 4 Oct 2012 03:07:37 +0000 (03:07 +0000)]
Test file-scoped FP_CONTRACT pragma.

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

11 years agoPermanently end the whole "pragma got handled by the parser too early"
Eli Friedman [Thu, 4 Oct 2012 02:36:51 +0000 (02:36 +0000)]
Permanently end the whole "pragma got handled by the parser too early"
mess by handling all pragmas which the parser touches uniformly.
<rdar://problem/12248901>, etc.

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

11 years agoAdd an explicit -object_path_lto flag during linking with a uniquified temporary
Bill Wendling [Wed, 3 Oct 2012 23:49:57 +0000 (23:49 +0000)]
Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.

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

11 years agouse ';' instead of '-' in the note part of my last patch.
Fariborz Jahanian [Wed, 3 Oct 2012 22:39:32 +0000 (22:39 +0000)]
use ';' instead of '-' in the note part of my last patch.

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

11 years agoUpdate test case for r165174.
Chad Rosier [Wed, 3 Oct 2012 22:18:51 +0000 (22:18 +0000)]
Update test case for r165174.

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

11 years agotblgen: Migrate clang-tblgen to new TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:29:30 +0000 (21:29 +0000)]
tblgen: Migrate clang-tblgen to new TableGenMain API.

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

11 years agoRemove the directory that these are already in.
Bill Wendling [Wed, 3 Oct 2012 21:08:21 +0000 (21:08 +0000)]
Remove the directory that these are already in.

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

11 years ago[libclang] When indexing, invoke the importedASTFile for PCH files as well.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:51 +0000 (21:05 +0000)]
[libclang] When indexing, invoke the importedASTFile for PCH files as well.

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

11 years ago[libclang] Simplify indexing of module imports by handling implicit
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:44 +0000 (21:05 +0000)]
[libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

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

11 years agoPR14004: Fix typo in documentation.
Richard Smith [Wed, 3 Oct 2012 21:02:25 +0000 (21:02 +0000)]
PR14004: Fix typo in documentation.

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

11 years agoFix invalid reads by memcmp.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:09 +0000 (20:58 +0000)]
Fix invalid reads by memcmp.

Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the
end. Found by valgrind.

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

11 years agoAlways initialize FPContractable.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:04 +0000 (20:58 +0000)]
Always initialize FPContractable.

false is used as a baseline here, we may want to allow contraction in some of
the cases.  Found by valgrind.

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

11 years ago[Options] Store the owning OptTable in Option so it can construct Group and Alias.
Michael J. Spencer [Wed, 3 Oct 2012 19:58:10 +0000 (19:58 +0000)]
[Options] Store the owning OptTable in Option so it can construct Group and Alias.

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

11 years agoRemove useless parameter "WantFile" from Driver::GetProgramPath().
Simon Atanasyan [Wed, 3 Oct 2012 19:52:37 +0000 (19:52 +0000)]
Remove useless parameter "WantFile" from Driver::GetProgramPath().
This parameter is useless because nowhere used explicitly and always
gets its default value - "false".

The patch reviewed by Rafael Espindola.

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

11 years agoThis patch enables general varargs support for the 64-bit PPC SVR4 ABI.
Bill Schmidt [Wed, 3 Oct 2012 19:18:57 +0000 (19:18 +0000)]
This patch enables general varargs support for the 64-bit PPC SVR4 ABI.

Most of the pieces for this were already in place, but a proper EmitVAArg
is needed for aggregates and complex numbers to be handled.  Although the
va_list for 64-bit PowerPC SVR4 consists of GPRs 3 through 10 together with
the overflow portion of the parameter save area, we can treat va_list as
pointing to contiguous memory for all parameters, since the back end forces
the parameter GPRs to memory for varargs functions.

There is no need at this time to model parameters and return values beyond
what the DefaultABIInfo provides.

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