]> granicus.if.org Git - clang/log
clang
10 years agoFix r195149. Triple should correctly reflect that target. If it contains ios,
Evan Cheng [Sun, 26 Jan 2014 23:12:43 +0000 (23:12 +0000)]
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

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

10 years agoUse canonical spelling of NetBSD
Joerg Sonnenberger [Sun, 26 Jan 2014 20:02:03 +0000 (20:02 +0000)]
Use canonical spelling of NetBSD

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

10 years agoclang-check: Unittests doesn't requires tools.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:35:07 +0000 (12:35 +0000)]
clang-check: Unittests doesn't requires tools.

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

10 years agocheck-clang doesn't require neither llvm_src_root nor llvm_obj_root.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:35:00 +0000 (12:35 +0000)]
check-clang doesn't require neither llvm_src_root nor llvm_obj_root.

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

10 years agoRevert r113780, "Recognize .ll as input files. Handle %test_debuginfo on a RUN comman...
NAKAMURA Takumi [Sun, 26 Jan 2014 12:34:54 +0000 (12:34 +0000)]
Revert r113780, "Recognize .ll as input files. Handle %test_debuginfo on a RUN command line."

This feature has been unused anymore.

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

10 years ago[CMake] Always set CMAKE_INCLUDE_CURRENT_DIR.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:34:48 +0000 (12:34 +0000)]
[CMake] Always set CMAKE_INCLUDE_CURRENT_DIR.

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

10 years ago[CMake][Standalone] Introduce check-all.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:34:38 +0000 (12:34 +0000)]
[CMake][Standalone] Introduce check-all.

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

10 years agoFix -Wreturn-type build failure on ASTMatchers, plus an intended assert
Alp Toker [Sun, 26 Jan 2014 08:12:32 +0000 (08:12 +0000)]
Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert

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

10 years agoUpdate docstrings following the param name change in r200132
Alp Toker [Sun, 26 Jan 2014 06:41:58 +0000 (06:41 +0000)]
Update docstrings following the param name change in r200132

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Sun, 26 Jan 2014 06:39:14 +0000 (06:39 +0000)]
Update for llvm api change.

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

10 years ago[CMake] Reindent.
NAKAMURA Takumi [Sun, 26 Jan 2014 06:18:06 +0000 (06:18 +0000)]
[CMake] Reindent.

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

10 years agoEnforce safe usage of DiagnosticsEngine::getCustomDiagID()
Alp Toker [Sun, 26 Jan 2014 06:17:37 +0000 (06:17 +0000)]
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.

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

10 years agoIdentify two more unsafe uses of getCustomDiagID()
Alp Toker [Sun, 26 Jan 2014 05:08:49 +0000 (05:08 +0000)]
Identify two more unsafe uses of getCustomDiagID()

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

10 years agoRemove buggy example code from the documentation
Alp Toker [Sun, 26 Jan 2014 05:08:07 +0000 (05:08 +0000)]
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.

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

10 years agoARCMigrate: Introduce proper diagnostics for TransformActions
Alp Toker [Sun, 26 Jan 2014 05:07:32 +0000 (05:07 +0000)]
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.

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

10 years agoRemove flawed diagnostic mapping functions
Alp Toker [Sun, 26 Jan 2014 05:07:02 +0000 (05:07 +0000)]
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.

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

10 years agoFor AArch64 Neon, fix intrinsics implementation using nested macros.
Jiangning Liu [Sun, 26 Jan 2014 03:38:42 +0000 (03:38 +0000)]
For AArch64 Neon, fix intrinsics implementation using nested macros.

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

10 years agoRename getResultLoc() too
Alp Toker [Sat, 25 Jan 2014 23:51:36 +0000 (23:51 +0000)]
Rename getResultLoc() too

Follow up to r200082.

Spotted by Dmitri

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

10 years agoPR18530: Don't assert when performing error recovery after a missing 'template<>...
Richard Smith [Sat, 25 Jan 2014 21:32:06 +0000 (21:32 +0000)]
PR18530: Don't assert when performing error recovery after a missing 'template<>' on a variable template explicit specialization.

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

10 years agoPR18283: If a const variable of integral or enumeration type is
Richard Smith [Sat, 25 Jan 2014 20:50:08 +0000 (20:50 +0000)]
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!

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

10 years agounittests: explicit stringify StringRefs for conversion
Saleem Abdulrasool [Sat, 25 Jan 2014 20:04:44 +0000 (20:04 +0000)]
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.

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

