Commit Graph

50301 Commits

Author SHA1 Message Date
Simon Atanasyan 26292ccc91 [Mips] Fix __mips macro definition.
llvm-svn: 200223
2014-01-27 13:59:11 +00:00
Simon Atanasyan 1a3665b676 [Mips] Change default CPU for MIPS 32/64 targets. Now they are mips32r2/mips64r2 respectively.
llvm-svn: 200222
2014-01-27 13:59:04 +00:00
Simon Atanasyan 682b49b9ef [Mips] Add tests to check MIPS arch macros.
llvm-svn: 200221
2014-01-27 13:58:54 +00:00
Alp Toker 0d865d3d7b Roll back the use of ConstStringRef for now
We might want try a different strategy so hold back on this for the moment, but
fix the off-by-one error in the original function template.

This reverts commit r200190.

llvm-svn: 200193
2014-01-27 05:21:24 +00:00
Alp Toker a80501742c Use ConstStringRef facility for getCustomDiagID() safety
This is one of various functions in clang that don't handle arbitrary strings
well and can benefit from compile-time safety checks.

Also fixes an off-by-one error that caused one additional null byte to get
added to the end of custom diagnostic descriptions. ConstStringRef handles
tricky details like that for us now.

Requires supporting changes in LLVM r200187.

llvm-svn: 200190
2014-01-27 04:22:22 +00:00
Richard Smith 6a6a4bbdd4 PR17052 / DR1560 (+DR1550): In a conditional expression between a glvalue and a
throw-expression, the result is also a glvalue and isn't unnecessarily coerced
to a prvalue.

llvm-svn: 200189
2014-01-27 04:19:56 +00:00
Evan Cheng 31dd9a6cc1 Fix r195149. Triple should correctly reflect that target. If it contains ios,
e.g. thumbv7m-apple-ios3.0.0-eabi, then it should mean it's an iOS target. For
embedded targets, the OS should be unknown, e.g. thumbv7m-apple-unknown-macho.
Since Tim has recently fixed the triple, r195149 is no longer needed.
rdar://15911035

llvm-svn: 200164
2014-01-26 23:12:43 +00:00
Joerg Sonnenberger f19dc30518 Use canonical spelling of NetBSD
llvm-svn: 200157
2014-01-26 20:02:03 +00:00
NAKAMURA Takumi d51b0aad70 clang-check: Unittests doesn't requires tools.
llvm-svn: 200147
2014-01-26 12:35:07 +00:00
NAKAMURA Takumi b80df40b1d check-clang doesn't require neither llvm_src_root nor llvm_obj_root.
llvm-svn: 200146
2014-01-26 12:35:00 +00:00
NAKAMURA Takumi 36ec246114 Revert r113780, "Recognize .ll as input files. Handle %test_debuginfo on a RUN command line."
This feature has been unused anymore.

llvm-svn: 200145
2014-01-26 12:34:54 +00:00
NAKAMURA Takumi 1a309679b8 [CMake] Always set CMAKE_INCLUDE_CURRENT_DIR.
llvm-svn: 200144
2014-01-26 12:34:48 +00:00
NAKAMURA Takumi 4080a2097b [CMake][Standalone] Introduce check-all.
llvm-svn: 200143
2014-01-26 12:34:38 +00:00
Alp Toker 14c8aff1aa Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert
llvm-svn: 200140
2014-01-26 08:12:32 +00:00
Alp Toker 9e6d27d037 Update docstrings following the param name change in r200132
llvm-svn: 200137
2014-01-26 06:41:58 +00:00
Rafael Espindola d51906e5b3 Update for llvm api change.
llvm-svn: 200136
2014-01-26 06:39:14 +00:00
NAKAMURA Takumi 6a326249f8 [CMake] Reindent.
llvm-svn: 200133
2014-01-26 06:18:06 +00:00
Alp Toker 29cb66ba2f Enforce safe usage of DiagnosticsEngine::getCustomDiagID()
Replace the last incorrect uses and templatize the function to require a
compile-time constant string preventing further misuse.

The diagnostic formatter expects well-formed input and has undefined behaviour
with arbitrary input or crafted user strings in source files. Accepting user
input would also have caused unbounded generation of new diagnostic IDs which
can be problematic in long-running sessions or language bindings.

This completes the work to fix several incorrect callers that passed user
input or raw messages to the diagnostics engine where a constant format string
was expected.

