]> granicus.if.org Git - clang/log
clang
11 years agoFormat strings: the correct conversion for 'char' is %c, not %d or %hhd.
Jordan Rose [Wed, 5 Dec 2012 18:44:37 +0000 (18:44 +0000)]
Format strings: the correct conversion for 'char' is %c, not %d or %hhd.

We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.

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

11 years agoRemove bad and useless enum to bool conversion.
Daniel Jasper [Wed, 5 Dec 2012 16:24:48 +0000 (16:24 +0000)]
Remove bad and useless enum to bool conversion.

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

11 years agoClang-format: parse for and while loops
Alexander Kornienko [Wed, 5 Dec 2012 15:06:06 +0000 (15:06 +0000)]
Clang-format: parse for and while loops

Summary: Adds support for formatting for and while loops.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D174

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

11 years agoIndentation fixes for clang-format.
Daniel Jasper [Wed, 5 Dec 2012 14:57:28 +0000 (14:57 +0000)]
Indentation fixes for clang-format.

- Fix behavior of memoization together with optimization
- Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did
  not count towards the inner level)
- Recognize more tokens as assignments

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

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

11 years agoFollow-up to r169286, addresses comments in http://llvm-reviews.chandlerc.com/D164...
Alexander Kornienko [Wed, 5 Dec 2012 13:56:52 +0000 (13:56 +0000)]
Follow-up to r169286, addresses comments in http://llvm-reviews.chandlerc.com/D164#comment-4 : comments and a method rename

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

11 years agoReuse an existing diagnostic for tsan/msan needing -pie error.
Evgeniy Stepanov [Wed, 5 Dec 2012 13:37:12 +0000 (13:37 +0000)]
Reuse an existing diagnostic for tsan/msan needing -pie error.
Add a diagnosting for -fsanitize=memory conflicting with other sanitizers.
Extend tests.

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

11 years agotest/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions...
NAKAMURA Takumi [Wed, 5 Dec 2012 11:52:45 +0000 (11:52 +0000)]
test/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions, for now.

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

11 years agoIn C++, if we hit an error in the class-head, don't try to parse the class body.
Richard Smith [Wed, 5 Dec 2012 11:34:06 +0000 (11:34 +0000)]
In C++, if we hit an error in the class-head, don't try to parse the class body.
Our error recovery path may have made the class anonymous, and that has a pretty
disastrous impact on any attempt to parse a class body containing constructors.

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

11 years agoPR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
Richard Smith [Wed, 5 Dec 2012 11:04:55 +0000 (11:04 +0000)]
PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
the LHS of a token paste. Use "expanded from here" instead when we're not sure
it's actually a macro.

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

11 years agoMinor reorganization. No functionality change.
Richard Smith [Wed, 5 Dec 2012 09:47:49 +0000 (09:47 +0000)]
Minor reorganization. No functionality change.

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

11 years agoAdd missing virtual destructors reported by -Wnon-virtual-dtor.
Daniel Jasper [Wed, 5 Dec 2012 09:23:48 +0000 (09:23 +0000)]
Add missing virtual destructors reported by -Wnon-virtual-dtor.

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

11 years agoSmall tweaks to automatic formatting.
Daniel Jasper [Wed, 5 Dec 2012 07:51:39 +0000 (07:51 +0000)]
Small tweaks to automatic formatting.

Recognize '!=' as a binary operator and assume that there are no
type definitions on the RHS of an assignment.

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

11 years agoSimplify slightly by seperating out the responsibility for emission of a caret
Richard Smith [Wed, 5 Dec 2012 06:20:58 +0000 (06:20 +0000)]
Simplify slightly by seperating out the responsibility for emission of a caret
diagnostic from the emission of macro backtraces. Incidentally, we now get the
displayed source location for a diagnostic and the location for the caret from
the same place, rather than computing them separately. No functionality change.

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