10 years agoRemove obsolete ObjCMethodDecl arg_type iterator functions
Alp Toker [Sat, 25 Jan 2014 17:32:04 +0000 (17:32 +0000)]
Remove obsolete ObjCMethodDecl arg_type iterator functions

These were set into deprecation in r199773.

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

10 years agoRename getResultType() on function and method declarations to getReturnType()
Alp Toker [Sat, 25 Jan 2014 16:55:45 +0000 (16:55 +0000)]
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.

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

10 years ago[Mips] Add support for mips64el-linux-android triple.
Simon Atanasyan [Sat, 25 Jan 2014 16:04:08 +0000 (16:04 +0000)]
[Mips] Add support for mips64el-linux-android triple.

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

10 years ago[Mips] Add test to check translation MIPS triples to cpu and float abi
Simon Atanasyan [Sat, 25 Jan 2014 16:03:59 +0000 (16:03 +0000)]
[Mips] Add test to check translation MIPS triples to cpu and float abi
options.

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

10 years agoPlistSupport: Eliminate duplicated EmitLocation() and EmitRange() functions
Alp Toker [Sat, 25 Jan 2014 14:38:41 +0000 (14:38 +0000)]
PlistSupport: Eliminate duplicated EmitLocation() and EmitRange() functions

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

10 years agoPlistSupport: Unify ARCMigrate / StaticAnalyzer plist writers
Alp Toker [Sat, 25 Jan 2014 11:14:41 +0000 (11:14 +0000)]
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.

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

10 years agoclang-format: Fix incorrect space removal.
Daniel Jasper [Sat, 25 Jan 2014 09:16:02 +0000 (09:16 +0000)]
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;

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

10 years agoOne more intrinsic.
Eric Christopher [Sat, 25 Jan 2014 01:38:30 +0000 (01:38 +0000)]
One more intrinsic.

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

10 years agoRemove HTML codes from a .rst file. The proper HTML code will be added back
Richard Trieu [Sat, 25 Jan 2014 01:32:39 +0000 (01:32 +0000)]
Remove HTML codes from a .rst file.  The proper HTML code will be added back
when the .html file is generated.

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

10 years agoBroaden -Wstring-conversion to catch string literals in logical or expressions.
Richard Trieu [Sat, 25 Jan 2014 01:10:35 +0000 (01:10 +0000)]
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

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

10 years agoAdd a proper test for -Wsystem-headers
Alp Toker [Sat, 25 Jan 2014 00:32:40 +0000 (00:32 +0000)]
Add a proper test for -Wsystem-headers

This will be extended as we fix issues in the current implementation.

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

10 years agoCorrect < and > to &lt; and &gt;. Thanks to Samuel Harrington for pointing this out!
Richard Smith [Fri, 24 Jan 2014 22:55:47 +0000 (22:55 +0000)]
Correct < and > to &lt; and &gt;. Thanks to Samuel Harrington for pointing this out!

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

10 years agoAllow virt-specifiers after GNU attributes in member-declarators. GCC doesn't
Richard Smith [Fri, 24 Jan 2014 22:34:35 +0000 (22:34 +0000)]
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.

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

10 years agoAdds a getSemanticSpelling function to semantic attribute subclasses which have a...
Aaron Ballman [Fri, 24 Jan 2014 21:32:49 +0000 (21:32 +0000)]
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).

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

10 years agoSince Visual Studio 2012 is the minimum version of MSVC we support, the old-style...
Aaron Ballman [Fri, 24 Jan 2014 19:46:45 +0000 (19:46 +0000)]
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.

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

10 years agoFixing PR18510 by checking whether the non-virtual base of the derived class
Yunzhong Gao [Fri, 24 Jan 2014 19:28:24 +0000 (19:28 +0000)]
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

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

10 years ago[AArch64] Replace underscores with dashes in -mgeneral_regs_only.
Amara Emerson [Fri, 24 Jan 2014 15:15:27 +0000 (15:15 +0000)]
[AArch64] Replace underscores with dashes in -mgeneral_regs_only.

This should now match the equivalent gcc option.

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

10 years agoAdding a new diagnostics group (-Wattributes) which covers both UnknownAttributes...
Aaron Ballman [Fri, 24 Jan 2014 14:16:23 +0000 (14:16 +0000)]
Adding a new diagnostics group (-Wattributes) which covers both UnknownAttributes and IgnoredAttributes.

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

