Commit Graph

44003 Commits

Author SHA1 Message Date
Dmitri Gribenko 15225aee17 Driver: add support for new style multiarch in Ubuntu 13.04
Patch by Sanne Wouda.

llvm-svn: 176557
2013-03-06 17:14:05 +00:00
Edwin Vane 0a4836ed0e New ASTMatchers and enhancement to hasOverloadedOperatorName
Added two new narrowing matchers:
* hasMethod: aplies a matcher to a CXXRecordDecl's methods until a match is made
  or there are no more methods.
* hasCanonicalType: applies a matcher to a QualType's canonicalType.

Enhanced hasOverloadedOperatorName to work on CXXMethodDecl as well as
CXXOperatorCallExpr.

Updated tests and docs.

Reviewers: klimek, gribozavr
llvm-svn: 176556
2013-03-06 17:02:57 +00:00
Alexey Samsonov a1c0a2a2c6 [Sanitize] Don't emit function attribute sanitize_address/thread/memory if the function is blacklisted.
llvm-svn: 176550
2013-03-06 10:54:18 +00:00
Weiming Zhao ff2a3ad81b revert r176531 due to clan-native-arm fails
llvm-svn: 176544
2013-03-06 02:08:54 +00:00
Richard Smith 5afcdf3f1c PR15390: If a function returns a pointer to a function, that function type
can't have default arguments even though it's a parameter-declaration-clause in
a function declaration.

llvm-svn: 176542
2013-03-06 01:37:38 +00:00
Richard Smith 7b24254e91 After issuing a diagnostic for undefining or redefining a builtin macro,
continue parsing the directive rather than silently discarding it.

Allowing undef or redef of __TIME__ and __DATE__ is important to folks
who want stable, reproducible builds.

llvm-svn: 176540
2013-03-06 00:46:00 +00:00
Fariborz Jahanian 47ef466b0f objective-C: don't crash after diagnosing
using object subscripting without declaring objectForKeyedSubscript:
// rdar://13333205

llvm-svn: 176539
2013-03-06 00:37:40 +00:00
Douglas Gregor 551eedbd27 Remove unused static variable.
llvm-svn: 176535
2013-03-05 23:59:13 +00:00
Jordan Rose 67b66231a8 Preprocessor: don't keep comments under -traditional-cpp.
This patch is designed for minimal intrusion into normal preprocessing
and compilation; under -E -traditional-cpp, the lexer will still
generate tok::comment nodes since it is preserving all whitespace, but
the output printer will then throw it away.

<rdar://problem/13338680>

llvm-svn: 176534
2013-03-05 23:54:55 +00:00
Weiming Zhao a35cc6fb6b PR 11326: Lack diagnosic message when ABI conflicts on ARM
When both Triple and -mabi are used, it may result into conflicting ABI value.

llvm-svn: 176531
2013-03-05 23:27:21 +00:00
Fariborz Jahanian a668bf548d fix a missing check in my last patch.
// rdar://13094352

llvm-svn: 176529
2013-03-05 23:20:29 +00:00
Jordan Rose 864b810739 Preprocessor: don't consider // to be a line comment in -E -std=c89 mode.
It's beneficial when compiling to treat // as the start of a line
comment even in -std=c89 mode, since it's not valid C code (with a few
rare exceptions) and is usually intended as such. We emit a pedantic
warning and then continue on as if line comments were enabled.
This has been our behavior for quite some time.

However, people use the preprocessor for things besides C source files.
In today's prompting example, the input contains (unquoted) URLs, which
contain // but should still be preserved.

This change instructs the lexer to treat // as a plain token if Clang is
in C90 mode and generating preprocessed output rather than actually compiling.

<rdar://problem/13338743>

llvm-svn: 176526
2013-03-05 22:51:04 +00:00
Fariborz Jahanian 56fe4066e5 doc. parsing. Improve on diagnostics on my last patch.
// rdar://13094352.

llvm-svn: 176525
2013-03-05 22:46:07 +00:00
Richard Smith 115314926d Remove outdated claim that GCC builds without a C++ compiler from compilers comparison.
llvm-svn: 176515
2013-03-05 21:49:52 +00:00
Lang Hames 224ae88bc3 Use ASTContext::getDeclAlign(<Field Decl>) to get the alignment of the first
field to be memcpy'd, rather instead of ASTContext::getTypeAlign(<Field Type>).
For packed structs the alignment of a field may be less than the alignment of
the field's type.

<rdar://problem/13338585>