11 years agoThis test used to fail forever if it failed once, because it does not clean up after...
Richard Smith [Wed, 5 Dec 2012 06:16:54 +0000 (06:16 +0000)]
This test used to fail forever if it failed once, because it does not clean up after itself if it failed.

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

11 years agoDriver.cpp: Restore clang/Config/config.h to be included at last not to prevent llvm...
NAKAMURA Takumi [Wed, 5 Dec 2012 04:56:27 +0000 (04:56 +0000)]
Driver.cpp: Restore clang/Config/config.h to be included at last not to prevent llvm-config.h.

Or "llvm/Support/system_error.h" could not be compiled on mingw.

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

11 years agoSimplify diagnostic emission. No functionality change intended.
Richard Smith [Wed, 5 Dec 2012 03:18:16 +0000 (03:18 +0000)]
Simplify diagnostic emission. No functionality change intended.

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

11 years agoThread-safety analysis: check locks on method calls, operator=, and
DeLesley Hutchins [Wed, 5 Dec 2012 01:20:45 +0000 (01:20 +0000)]
Thread-safety analysis: check locks on method calls, operator=, and
copy constructors.

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

11 years ago[analyzer] Implement an opt-in variant of direct ivar assignment.
Anna Zaks [Wed, 5 Dec 2012 01:14:37 +0000 (01:14 +0000)]
[analyzer] Implement an opt-in variant of direct ivar assignment.

This will only check the direct ivar assignments in the annotated
methods.

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

11 years agoThread Safety Analysis: refactor to make more methods accept const pointers,
DeLesley Hutchins [Wed, 5 Dec 2012 00:52:33 +0000 (00:52 +0000)]
Thread Safety Analysis: refactor to make more methods accept const pointers,
adjust checkAccess.  No change in functionality.

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

11 years agoTesting C++ declarations embedded in
Fariborz Jahanian [Wed, 5 Dec 2012 00:38:44 +0000 (00:38 +0000)]
Testing C++ declarations embedded in
<declaration> tag of Comment XML and
added support for friend declaration printing.
This is wip. // rdar://12378714

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

11 years agoThread safety analysis: Add a new "beta" warning flag: -Wthread-safety-beta.
DeLesley Hutchins [Wed, 5 Dec 2012 00:06:15 +0000 (00:06 +0000)]
Thread safety analysis: Add a new "beta" warning flag: -Wthread-safety-beta.
As the analysis improves, it will continue to add new warnings that are
potentially disruptive to existing users.  From now on, such warnings will
first be introduced under the "beta" flag.  Such warnings are not turned on by
default; their purpose is to allow users to test their code against future
planned changes, before those changes are actually made.  After a suitable
migration period, beta warnings will be folded into the standard
-Wthread-safety.

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

11 years agoAdd -whole-archive around the ASan runtime archive in the link command.
Chandler Carruth [Tue, 4 Dec 2012 22:54:37 +0000 (22:54 +0000)]
Add -whole-archive around the ASan runtime archive in the link command.

This ensures that even though it comes first, we pick up its .o files.
Note that if we can use this (or something similar / equivalent) on
other platforms, we could potentially remove
ReplaceOperatorsNewAndDelete from the ASan runtimes.

We should probably do something similar for TSan and MSan as well.

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

11 years agoAlphabetize source files, just like they have been before.
Ted Kremenek [Tue, 4 Dec 2012 22:17:32 +0000 (22:17 +0000)]
Alphabetize source files, just like they have been before.

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

11 years agoUse the 'count' attribute to calculate the upper bound of an array.
Bill Wendling [Tue, 4 Dec 2012 21:33:58 +0000 (21:33 +0000)]
Use the 'count' attribute to calculate the upper bound of an array.

The count attribute is more accurate with regards to the size of an array. It
also obviates the upper bound attribute in the subrange. We can also better
handle an unbound array by setting the count to -1 instead of the lower bound to
1 and upper bound to 0.

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