10 years ago[CMake] libclang: Update GENERATED_HEADERS with actually used.
NAKAMURA Takumi [Fri, 24 Jan 2014 13:40:37 +0000 (13:40 +0000)]
[CMake] libclang: Update GENERATED_HEADERS with actually used.

+  ClangAttrVisitor
+  ClangCommentCommandList

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

10 years agoAdded missing StandardConversionSequence initialization
Ismail Pazarbasi [Fri, 24 Jan 2014 13:16:17 +0000 (13:16 +0000)]
Added missing StandardConversionSequence initialization

This is the second msan failure where UserDefinedConversion does not initialize
its `Before` member as identity conversion.

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

10 years agoAdd missing intrinsics, fix a couple of typos in intrinsic names,
Eric Christopher [Fri, 24 Jan 2014 12:13:47 +0000 (12:13 +0000)]
Add missing intrinsics, fix a couple of typos in intrinsic names,
and remove duplicate declarations.

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

10 years agoCombine the checks for returns_nonnull and for operator new returning null, in Sema...
Artyom Skrobov [Fri, 24 Jan 2014 11:10:39 +0000 (11:10 +0000)]
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.

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

10 years agoInitialize StandardConversionSequence correctly
Ismail Pazarbasi [Fri, 24 Jan 2014 10:54:12 +0000 (10:54 +0000)]
Initialize StandardConversionSequence correctly

MSAN detected a path that leaves DeprecatedStringLiteralToCharPtr uninitialized.
UserDefinedConversionSequence::First is a StandardConversionSequence that must
be initialized with setAsIdentityConversion.

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

10 years agoRemove empty directories.
Alexander Kornienko [Fri, 24 Jan 2014 10:20:23 +0000 (10:20 +0000)]
Remove empty directories.

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

10 years agoRemove empty directories.
Alexander Kornienko [Fri, 24 Jan 2014 10:18:17 +0000 (10:18 +0000)]
Remove empty directories.

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

10 years agoGet rid of special parsing for return statements.
Manuel Klimek [Fri, 24 Jan 2014 09:25:23 +0000 (09:25 +0000)]
Get rid of special parsing for return statements.

This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not necessary any more.

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

10 years agoUpdate page on clang diagnostics to contrast to GCC 4.9 instead of 4.2. A lot
Richard Smith [Fri, 24 Jan 2014 03:13:34 +0000 (03:13 +0000)]
Update page on clang diagnostics to contrast to GCC 4.9 instead of 4.2. A lot
of the differences we identified here have been fixed by improvements in GCC.

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

10 years agoRemove outdated documentation suggesting we don't support the C++1y lambda extensions.
Richard Smith [Fri, 24 Jan 2014 02:12:28 +0000 (02:12 +0000)]
Remove outdated documentation suggesting we don't support the C++1y lambda extensions.

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

10 years agoPR18560: When switching to a new context, don't just save and restore an
Richard Smith [Fri, 24 Jan 2014 01:54:52 +0000 (01:54 +0000)]
PR18560: When switching to a new context, don't just save and restore an
override for the type of 'this', also clear it out (unless we're entering the
context of a lambda-expression, where it should be inherited).

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

10 years agoAdd implementations of __readfs{byte,word,dword,qword} to Intrin.h
Hans Wennborg [Fri, 24 Jan 2014 00:52:39 +0000 (00:52 +0000)]
Add implementations of __readfs{byte,word,dword,qword} to Intrin.h

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

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

10 years agoFactor out repeated parsing of a member-declarator when parsing a
Richard Smith [Thu, 23 Jan 2014 23:53:27 +0000 (23:53 +0000)]
Factor out repeated parsing of a member-declarator when parsing a
member-declaration. In the process, fix a couple of bugs that had crept in
where we would parse the first and subsequent member-declarators differently
(in particular, we didn't accept an asm-label on a member function definition
within a class, and we would accept virt-specifiers and attributes in the wrong
order on the first declarator but not on subsequent ones).

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

10 years agoFix debug build.
Peter Collingbourne [Thu, 23 Jan 2014 23:15:58 +0000 (23:15 +0000)]
Fix debug build.

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

10 years agoIntroduce Registry::getCompletions.
Peter Collingbourne [Thu, 23 Jan 2014 22:48:38 +0000 (22:48 +0000)]
Introduce Registry::getCompletions.