llvm-svn: 200132
2014-01-26 06:17:37 +00:00
Alp Toker 046cda538c Identify two more unsafe uses of getCustomDiagID()
llvm-svn: 200126
2014-01-26 05:08:49 +00:00
Alp Toker 4af8fa9ae4 Remove buggy example code from the documentation
Instead point readers to the latest, correct example code in SVN until we find
a way to automatically include example sources into the documentation (or until
someone steps up to maintain these actively).

This ensures that the examples are up-to-date, buildable, and most of all that
readers don't pick up incorrect usage.

llvm-svn: 200125
2014-01-26 05:08:07 +00:00
Alp Toker 42aa21222d ARCMigrate: Introduce proper diagnostics for TransformActions
This starts to switch ARCMT to use proper diagnostic messages. The old use was
based on incorrect example code from the documentation.

The logic of the previous report() functions has been retained to support any
external consumers that might be intercepting diagnostic messages through the
old interface.

Note that the change in test/Misc/warning-flags.c isn't a new warning without a
flag, rather one that was previously invisible to the test. Adding a flag might
be a good idea though.

llvm-svn: 200124
2014-01-26 05:07:32 +00:00
Alp Toker 2652153904 Remove flawed diagnostic mapping functions
These haven't been usable since the early return was accidentally removed some
years ago causing all cases to fall through to the !Enabled condition.

llvm-svn: 200123
2014-01-26 05:07:02 +00:00
Jiangning Liu bb59b3daa9 For AArch64 Neon, fix intrinsics implementation using nested macros.
llvm-svn: 200114
2014-01-26 03:38:42 +00:00
Alp Toker 42a16a67f5 Rename getResultLoc() too
Follow up to r200082.

Spotted by Dmitri

llvm-svn: 200105
2014-01-25 23:51:36 +00:00
Richard Smith 72db563280 PR18530: Don't assert when performing error recovery after a missing 'template<>' on a variable template explicit specialization.
llvm-svn: 200099
2014-01-25 21:32:06 +00:00
Richard Smith f137f9317b PR18283: If a const variable of integral or enumeration type is
initialized from a constant expression in C++98, it can be used in
constant expressions, even if it was brace-initialized. Patch by
Rahul Jain!

llvm-svn: 200098
2014-01-25 20:50:08 +00:00
Saleem Abdulrasool 8a8454bc31 unittests: explicit stringify StringRefs for conversion
When clang is built outside of the LLVM tree (against a corresponding version),
there is no definition providing for operator<<(std::ostream &, StringRef) which
is required for the assertion routines in google-test tests.  Avoid the
compilation failure by explicitly stringifying the StringRef prior to use.

llvm-svn: 200096
2014-01-25 20:04:44 +00:00
Alp Toker 1f307f49ef Remove obsolete ObjCMethodDecl arg_type iterator functions
These were set into deprecation in r199773.

llvm-svn: 200086
2014-01-25 17:32:04 +00:00
Alp Toker 314cc81b8c Rename getResultType() on function and method declarations to getReturnType()
A return type is the declared or deduced part of the function type specified in
the declaration.

A result type is the (potentially adjusted) type of the value of an expression
that calls the function.

Rule of thumb:

  * Declarations have return types and parameters.
  * Expressions have result types and arguments.

llvm-svn: 200082
2014-01-25 16:55:45 +00:00
Simon Atanasyan 68855fe3c9 [Mips] Add support for mips64el-linux-android triple.
llvm-svn: 200081
2014-01-25 16:04:08 +00:00
Simon Atanasyan 264b29883f [Mips] Add test to check translation MIPS triples to cpu and float abi
options.

llvm-svn: 200080
2014-01-25 16:03:59 +00:00
Alp Toker 48047f5d75 PlistSupport: Eliminate duplicated EmitLocation() and EmitRange() functions
llvm-svn: 200077
2014-01-25 14:38:41 +00:00
Alp Toker bdbcfbf160 PlistSupport: Unify ARCMigrate / StaticAnalyzer plist writers
Reduces the ARCMT migrator plist writer down to a single function,
arcmt::writeARCDiagsToPlist() which shares supporting functions with the
analyzer plist writer.

llvm-svn: 200075
2014-01-25 11:14:41 +00:00
Daniel Jasper ff974ab88a clang-format: Fix incorrect space removal.
Before:
  Deleted &operator=(const Deleted &)&= default;
  Deleted &operator=(const Deleted &)&&= delete;

After:
  Deleted &operator=(const Deleted &)& = default;
  Deleted &operator=(const Deleted &)&& = delete;