11 years agoCurrently, with -fsanitize=address, the driver appends libclang_rt.asan.a to
Matt Beaumont-Gay [Tue, 4 Dec 2012 21:18:26 +0000 (21:18 +0000)]
Currently, with -fsanitize=address, the driver appends libclang_rt.asan.a to
the link command. This all works fine when the driver is also responsible for
adding -lstdc++ to the link command. But, if -lstdc++ (or libstdc++.a, etc) is
passed explicitly to the driver, the ASan runtime will appear in the link
command after the standard library, leading to multiple-definition errors for
the global 'operator new' and 'operator delete'. Fix this in a painfully
simple way, by inserting libclang_rt.asan.a at the start of the link command
instead of the end.

If we need to do something more clever, we can walk the link command looking
for something that resembles libstdc++ and insert libclang_rt.asan.a as late
as possible, but the simple solution works for now.

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

11 years agoTesting C declarations embedded in
Fariborz Jahanian [Tue, 4 Dec 2012 21:15:23 +0000 (21:15 +0000)]
Testing C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing block literal printout as result of the testing.
// rdar://12378714

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

11 years agoAdd missing destructors found with -Wnon-virtual-dtor.
Daniel Jasper [Tue, 4 Dec 2012 21:05:31 +0000 (21:05 +0000)]
Add missing destructors found with -Wnon-virtual-dtor.

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

11 years agoAdapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClient
Eli Bendersky [Tue, 4 Dec 2012 18:38:10 +0000 (18:38 +0000)]
Adapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClient
in the triple.

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

11 years agoadditional test for declaration tag of a class extension.
Fariborz Jahanian [Tue, 4 Dec 2012 18:25:34 +0000 (18:25 +0000)]
additional test for declaration tag of a class extension.
// rdar://12378714

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

11 years agoError recovery part 2
Alexander Kornienko [Tue, 4 Dec 2012 17:27:50 +0000 (17:27 +0000)]
Error recovery part 2

Summary: Adds recovery for structural errors in clang-format.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, silvas
Differential Revision: http://llvm-reviews.chandlerc.com/D164

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

11 years agoobjective-c blocks: Consider padding due to alignment
Fariborz Jahanian [Tue, 4 Dec 2012 17:20:57 +0000 (17:20 +0000)]
objective-c blocks: Consider padding due to alignment
after the fixed size block header when generating
captured block variable info. // rdar://12773256

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

11 years agoClang-format error recovery part 1
Alexander Kornienko [Tue, 4 Dec 2012 15:40:36 +0000 (15:40 +0000)]
Clang-format error recovery part 1

Reviewers: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D163

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

11 years agoc-index-test.c: Make C89-compliant.
NAKAMURA Takumi [Tue, 4 Dec 2012 15:32:03 +0000 (15:32 +0000)]
c-index-test.c: Make C89-compliant.

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

11 years agolibclang: Add a function to libclang for retrieving the bit width value
Dmitri Gribenko [Tue, 4 Dec 2012 15:13:46 +0000 (15:13 +0000)]
libclang: Add a function to libclang for retrieving the bit width value

Patch by Jyun-Yan You.

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

11 years agoMake parenthesis counting and aligning a bit saner.
Daniel Jasper [Tue, 4 Dec 2012 14:54:30 +0000 (14:54 +0000)]
Make parenthesis counting and aligning a bit saner.

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

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

11 years agoEnum formatting implementation
Alexander Kornienko [Tue, 4 Dec 2012 14:46:19 +0000 (14:46 +0000)]
Enum formatting implementation

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D161

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

11 years agoFix spelling I ran over while proof-reading tests.
Manuel Klimek [Tue, 4 Dec 2012 14:42:08 +0000 (14:42 +0000)]
Fix spelling I ran over while proof-reading tests.

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

11 years agoToolChains.cpp: Fixup r169260, clang/Config/config.h needs to be listed *last*, or...
NAKAMURA Takumi [Tue, 4 Dec 2012 14:31:59 +0000 (14:31 +0000)]
ToolChains.cpp: Fixup r169260, clang/Config/config.h needs to be listed *last*, or llvm/Config/llvm-config.h could not be read in header files.

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