This returns a list of valid (and useful) completions for a context (a list
of outer matchers), ordered by decreasing relevance then alphabetically. It
will be used by the matcher parser to implement completion.

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

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

10 years agoThread safety analysis: handle duplicate assert_lock attributes.
DeLesley Hutchins [Thu, 23 Jan 2014 22:35:26 +0000 (22:35 +0000)]
Thread safety analysis: handle duplicate assert_lock attributes.

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

10 years agoIntrin.h: fix definitions of _Interlocked{In,De}crement16
Hans Wennborg [Thu, 23 Jan 2014 19:15:39 +0000 (19:15 +0000)]
Intrin.h: fix definitions of _Interlocked{In,De}crement16

The declarations seem correct, but the definitions were using
chars instead of shorts.

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

10 years agotest/CodeGen: Finish fixing the typo in r199862
Justin Bogner [Thu, 23 Jan 2014 17:34:24 +0000 (17:34 +0000)]
test/CodeGen: Finish fixing the typo in r199862

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

10 years agoAllow clang to compile the "extern" storage class in OpenCL 1.2.
Pekka Jaaskelainen [Thu, 23 Jan 2014 16:36:09 +0000 (16:36 +0000)]
Allow clang to compile the "extern" storage class in OpenCL 1.2.
The tests (forgot to svn add, sorry!).

Patch from Fraser Cormack!

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

10 years agoAllow clang to compile the "extern" storage class in OpenCL 1.2.
Pekka Jaaskelainen [Thu, 23 Jan 2014 16:21:02 +0000 (16:21 +0000)]
Allow clang to compile the "extern" storage class in OpenCL 1.2.

Patch from Fraser Cormack!

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

10 years ago[AArch64] Add -mgeneral_regs_only option.
Amara Emerson [Thu, 23 Jan 2014 15:48:30 +0000 (15:48 +0000)]
[AArch64] Add -mgeneral_regs_only option.

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

10 years ago[CMake] Move LIBCLANG_BUILD_STATIC above. NFC.
NAKAMURA Takumi [Thu, 23 Jan 2014 15:33:50 +0000 (15:33 +0000)]
[CMake] Move LIBCLANG_BUILD_STATIC above. NFC.

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

10 years ago[CMake] Parameterize MODULE and SHARED in add_clang_library().
NAKAMURA Takumi [Thu, 23 Jan 2014 15:33:44 +0000 (15:33 +0000)]
[CMake] Parameterize MODULE and SHARED in add_clang_library().

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

10 years ago[CMake] Migrate LLVMParseArguments to CMakeParseArguments.
NAKAMURA Takumi [Thu, 23 Jan 2014 15:33:35 +0000 (15:33 +0000)]
[CMake] Migrate LLVMParseArguments to CMakeParseArguments.

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

10 years agoFix to PR8880 (clang dies processing a for loop)
Serge Pavlov [Thu, 23 Jan 2014 15:05:00 +0000 (15:05 +0000)]
Fix to PR8880 (clang dies processing a for loop)

Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside
its body, for example:

    for ( ; ({ if (first) { first = 0; continue; } 0; }); )

This code is rejected by GCC if compiled in C mode but is accepted in C++
code. GCC bug 44715 tracks this discrepancy. Clang used code generation
that differs from GCC in both modes: only statement of the third
expression of 'for' behaves as if it was inside loop body.

This change makes code generation more close to GCC, considering 'break'
or 'continue' statement in condition and increment expressions of a
loop as it was inside the loop body. It also adds error for the cases
when 'break'/'continue' appear outside loop due to this syntax. If
code generation differ from GCC, warning is issued.

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

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

10 years agoMachO embedded: default to soft float without issuing warning
Tim Northover [Thu, 23 Jan 2014 15:00:01 +0000 (15:00 +0000)]
MachO embedded: default to soft float without issuing warning

This is a simpler rule, broadly in line with previous Darwin (which chose
between "soft" and "softfp") but probably safer. In practice the only real
reason for "softfp" is ABI compatibility, not usually an issue on limited chips
like these, so anyone who wanted hard-float should already be saying so.

That's my story and I'm sticking to it.

rdar://problem/15887493

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

10 years agoAdd documentation for -m16 option on X86, fix typo
David Woodhouse [Thu, 23 Jan 2014 14:32:46 +0000 (14:32 +0000)]
Add documentation for -m16 option on X86, fix typo

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