llvm-svn: 176512
2013-03-05 20:27:24 +00:00
Argyrios Kyrtzidis 37f2ab4824 [libclang] When logging a CXTranslationUnit that came from an AST file, print out the filename.
llvm-svn: 176511
2013-03-05 20:21:14 +00:00
Fariborz Jahanian 43c8df8153 Fix this checkin.
llvm-svn: 176510
2013-03-05 19:52:24 +00:00
Fariborz Jahanian f4ba35d809 doc parsing. Add @method and @callback for
checkings and few other refactoring/cleanup.
// rdar://13094352.

llvm-svn: 176509
2013-03-05 19:40:47 +00:00
Jack Carter beaccddcba Mips specific inline assembler constraint 'R'
'R' An address that can be sued in a non-macro load or store.

Including missing positive test case and fixed typo for r176453.

Thanks to Richard Smith for catching this!

Jack

llvm-svn: 176506
2013-03-05 19:10:54 +00:00
Edwin Vane eec9a93262 Make LibASTMatchersTutorial code match text
Fixed code to match text. Slight adjustment for readability.

Author: Béatrice Creusillet
llvm-svn: 176493
2013-03-05 18:04:37 +00:00
Dmitri Gribenko 68a0668453 Documentation: use code highlighting
llvm-svn: 176480
2013-03-05 13:05:56 +00:00
David Chisnall 87aeeecc65 Add a test that we are passing the -fobjc-default-synthesize flag for Apple and
non-Apple platforms.

llvm-svn: 176477
2013-03-05 11:20:04 +00:00
Richard Smith 49af629057 Don't emit calls to virtual [[noreturn]] functions as noreturn; overrides of a
[[noreturn]] function are not required to also be [[noreturn]]. We still emit
calls to virtual __attribute__((noreturn)) functions as noreturn; unlike GCC,
we do require overriders to also be noreturn for that attribute.

llvm-svn: 176476
2013-03-05 08:30:04 +00:00
David Blaikie e750491ff3 Add quotation marks to template names in diagnostics.
llvm-svn: 176474
2013-03-05 06:21:38 +00:00
Jordan Rose 838b72f6b5 scan-build: explicitly say "No bugs found" if there are no reports.
Patch by Martin Storsjo!

llvm-svn: 176472
2013-03-05 02:33:08 +00:00
Jordan Rose d03d99da16 Silence a number of static analyzer warnings with assertions and such.
No functionality change.

llvm-svn: 176469
2013-03-05 01:27:54 +00:00
Fariborz Jahanian 8a7a59226d doc parsing. We want to issue a strong warning when
an @function comment is not followed by a function decl.
// rdar://13094352

llvm-svn: 176468
2013-03-05 01:05:07 +00:00
Jordan Rose 85707b28e8 [analyzer] Don't let cf_audited_transfer override CFRetain semantics.
We weren't treating a cf_audited_transfer CFRetain as returning +1 because
its name doesn't contain "Create" or "Copy". Oops! Fortunately, the
standard definitions of these functions are not marked audited.

<rdar://problem/13339601>

llvm-svn: 176463
2013-03-04 23:21:32 +00:00
Dmitri Gribenko bcf7f4d3bb Comment parsing: refactor handling of command markers in AST
* Use the term 'command marker', because the semantics of 'backslash' and 'at'
  commands are the same.  (Talking about 'at commands' makes them look like a
  special entity.)

* Sink the flag down into bitfields, reducing the size of AST nodes.

* Change the flag into an enum for clarity.  Boolean function parameters are
  not very clear.

* Add unittests for new tok::at_command tokens.

llvm-svn: 176461
2013-03-04 23:06:15 +00:00
Bob Wilson 743bf67caf Add ARM v6m, v7m, and v7em architectures for Cortex-M series processors.
<rdar://problem/11314476>

llvm-svn: 176458
2013-03-04 22:37:49 +00:00
Bob Wilson f643afcd31 Tidy up lists of Cortex-A series processors, adding entries for A7.
Also fix a missing entry for cortex-r5 in one copy of getLLVMArchSuffixForARM.

llvm-svn: 176457
2013-03-04 22:37:46 +00:00
Bob Wilson 872f04d19d Fix confused use of llvm::StringSwitch for armv7r architecture.
svn 170909 added support for cortex-r5 but in this case it was done
incorrectly. The last argument to StringSwitch.Cases() is the replacement
value, so by adding "cortex-r5" it changed the default cpu for armv7r to
cortex-r5 instead of cortex-r4.