11 years agoFixes crash in isDerivedFrom for recursive templates.
Manuel Klimek [Tue, 4 Dec 2012 13:40:29 +0000 (13:40 +0000)]
Fixes crash in isDerivedFrom for recursive templates.

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

11 years agoSmall fixes to unary operator recognition and handling of include
Daniel Jasper [Tue, 4 Dec 2012 13:02:32 +0000 (13:02 +0000)]
Small fixes to unary operator recognition and handling of include
directives.

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

11 years agoAutotools has the same include guard for both Clang and LLVM's config.h.
Chandler Carruth [Tue, 4 Dec 2012 12:24:59 +0000 (12:24 +0000)]
Autotools has the same include guard for both Clang and LLVM's config.h.
Shuffling order causes the wrong one to win.

CMake didn't exhibit this problem because Clang's has *no* guards.

I'll fix this properly tomorrow when Eric and I can check both build
systems and get them to DTRT, but for now unbreak some bots by hoisting
this header.

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

11 years agoUpdate matcher documentation with script.
Daniel Jasper [Tue, 4 Dec 2012 12:08:08 +0000 (12:08 +0000)]
Update matcher documentation with script.

We still need to make the python script understand some of the new
matchers, but this should be an improvement.

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

11 years agoAdd parameterCountIs() matcher.
Daniel Jasper [Tue, 4 Dec 2012 11:54:27 +0000 (11:54 +0000)]
Add parameterCountIs() matcher.

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

11 years agoReplace workarounds with correct fixes.
Daniel Jasper [Tue, 4 Dec 2012 10:50:12 +0000 (10:50 +0000)]
Replace workarounds with correct fixes.

Also fix header guard.

http://llvm-reviews.chandlerc.com/D159

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

11 years agoSort the #include lines under utils/...
Chandler Carruth [Tue, 4 Dec 2012 09:53:39 +0000 (09:53 +0000)]
Sort the #include lines under utils/...

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

11 years agoReally sort the #include lines in unittests/...
Chandler Carruth [Tue, 4 Dec 2012 09:53:37 +0000 (09:53 +0000)]
Really sort the #include lines in unittests/...

I forgot to re-sort after fixing main module headers.

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

11 years agoSort the #include lines for unittests/...
Chandler Carruth [Tue, 4 Dec 2012 09:45:34 +0000 (09:45 +0000)]
Sort the #include lines for unittests/...

I've tried to place sensible headers at the top as main-module headers.

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

11 years agoSort the #include lines for examples/...
Chandler Carruth [Tue, 4 Dec 2012 09:37:22 +0000 (09:37 +0000)]
Sort the #include lines for examples/...

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

11 years agoSort #include lines for tools/...
Chandler Carruth [Tue, 4 Dec 2012 09:25:21 +0000 (09:25 +0000)]
Sort #include lines for tools/...

Completely automated with sort_includes.py

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

11 years agoSort #include lines for all files under include/...
Chandler Carruth [Tue, 4 Dec 2012 09:18:49 +0000 (09:18 +0000)]
Sort #include lines for all files under include/...

This is a simpler sort, entirely automatic with the help of
llvm/utils/sort_includes.py -- no manual edits here.

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

11 years agoSort all of Clang's files under 'lib', and fix up the broken headers
Chandler Carruth [Tue, 4 Dec 2012 09:13:33 +0000 (09:13 +0000)]
Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

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

11 years agoASTTests, ASTMatchersTests: Move clangEdit before clangAst in USEDLIB.
NAKAMURA Takumi [Tue, 4 Dec 2012 08:20:41 +0000 (08:20 +0000)]
ASTTests, ASTMatchersTests: Move clangEdit before clangAst in USEDLIB.

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

11 years agoUntabify (in USEDLIBS, Makefile(s)).
NAKAMURA Takumi [Tue, 4 Dec 2012 08:20:35 +0000 (08:20 +0000)]
Untabify (in USEDLIBS, Makefile(s)).

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