10 years ago[analyzer] Strip trailing whitespace characters from input.
Anton Yartsev [Thu, 23 Jan 2014 14:12:48 +0000 (14:12 +0000)]
[analyzer] Strip trailing whitespace characters from input.

More universal way of removing trailing whitespace characters then 'chomp' does. Chomp "removes any trailing string that corresponds to the current value of $/" (quote from perldoc). In my case an input ended with '\r\r\n', chomp left '\r' at the end of input and the script ended up with an error "Use of uninitialized value in concatenation (.) or string"

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

10 years agoImprove x86 android support, add x86_64 android target
Alexey Bataev [Thu, 23 Jan 2014 09:08:32 +0000 (09:08 +0000)]
Improve x86 android support, add x86_64 android target

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

10 years agotest/CodeGenCXX: Be less strict about return types
Justin Bogner [Thu, 23 Jan 2014 04:41:06 +0000 (04:41 +0000)]
test/CodeGenCXX: Be less strict about return types

Some ABIs have different return types for constructors and
destructors, and we're just looking for the end of the function
here. Loosen up the regex.

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

10 years ago[analyzer] Tighten up sanity checks on Objective-C property getter synthesis.
Jordan Rose [Thu, 23 Jan 2014 03:59:10 +0000 (03:59 +0000)]
[analyzer] Tighten up sanity checks on Objective-C property getter synthesis.

If there are non-trivially-copyable types /other/ than C++ records, we
won't have a synthesized copy expression, but we can't just use a simple
load/return.

Also, add comments and shore up tests, making sure to test in both ARC
and non-ARC.

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

10 years ago[analyzer] Future-proof MallocChecker CFG dumping.
Jordan Rose [Thu, 23 Jan 2014 03:59:01 +0000 (03:59 +0000)]
[analyzer] Future-proof MallocChecker CFG dumping.

Now we'll get a warning if we miss a case. Refinement of r199800.

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

10 years agoChange an absolute value function in a test from floating to integer to
Richard Trieu [Thu, 23 Jan 2014 03:51:55 +0000 (03:51 +0000)]
Change an absolute value function in a test from floating to integer to
match argument type.

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

10 years ago[AArch64 NEON] Fix a bug about vcles_f32 and vcled_f64.
Kevin Qin [Thu, 23 Jan 2014 03:42:06 +0000 (03:42 +0000)]
[AArch64 NEON] Fix a bug about vcles_f32 and vcled_f64.

As vcles_f32() and vcled_f64 are implemented by FCMGE, operands
should make a swap.

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

10 years agoCodeGen: Fix tracking of PGO counters for the logical or operator
Justin Bogner [Thu, 23 Jan 2014 02:54:30 +0000 (02:54 +0000)]
CodeGen: Fix tracking of PGO counters for the logical or operator

This adds tests for both logical or and for logical and, which was
already correct.

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

10 years agoCodeGen: Handle PGO counters for constructors and destructors
Justin Bogner [Thu, 23 Jan 2014 02:54:27 +0000 (02:54 +0000)]
CodeGen: Handle PGO counters for constructors and destructors

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

10 years agotest/CodeGenCXX: Give instr-profile exception tests their own file
Justin Bogner [Thu, 23 Jan 2014 02:54:23 +0000 (02:54 +0000)]
test/CodeGenCXX: Give instr-profile exception tests their own file

This test requires asserts for now, and exception handling has an
awkward structure that leads to extra run lines. Because of this, the
test file's not a great place for other C++ PGO tests, but
instr-profile.cpp is obviously the better name for them.

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

10 years agotest/CodeGen: Fix a typo
Justin Bogner [Thu, 23 Jan 2014 02:54:20 +0000 (02:54 +0000)]
test/CodeGen: Fix a typo

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

10 years agoRequire a module.map file to load a module
Ben Langmuir [Wed, 22 Jan 2014 23:19:39 +0000 (23:19 +0000)]
Require a module.map file to load a module

Removes some old code that allowed a module to be loaded from a pcm file
even if the module.map could not be found.  Also update a number of
tests that relied on the old behavior.

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