llvm-svn: 200073
2014-01-25 09:16:02 +00:00
Eric Christopher 58b404398e One more intrinsic.
llvm-svn: 200061
2014-01-25 01:38:30 +00:00
Richard Trieu c158c5a029 Remove HTML codes from a .rst file. The proper HTML code will be added back
when the .html file is generated.

llvm-svn: 200060
2014-01-25 01:32:39 +00:00
Richard Trieu 955231ddf6 Broaden -Wstring-conversion to catch string literals in logical or expressions.
Previously, string literals were ignored in all logical expressions.  This
reduces it to only ignore in logical and expressions.

assert(0 && "error"); // No warning
assert(0 || "error"); // Warn

Fixes PR17565

llvm-svn: 200056
2014-01-25 01:10:35 +00:00
Alp Toker 6bd95b8aac Add a proper test for -Wsystem-headers
This will be extended as we fix issues in the current implementation.

llvm-svn: 200054
2014-01-25 00:32:40 +00:00
Richard Smith a8e1e9b143 Correct < and > to &lt; and &gt;. Thanks to Samuel Harrington for pointing this out!
llvm-svn: 200048
2014-01-24 22:55:47 +00:00
Richard Smith 4b5a949834 Allow virt-specifiers after GNU attributes in member-declarators. GCC doesn't
allow this, and we should warn on it, but it turns out that people were already
relying on this.

We should introduce a -Wgcc-compat warning for this if the attributes are known
to GCC, but we don't currently track enough information about attributes to do
so reliably.

llvm-svn: 200045
2014-01-24 22:34:35 +00:00
Aaron Ballman 81cb8cbfa6 Adds a getSemanticSpelling function to semantic attribute subclasses which have a meaningful semantic spelling. Adds a sibling function to parsed attribtues (via AttributeList) for getting the semantic spelling, if one were to exist. This can be used for cleaner code that deals directly with the semantic spellings (such as the MSInheritance attribute).
llvm-svn: 200041
2014-01-24 21:32:49 +00:00
Aaron Ballman 83f197b613 Since Visual Studio 2012 is the minimum version of MSVC we support, the old-style visualizers are being removed. Adding a Natvis replacement for the debugging visualizers.
llvm-svn: 200032
2014-01-24 19:46:45 +00:00
Yunzhong Gao 063763ea42 Fixing PR18510 by checking whether the non-virtual base of the derived class
might have a smaller size as compared to the stand-alone type of the base class.
This is possible when the derived class is packed and hence might have smaller
alignment requirement than the base class.

Differential Revision: http://llvm-reviews.chandlerc.com/D2599

llvm-svn: 200031
2014-01-24 19:28:24 +00:00
Amara Emerson 05d816d0e2 [AArch64] Replace underscores with dashes in -mgeneral_regs_only.
This should now match the equivalent gcc option.

llvm-svn: 200008
2014-01-24 15:15:27 +00:00
Aaron Ballman cc396f85d9 Adding a new diagnostics group (-Wattributes) which covers both UnknownAttributes and IgnoredAttributes.
llvm-svn: 200004
2014-01-24 14:16:23 +00:00
NAKAMURA Takumi 518490b949 [CMake] libclang: Update GENERATED_HEADERS with actually used.
+  ClangAttrVisitor
+  ClangCommentCommandList

llvm-svn: 199999
2014-01-24 13:40:37 +00:00
Ismail Pazarbasi df1a280526 Added missing StandardConversionSequence initialization
This is the second msan failure where UserDefinedConversion does not initialize
its `Before` member as identity conversion.

llvm-svn: 199997
2014-01-24 13:16:17 +00:00
Eric Christopher 439137ea32 Add missing intrinsics, fix a couple of typos in intrinsic names,
and remove duplicate declarations.

llvm-svn: 199992
2014-01-24 12:13:47 +00:00
Artyom Skrobov 9f2134402c Combine the checks for returns_nonnull and for operator new returning null, in Sema::CheckReturnValExpr. Add the missing handling of value-dependent expressions for returns_nonnull.
llvm-svn: 199989
2014-01-24 11:10:39 +00:00
Ismail Pazarbasi 99afd96703 Initialize StandardConversionSequence correctly
MSAN detected a path that leaves DeprecatedStringLiteralToCharPtr uninitialized.
UserDefinedConversionSequence::First is a StandardConversionSequence that must
be initialized with setAsIdentityConversion.

llvm-svn: 199988
2014-01-24 10:54:12 +00:00