11 years agoclang/Lex: [CMake] Update CMakefiles since r169229.
NAKAMURA Takumi [Tue, 4 Dec 2012 07:40:33 +0000 (07:40 +0000)]
clang/Lex: [CMake] Update CMakefiles since r169229.

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

11 years agoDon't test for ASM output but for IR output.
Bill Wendling [Tue, 4 Dec 2012 07:33:40 +0000 (07:33 +0000)]
Don't test for ASM output but for IR output.

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

11 years agoRefactor recording the preprocessor conditional directive regions out of
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:27:05 +0000 (07:27 +0000)]
Refactor recording the preprocessor conditional directive regions out of
PreprocessingRecord and into its own class, PPConditionalDirectiveRecord.

Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord
without needing a PreprocessingRecord.

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

11 years agoIn the PreprocessingRecord, to identify the different conditional directive regions
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:26:53 +0000 (07:26 +0000)]
In the PreprocessingRecord, to identify the different conditional directive regions
use the SourceLocation at the start of the respective region, instead of a unique integer.

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

11 years ago[libclang] Avoid copying the CompileCommand related strings when wrapping them to...
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:26:48 +0000 (07:26 +0000)]
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.

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

11 years agoIntroduce CompilationDatabase::getAllCompileCommands() that returns all
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:26:44 +0000 (07:26 +0000)]
Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

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

11 years agoclang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp: Add explicit triple, x86_64...
NAKAMURA Takumi [Tue, 4 Dec 2012 06:58:05 +0000 (06:58 +0000)]
clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp: Add explicit triple, x86_64-unknown-unknown. It was incompatible to i686.

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

11 years agoAdd a 'count' field to the DWARF subrange.
Bill Wendling [Tue, 4 Dec 2012 06:21:27 +0000 (06:21 +0000)]
Add a 'count' field to the DWARF subrange.

The count field is necessary because there isn't a difference between the 'lo'
and 'hi' attributes for a one-element array and a zero-element array. When the
count is '0', we know that this is a zero-element array. When it's >=1, then
it's a normal constant sized array. When it's -1, then the array is unbounded.

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

11 years agoDocument the existence of -fsanitize=bounds.
Richard Smith [Tue, 4 Dec 2012 02:48:16 +0000 (02:48 +0000)]
Document the existence of -fsanitize=bounds.

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

11 years agoclang/test/Index/comment-objc-decls.m: Try to fix r169193, to add x86_64-darwin.
NAKAMURA Takumi [Tue, 4 Dec 2012 01:03:31 +0000 (01:03 +0000)]
clang/test/Index/comment-objc-decls.m: Try to fix r169193, to add x86_64-darwin.

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

11 years agoTesting objective-C declarations embedded in
Fariborz Jahanian [Tue, 4 Dec 2012 00:47:33 +0000 (00:47 +0000)]
Testing objective-C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing declaration of ivars private to @implementation
as result of the testing. // rdar://12378714

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

11 years agoHave clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly modes...
Michael Ilseman [Tue, 4 Dec 2012 00:36:06 +0000 (00:36 +0000)]
Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly modes. Test cases included.

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

11 years agoremove trailing whitespace
Michael Ilseman [Tue, 4 Dec 2012 00:29:55 +0000 (00:29 +0000)]
remove trailing whitespace

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

11 years agoclang/test/Driver/fsanitize-blacklist.c: Mark it as XFAIL:cygming, due to PR12920.
NAKAMURA Takumi [Mon, 3 Dec 2012 23:29:49 +0000 (23:29 +0000)]
clang/test/Driver/fsanitize-blacklist.c: Mark it as XFAIL:cygming, due to PR12920.

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

11 years agoFix test failure when building Clang with g++4.7 -- don't use a Twine temporary
Richard Smith [Mon, 3 Dec 2012 22:39:14 +0000 (22:39 +0000)]
Fix test failure when building Clang with g++4.7 -- don't use a Twine temporary
after its lifetime has ended!

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