10 years agoDon't forget about a builtin if we're about to redeclare it and we couldn't
Richard Smith [Wed, 22 Jan 2014 23:07:19 +0000 (23:07 +0000)]
Don't forget about a builtin if we're about to redeclare it and we couldn't
create an implicit declaration of it (because some type it depends on is
unavailable). This had the effect of causing us to not implicitly give it the
right attributes. It turns out that glibc's __sigsetjmp is declared before
sigjmp_buf is declared, and this resulted in us not implicitly giving it
__attribute__((returns_twice)), which in turn resulted in miscompiles in any C
code calling glibc's sigsetjmp.

(See also the vaguely-related sourceware.org/PR4662.)

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

10 years agoIf an attribute has a semantically meaningful spelling (such as ArgumentWithTypeTagAt...
Aaron Ballman [Wed, 22 Jan 2014 21:51:20 +0000 (21:51 +0000)]
If an attribute has a semantically meaningful spelling (such as ArgumentWithTypeTagAttr or MSInheritanceAttr), display the spelling used for the attribute as part of the AST dump. This should ease debugging the AST for these attributes. Attributes without semantically meaningful spelling variations are not affected.

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

10 years agoHandle va_arg on struct types for the le32 target (PNaCl and Emscripten)
Mark Seaborn [Wed, 22 Jan 2014 20:11:01 +0000 (20:11 +0000)]
Handle va_arg on struct types for the le32 target (PNaCl and Emscripten)

PNaCl and Emscripten can both handle va_arg IR instructions with
struct type.

Also add a test to cover generating a va_arg IR instruction from
va_arg in C on le32 (as already handled by VisitVAArgExpr() in
CGExprScalar.cpp), which was not covered by a test before.

(This fixes https://code.google.com/p/nativeclient/issues/detail?id=2381)

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

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

10 years agoWhen a special member is explicitly defaulted outside its class, and we reject
Richard Smith [Wed, 22 Jan 2014 20:09:10 +0000 (20:09 +0000)]
When a special member is explicitly defaulted outside its class, and we reject
the defaulting because it would delete the member, produce additional notes
explaining why the member is implicitly deleted.

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

10 years agoclang-cl: Expose the -ferror-limit= option
Hans Wennborg [Wed, 22 Jan 2014 20:06:53 +0000 (20:06 +0000)]
clang-cl: Expose the -ferror-limit= option

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

10 years agoDriver: Suppression support for -Wa,--compress-debug-sections
David Blaikie [Wed, 22 Jan 2014 19:22:21 +0000 (19:22 +0000)]
Driver: Suppression support for -Wa,--compress-debug-sections

(to go with existing suppression of -Wa,-compress-debug-sections)

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

10 years agoObjectiveC. When issuing property implementation is
Fariborz Jahanian [Wed, 22 Jan 2014 19:02:20 +0000 (19:02 +0000)]
ObjectiveC. When issuing property implementation is
not using backing ivar warning, ignore when
property is not being synthesized (user declared its
implementation @dynamic). // rdar://1583425

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

10 years agoPR18465: [Thumbv8] add predefined macros
Weiming Zhao [Wed, 22 Jan 2014 18:42:13 +0000 (18:42 +0000)]
PR18465: [Thumbv8] add predefined macros

currently, for thumbv8, two predefined macros are missing:
 define __THUMB_INTERWORK__ 1
 define __THUMB_INTERWORK__ 1

This patch adds them for thumbv8.

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

10 years agoclang-format: Fix incorrect lambda recognition.
Daniel Jasper [Wed, 22 Jan 2014 17:01:47 +0000 (17:01 +0000)]
clang-format: Fix incorrect lambda recognition.

Before:
  std::unique_ptr<int[]> foo() {}

After:
  std::unique_ptr<int []> foo() {}

Also, the formatting could go severely wrong after such a function
before.

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

10 years ago[analyzer] The patch prevents the analyzer from crashing during CFG dump.
Anton Yartsev [Wed, 22 Jan 2014 13:19:48 +0000 (13:19 +0000)]
[analyzer] The patch prevents the analyzer from crashing during CFG dump.

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

10 years ago[CMake][MS] libclang: Invalidate LLVM_EXPORTED_SYMBOL_FILE to suppress LNK4197.
NAKAMURA Takumi [Wed, 22 Jan 2014 13:02:59 +0000 (13:02 +0000)]
[CMake][MS] libclang: Invalidate LLVM_EXPORTED_SYMBOL_FILE to suppress LNK4197.

Each functions is exported as "dllexport" in include/clang-c.
See also KB835326.

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

10 years agoclang-format: Treat "." in protos like namespace separators.
Daniel Jasper [Wed, 22 Jan 2014 08:04:52 +0000 (08:04 +0000)]
clang-format: Treat "." in protos like namespace separators.

Before:
  optional really.really.long.and.qualified.type.aaaaaaa
      .aaaaaaaa another_fiiiiiiiiiiiiiiiiiiiiield = 2;

After:
  optional
     really.really.long.and.qualified.type.aaaaaaa.aaaaaaaa
          another_fiiiiiiiiiiiiiiiiiiiiield = 2;

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

10 years agoChange a dyn_cast from r199794 to a straight cast
Alp Toker [Wed, 22 Jan 2014 07:53:08 +0000 (07:53 +0000)]
Change a dyn_cast from r199794 to a straight cast

It's guaranteed to be a CXXMethodDecl.

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

10 years agoIntroduce and use Decl::getAsFunction() to simplify templated function checks
Alp Toker [Wed, 22 Jan 2014 07:29:52 +0000 (07:29 +0000)]
Introduce and use Decl::getAsFunction() to simplify templated function checks

Lift the getFunctionDecl() utility out of the parser into a general
Decl::getAsFunction() and use it to simplify other parts of the implementation.

Reduce isFunctionOrFunctionTemplate() to a simple type check that works the
same was as the other is* functions and move unwrapping of shadowed decls to
callers so it doesn't get run twice.

Shuffle around canSkipFunctionBody() to reduce virtual dispatch on ASTConsumer.
There's no need to query when we already know the body can't be skipped.

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

10 years agoAdd basic checking for returning null from functions/methods marked 'returns_nonnull'.
Ted Kremenek [Wed, 22 Jan 2014 06:10:28 +0000 (06:10 +0000)]
Add basic checking for returning null from functions/methods marked 'returns_nonnull'.

This involved making CheckReturnStackAddr into a static function, which
is now called by a top-level return value checking routine called
CheckReturnValExpr.

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

10 years agoclang-cl: make /Zp a Joined option (PR18503)
Hans Wennborg [Wed, 22 Jan 2014 03:23:35 +0000 (03:23 +0000)]
clang-cl: make /Zp a Joined option (PR18503)

We don't currently support this option, but we should be able to parse it.

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

10 years agoAdd a test file missed from r199782.
Richard Smith [Wed, 22 Jan 2014 02:05:03 +0000 (02:05 +0000)]
Add a test file missed from r199782.

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

10 years agoEnforce restrictions that 'main' is not allowed to be deleted, or to be used by
Richard Smith [Wed, 22 Jan 2014 01:43:19 +0000 (01:43 +0000)]
Enforce restrictions that 'main' is not allowed to be deleted, or to be used by
the program, in C++. (We allow the latter as an extension, since we've always
permitted it, and GCC does the same, and our supported C++ ABIs don't do
anything special in main.)

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

10 years agoObjectiveC driver. change to reinstate -fno-objc-legacy-dispatch behavior
Fariborz Jahanian [Wed, 22 Jan 2014 00:43:54 +0000 (00:43 +0000)]
ObjectiveC driver. change to reinstate -fno-objc-legacy-dispatch behavior
when the deployment target is 10.5. // rdar://15852259

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

10 years agoBuild an appropriate (albeit trivial) TypeSourceInfo for a destructor name, so
Richard Smith [Wed, 22 Jan 2014 00:30:17 +0000 (00:30 +0000)]
Build an appropriate (albeit trivial) TypeSourceInfo for a destructor name, so
AST consumers can determine where the destructor name was written. Patch by
Olivier Goffart!

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

10 years agoWhen formatting a C++-only declaration name, enable C++ mode in the formatter's
Richard Smith [Wed, 22 Jan 2014 00:27:42 +0000 (00:27 +0000)]
When formatting a C++-only declaration name, enable C++ mode in the formatter's
language options. This is not really ideal -- we should require the right
language options to be passed in, or not require language options to format a
name -- but it fixes a number of *obviously* wrong formattings. Patch by
Olivier Goffart!

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

10 years agoDelay attribute checking until auto types are deduced
Nico Rieck [Tue, 21 Jan 2014 23:54:36 +0000 (23:54 +0000)]
Delay attribute checking until auto types are deduced

Checking in ActOnVariableDeclarator computes and caches the linkage using
the non-deduced auto type which defaults to external linkage. Depending on
how the auto type is deduced linkage can change and conflict with the
cached linkage, hitting asserts.

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