llvm-svn: 176456
2013-03-04 22:37:43 +00:00
Jack Carter 427b404d0a Mips specific inline assembler constraint 'R'
'R' An address that can be sued in a non-macro load or store.
This patch includes a positive test case.

llvm-svn: 176453
2013-03-04 21:36:11 +00:00
Argyrios Kyrtzidis 2a513e8218 [PCH] In HeaderFileInfoTrait::EqualKey(), use FileManager::getFile() to compare two filenames, instead of llvm::sys::fs::equivalent().
llvm::sys::fs::equivalent() does 2 stat calls every time it's called. Use FileManager::getFile() to take advantage
of the stat caching that FileManager is providing.

llvm-svn: 176450
2013-03-04 20:33:40 +00:00
Dmitri Gribenko 05e22f2ef0 Comment parsing tests: move a test into a group of similar tests
llvm-svn: 176449
2013-03-04 20:23:16 +00:00
Fariborz Jahanian c551ecc8f0 [comment parsing] source fidelity for tparam command too.
// rdar://13066276

llvm-svn: 176448
2013-03-04 20:08:47 +00:00
Manuel Klimek abf6e03bc1 Make sure to not split string literals at the first character.
llvm-svn: 176447
2013-03-04 20:03:38 +00:00
Dmitri Gribenko fd5ef42830 warn-documentation.cpp: reorganize tests
Tests are ordered by command in this file.  It is nice to keep it that way.

llvm-svn: 176445
2013-03-04 19:39:33 +00:00
Fariborz Jahanian 5f2a813d2a comment parsing. Missed a case of referring
to original command in diagnostic. // rdar://13066276

llvm-svn: 176444
2013-03-04 18:53:41 +00:00
Edwin Vane 6972f6d3c7 hasQualifer() matcher should return false if there's no qualifier
Instead of passing NULL on to sub-matcher, just return false. Updated tests and
regenerated docs.

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
llvm-svn: 176441
2013-03-04 17:51:00 +00:00
Tom Stellard c74b1e054c R600: Use the GPU type to determine the correct DataLayout v2
v2:
  - Add R600_DOUBLE_OPS for RV670
  - s/CPU/GPU/

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
llvm-svn: 176440
2013-03-04 17:40:53 +00:00
Daniel Jasper 973c9420e1 Format a line if a range in its leading whitespace was selected.
With [] marking the selected range, clang-format invoked on

    [  ]   int a;

Would so far not reformat anything. With this patch, it formats a
line if its leading whitespace is touched.

llvm-svn: 176435
2013-03-04 13:43:19 +00:00
Manuel Klimek 3de6d3a2a0 Make the tutorial easier to compile by adding in some of the details.
Patch by Béatrice Creusillet.

llvm-svn: 176434
2013-03-04 11:31:46 +00:00
John McCall 02ba35092b Correction to r176432: the bug actually fixed was <rdar://13025708>.
llvm-svn: 176433
2013-03-04 07:35:41 +00:00
John McCall cc5788c5ce Centralize and refine the __unknown_anytype argument rules
and be sure to apply them whether or not the debugger gave
us a method declaration.

rdar://12565338

llvm-svn: 176432
2013-03-04 07:34:02 +00:00
John McCall a37c2fa409 Fix the emission of the copy-initialization of a block capture
from a lambda capture when the capture is not trivially-copyable.

rdar://13295759

llvm-svn: 176431
2013-03-04 06:32:36 +00:00
Chandler Carruth 58d6eb6d03 Check for warnings in a bunch of the linker invocations, and add one
with both -static-libgcc and -static on the commandline.

Fix a warning in the latter case due to a backwards short circuiting ||
operator in the driver. No real functionality changed here, just allows
the driver to properly consume -static-libgcc when -static is also
specified.

llvm-svn: 176429
2013-03-04 02:07:55 +00:00
John McCall f22d0acfac Perform non-overload placeholder conversions on the operands
to a subscript operator.

rdar://13332183

llvm-svn: 176428
2013-03-04 01:30:55 +00:00
Chandler Carruth 4588e349b0 Beef up the testing of our 'ld' invocation on linux to cover static
linking. About to fix a bug here and there was no good test case.

llvm-svn: 176427
2013-03-04 01:27:49 +00:00
Dmitri Gribenko 80bfa95d5b Add an idea for a cpp11-migrate tool: TR1 migration
Idea by Marshall Clow.

llvm-svn: 176423
2013-03-03 17:54:36 +00:00