11 years agoFixes a compile warning and crash in the tests.
Manuel Klimek [Mon, 3 Dec 2012 20:55:42 +0000 (20:55 +0000)]
Fixes a compile warning and crash in the tests.

The necessity of this fix points to a problem with the design
of the addToken during the optimiation phase, which we need to address
in a much more principled way.

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

11 years agoAdd Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag...
Alexey Samsonov [Mon, 3 Dec 2012 19:12:58 +0000 (19:12 +0000)]
Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object.

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

11 years agolibclangFormat is not libclangTooling, but it depends on it.
Benjamin Kramer [Mon, 3 Dec 2012 18:28:52 +0000 (18:28 +0000)]
libclangFormat is not libclangTooling, but it depends on it.

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

11 years agoFix PR14474: don't emit debug info for interface types in -gline-tables-only mode.
Alexey Samsonov [Mon, 3 Dec 2012 18:28:12 +0000 (18:28 +0000)]
Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode.

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

11 years agoInitial version of formatting library.
Daniel Jasper [Mon, 3 Dec 2012 18:12:45 +0000 (18:12 +0000)]
Initial version of formatting library.

This formatting library will be used by a stand-alone clang-format tool
and can also be used when writing other refactorings.

Manuel's original design document:
https://docs.google.com/a/google.com/document/d/1gpckL2U_6QuU9YW2L1ABsc4Fcogn5UngKk7fE5dDOoA/edit

The library can already successfully format itself.

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

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

11 years agoMake hasDeclaration work for enums.
Daniel Jasper [Mon, 3 Dec 2012 15:43:25 +0000 (15:43 +0000)]
Make hasDeclaration work for enums.

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

11 years agoAdd -fsanitize=memory.
Evgeniy Stepanov [Mon, 3 Dec 2012 13:20:43 +0000 (13:20 +0000)]
Add -fsanitize=memory.

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

11 years ago[ubsan] Add flag to enable recovery from checks when possible.
Will Dietz [Sun, 2 Dec 2012 19:50:33 +0000 (19:50 +0000)]
[ubsan] Add flag to enable recovery from checks when possible.

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

11 years agoMake helper classes anonymous. Make helper functions static instead of private member...
Benjamin Kramer [Sat, 1 Dec 2012 20:58:01 +0000 (20:58 +0000)]
Make helper classes anonymous. Make helper functions static instead of private members so the anonymous class doesn't leak out.

No functionality change.

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

11 years ago[MIPS] Add -mxgot/-mno-xgot command line options
Simon Atanasyan [Sat, 1 Dec 2012 18:27:21 +0000 (18:27 +0000)]
[MIPS] Add -mxgot/-mno-xgot command line options
to enable/disable support of GOT larger than 64k.

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

11 years agoAdd raw_ostream include to pacify MSVC.
Benjamin Kramer [Sat, 1 Dec 2012 17:54:07 +0000 (17:54 +0000)]
Add raw_ostream include to pacify MSVC.

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

11 years agoUpdate unit tests not to rely on transitive includes.
Benjamin Kramer [Sat, 1 Dec 2012 17:22:05 +0000 (17:22 +0000)]
Update unit tests not to rely on transitive includes.

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

11 years agoInclude pruning and general cleanup.
Benjamin Kramer [Sat, 1 Dec 2012 17:12:56 +0000 (17:12 +0000)]
Include pruning and general cleanup.

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

11 years agoDon't include Type.h in DeclarationName.h.
Benjamin Kramer [Sat, 1 Dec 2012 16:35:25 +0000 (16:35 +0000)]
Don't include Type.h in DeclarationName.h.

Recursively prune some includes.

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

11 years agoMake ASTVector.h standalone without including all of ASTContext.
Benjamin Kramer [Sat, 1 Dec 2012 15:18:03 +0000 (15:18 +0000)]
Make ASTVector.h standalone without including all of ASTContext.

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

11 years agoPull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull...
Benjamin Kramer [Sat, 1 Dec 2012 15:09:41 +0000 (15:09 +0000)]
Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code.

Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.

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

11 years agoFix a test that was redefining FileCheck variables while referencing old ones.
Eli Bendersky [Sat, 1 Dec 2012 13:50:51 +0000 (13:50 +0000)]
Fix a test that was redefining FileCheck variables while referencing old ones.

In preparation for the FileCheck enhancement to support backreferences.

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

11 years agoSwitch to using -### as mentioned by chandlerc.
Joey Gouly [Sat, 1 Dec 2012 13:07:22 +0000 (13:07 +0000)]
Switch to using -### as mentioned by chandlerc.

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

11 years agoAdd -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approv...
Joey Gouly [Sat, 1 Dec 2012 12:15:28 +0000 (12:15 +0000)]
Add -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approved by d0k.

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

11 years agoAdd .arcconfig to the repository. Useful if someone wants to use phabricator's comman...
Benjamin Kramer [Sat, 1 Dec 2012 12:08:08 +0000 (12:08 +0000)]
Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.

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

11 years agoFix a typo in comment.
Michael Han [Sat, 1 Dec 2012 04:35:48 +0000 (04:35 +0000)]
Fix a typo in comment.

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

11 years agoMake these functions more clearly express the test they are performing. No functional...
Richard Smith [Sat, 1 Dec 2012 03:15:03 +0000 (03:15 +0000)]
Make these functions more clearly express the test they are performing. No functionality change.

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

11 years agoConsistently use 'needsImplicit<special member>' to determine whether we need
Richard Smith [Sat, 1 Dec 2012 02:35:44 +0000 (02:35 +0000)]
Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.

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

11 years agoTry to make the source location information for token pastes a bit more consistent.
Eli Friedman [Sat, 1 Dec 2012 01:15:54 +0000 (01:15 +0000)]
Try to make the source location information for token pastes a bit more consistent.

Fixes a crash printing diagnostics on the gcc testsuite, and also makes
diagnostic range printing print nicer results for token pastes.

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

11 years agoRemove restriction on combining ubsan with asan or tsan. This has worked for a while.
Richard Smith [Sat, 1 Dec 2012 01:02:45 +0000 (01:02 +0000)]
Remove restriction on combining ubsan with asan or tsan. This has worked for a while.

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

11 years agoFix the determination of whether a capture refers to an enclosing
Douglas Gregor [Sat, 1 Dec 2012 01:01:09 +0000 (01:01 +0000)]
Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.

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

11 years agoDon't emit a warning with an input/output parameter. We assume the user knows what...
Bill Wendling [Fri, 30 Nov 2012 23:46:56 +0000 (23:46 +0000)]
Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.

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

11 years agoFix test for Windows path separators
Douglas Gregor [Fri, 30 Nov 2012 23:40:49 +0000 (23:40 +0000)]
Fix test for Windows path separators

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

11 years agoTeach the serialized diagnostic writer to clone() itself, sharing
Douglas Gregor [Fri, 30 Nov 2012 23:32:31 +0000 (23:32 +0000)]
Teach the serialized diagnostic writer to clone() itself, sharing
state so that all of the various clones end up rendering their
diagnostics into the same serialized-diagnostics file. This is
important when we actually want failures during module build to be
reported back to the translation unit that tried to import the
not-yet-built or out-of-date module. <rdar://problem/12565727>

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

11 years agoDon't warn if the input size is less than the register size. Also don't warn if
Bill Wendling [Fri, 30 Nov 2012 23:18:12 +0000 (23:18 +0000)]
Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.

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

11 years agoMake -Wtautological-constant-out-of-range-compare behave sanely for enums with a...
Eli Friedman [Fri, 30 Nov 2012 23:09:29 +0000 (23:09 +0000)]
Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.

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

11 years agoRename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!
Douglas Gregor [Fri, 30 Nov 2012 22:11:57 +0000 (22:11 +0000)]
Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!

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