Commit Graph

53786 Commits

Author SHA1 Message Date
Joerg Sonnenberger b3a4969b70 Provide __SIG_ATOMIC_MAX__ next to __SIG_ATOMIC_WIDTH__.
llvm-svn: 213289
2014-07-17 18:31:20 +00:00
Nico Weber 022e507042 Wrap a comment to 80 columns, no code change.
llvm-svn: 213288
2014-07-17 18:19:30 +00:00
Fariborz Jahanian b93355e9b1 Objective-C. deprecated attribute is not inherited on methods
overriden in interfaces and protocols (this is already the case
for properties). rdar://16068470

llvm-svn: 213282
2014-07-17 17:05:04 +00:00
Hal Finkel a8443c36ae Handle __assume in the VoidExprEvaluator
This is a follow-up to an IRC conversation with Richard last night; __assume
does not evaluate its argument, and so the argument should not contribute to
whether (__assume(e), constant) can be used where a constant is required.

llvm-svn: 213267
2014-07-17 14:49:58 +00:00
Hal Finkel f041733585 Add an __assume side-effects warning
In MS-compatibility mode, we support the __assume builtin. The __assume builtin
does not evaluate its arguments, and we should issue a warning if __assume is
provided with an argument with side effects (because these effects will be
discarded).

This is similar in spirit to the warnings issued by other compilers (Intel
Diagnostic 2261, MS Compiler Warning C4557).

llvm-svn: 213266
2014-07-17 14:25:55 +00:00
Aaron Ballman 9eef742308 Using a std::string instead of a StringRef because the Default case synthesizes a temporary std::string from a Twine. Assigning that into a StringRef causes the StringRef to refer to a temporary, and bad things happen.
This fixes a failing test case on Windows.

llvm-svn: 213265
2014-07-17 13:28:50 +00:00
Alexey Bataev 74ba3a5880 [OPENMP] Initial parsing and sema analysis of 'mergeable' clause.
llvm-svn: 213262
2014-07-17 12:47:03 +00:00
Yi Kong 28d7b02687 ARM: Add ACLE memory barrier intrinsic mapping
llvm-svn: 213261
2014-07-17 12:45:17 +00:00
Alp Toker 5c37d70e9e Revert "Handle diagnostic warnings in Frontend diagnostic handler."
This commit is missing tests and there are a few points that need to be
addressed before a new user-facing option can be added:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140714/110198.html

This reverts commit r213112.

llvm-svn: 213260
2014-07-17 12:29:08 +00:00
Aaron Ballman 4d7e7a2082 Fixing the objc_runtine_name documentation so that the code block is properly generated.
llvm-svn: 213259
2014-07-17 12:25:32 +00:00
Daniel Jasper fc3861ac48 clang-format: Fix parsing of conditional expressions.
Before:
  aaaaaa = aaaaaaaaaaaa ? aaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      : aaaaaaaaaaaaaaaaaaaaaa
      : aaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  aaaaaa = aaaaaaaaaaaa
               ? aaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                            : aaaaaaaaaaaaaaaaaaaaaa
               : aaaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 213258
2014-07-17 12:22:04 +00:00
Alexey Bataev 7aea99a310 [OPENMP] Initial support for parsing and sema analysis of 'untied' clause.
llvm-svn: 213257
2014-07-17 12:19:31 +00:00
Ehsan Akhgari d86ca7a9c7 Upstream an MS inline assembly test from Mozilla's inline assembly code
Summary:
I'm planning on upstreaming some test cases for the inline assembly
usage in the Mozilla code base.  A lot of these test cases test the
recent fixes to this code.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4508

llvm-svn: 213255
2014-07-17 11:38:22 +00:00
Yi Kong 19a29ac0d0 Port memory barriers intrinsics to AArch64
Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to
implement their corresponding ACLE and MSVC intrinsics.

This patch ports ARM dmb, dsb, isb intrinsic to AArch64.

Requires LLVM r213247.

Differential Revision: http://reviews.llvm.org/D4521

llvm-svn: 213250
2014-07-17 10:52:06 +00:00
Tim Northover 6dbcbac98b IR: update Clang to use polymorphic __fp16 conversion intrinsics.
There should be no change in semantics at this stage.

llvm-svn: 213249
2014-07-17 10:51:31 +00:00
Daniel Sanders 4dcbe810d4 [mips] Pass the ABI to the integrated assembler and add tests the existing arguments.
Summary:
With this patch (and a corresponding LLVM patch), assembling an empty file with
GCC and Clang -fintegrated-as produce near identical objects. The remaining
differences are:
* GCC/GAS produce objects have a .pdr section
* GCC/GAS produce objects have a .gnu.attributes section
Other differences are insignificant such as precise file offsets and the order
of strings in the string table.

Differential Revision: http://reviews.llvm.org/D4531

llvm-svn: 213241
2014-07-17 09:46:40 +00:00
Alexander Musman 80c2289a03 [OPENMP] Parsing/Sema analysis of directive 'master'
llvm-svn: 213237
2014-07-17 08:54:58 +00:00
Sylvestre Ledru c790515c8b Consistency on the tab/space
llvm-svn: 213236
2014-07-17 08:40:35 +00:00
Sylvestre Ledru 6aac507e7d Fix Bug 14061 - scan-build crashes during postprocessing if BUGFILE no longer exists
Experienced with Thunderbird build

Patch by Matti Niemenmaa

llvm-svn: 213235
2014-07-17 08:39:04 +00:00
Alexey Bataev 3778b60176 [OPENMP] Initial parsing and sema analysis for 'final' clause.
llvm-svn: 213232
2014-07-17 07:32:53 +00:00
Richard Smith f8adcdc436 Track the difference between
-- a constructor list initialization that unpacked an initializer list into
    constructor arguments and
 -- a list initialization that created as std::initializer_list and passed it
    as the first argument to a constructor

in the AST. Use this flag while instantiating templates to provide the right
semantics for the resulting initialization.

llvm-svn: 213224
2014-07-17 05:12:35 +00:00
Nikola Smiljanic 4fc91538e9 Fix FriendDecl source location and range for class templates and function declarations that don't start with 'friend' keyword. Add more unittests.
llvm-svn: 213220
2014-07-17 01:59:34 +00:00
David Majnemer a246468f58 MS ABI: Padding injected between empty vbases doesn't up required align
Only alignment is changed, not required alignment.

llvm-svn: 213217
2014-07-17 00:55:19 +00:00
David Blaikie 1326975496 DebugInfo: Forward HandleTagDeclRequiredDefinition through MultiplexConsumer to fix debug info emission in the presence of plugins.
When plugins are used the Multiplex(AST)Consumer is employed to dispatch
to both the plugin ASTConsumers and the IRGen ASTConsumer. It wasn't
dispatching a critical call for debug info, resulting in plugin users
having a negative debugging experience.

While I'm here, forward a bunch of other missing calls through the
consumer that seem like they should be there.

To test this, use the example plugin (requires plugins and examples) and
split the test case up so that the plugin testing can be done under that
requirement while the non-plugin testing will execute even in builds
that don't include plugin support or examples.

llvm-svn: 213213
2014-07-16 23:52:46 +00:00
David Blaikie 13690037ff Revert "Stuff"
This reverts commit r213210.

Accidental commit.

llvm-svn: 213212
2014-07-16 23:26:17 +00:00
David Blaikie 204f2e500a DebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path is tested.
By having the two variables 'a' and 'b' in this test in a namespace, the
type was required to be complete before any debug info was ever emitted
(the entire namespace is parsed before the variables were emitted), this
meant that the codepath in which a declaration is emitted, then later on
the type is required to be complete and the debug info must be upgraded
to a definition was not used.

Moving the variables outside a namespace fixes this test coverage bug.

(interestingly, code coverage didn't help here -
HandleTagDeclRequireDefinition is fully covered because it's called even
in cases where the type hasn't been emitted for debug info at all
(further down in CGDebugInfo this no-ops) - so CC wouldn't've helped
catch this test coverage problem)

llvm-svn: 213211
2014-07-16 23:25:44 +00:00
David Blaikie 11572dc91e Stuff
llvm-svn: 213210
2014-07-16 23:25:37 +00:00
Hal Finkel 3e49fda0d4 Add basic (noop) CodeGen support for __assume
Clang supports __assume, at least at the semantic level, when MS extensions are
enabled. Unfortunately, trying to actually compile code using __assume would
result in this error:

  error: cannot compile this builtin function yet

__assume is an optimizer hint, and can be ignored at the IR level. Until LLVM
supports assumptions at the IR level, a noop lowering is valid, and that is
what is done here.

llvm-svn: 213206
2014-07-16 22:44:54 +00:00
Richard Smith 5332411cd7 When list-initializing an object of class type, if we pick an initializer list
constructor (and pass it an implicitly-generated std::initializer_list object),
be sure to mark the resulting construction as list-initialization. This fixes
an assert in template instantiation where we previously thought we'd got direct
non-list initialization without any parentheses.

llvm-svn: 213201
2014-07-16 21:33:43 +00:00
Arthur Marble 31fb6f4730 Typically linker options are protected with -Xlinker or -Wl,
however certain sloppy Makefiles pass -z options directly to
the compiler. This patch enables clang to recognize these
options (because -z is not used by clang itself).

llvm-svn: 213198
2014-07-16 21:16:16 +00:00
Aaron Ballman 173361e7e0 Specifying the diagnostic argument through the attribute table generator instead of having to enter it manually as part of the attribute subject list. This only affects attributes appertaining to ObjC interfaces and protocols.
No new tests required as this is covered by existing tests.

llvm-svn: 213193
2014-07-16 20:28:10 +00:00
Fariborz Jahanian 1e7facdf20 Objective-C. Modify text of documentation for objc_runtime_name
attribute.

llvm-svn: 213192
2014-07-16 20:24:55 +00:00
Aaron Ballman 80f1529c6d Removing a FIXME from the attribute parsing code by now passing along the scope and syntax information for attributes with custom parsing. It turns out not to matter too much because the FIXME wasn't quite true -- none of these attributes have a C++11 spelling. However, it's still a good change (for instance, we may add an attribute with a type arg in the future for which this code now behaves properly).
llvm-svn: 213191
2014-07-16 20:21:50 +00:00
Fariborz Jahanian a2e5deb86d Objective-C. Changes per A. Ballman's comment
for my last patch. // rdar://17631257

llvm-svn: 213185
2014-07-16 19:44:34 +00:00
Arthur Marble d12f4e7823 Remove whitespace from test commit.
llvm-svn: 213184
2014-07-16 19:10:36 +00:00
Arthur Marble 722214402a Test commit.
llvm-svn: 213182
2014-07-16 19:02:11 +00:00
Reid Kleckner c8604f65d3 Add the --target option to clang-cl and use it to fix a test.
llvm-svn: 213180
2014-07-16 18:31:25 +00:00
Hans Wennborg 8250735bb0 Don't use -msse2 in test/Driver/cl-options.c
It's already tested in cl-x86-flags.c, and can only be used
when targeting X86.

llvm-svn: 213179
2014-07-16 18:20:35 +00:00
Serge Pavlov 9f81d6a482 Simplify memory management in NestedNameSpecifierLocBuilder.
With this change the memory of buffer in NestedNameSpecifierLocBuilder
is allocated in one place. It also prevents from allocation of tiny blocks.

llvm-svn: 213178
2014-07-16 18:18:13 +00:00
Simon Atanasyan 9988e3afcc [Driver][Mips] If CPU name is not provided to the driver explicitly use
multilibs from the FSFS toolchain corresponding to the mips32r2/mips64r2 CPUs.

llvm-svn: 213175
2014-07-16 17:34:54 +00:00
Alp Toker 0621cb2e7d Make clang's rewrite engine a core feature
The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171
2014-07-16 16:48:33 +00:00
Hans Wennborg db829de6d6 clang-cl: expand test coverage for "core" options
llvm-svn: 213170
2014-07-16 16:29:00 +00:00
Fariborz Jahanian 451b92ab6a Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))
to be applied to class or protocols. This will direct IRGen
for Objective-C metadata to use the new name in various places
where class and protocol names are needed.
rdar:// 17631257

llvm-svn: 213167
2014-07-16 16:16:04 +00:00
Hans Wennborg a6c062b283 Expand the wildcard expansion test to also cover '?'
llvm-svn: 213165
2014-07-16 16:14:09 +00:00
Hans Wennborg 8a7c47ff97 clang-cl: make sure we still parse -fms-version= after r213119
The CoreOption flag got lost in the changes.

llvm-svn: 213164
2014-07-16 16:03:56 +00:00
Alp Toker a3c494f0db Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"
We've decided to make the core rewriter class and PP rewriters mandatory.
They're only a few hundred lines of code in total and not worth supporting as a
distinct build configuration, especially since doing so disables key compiler
features.

This reverts commit r213150.

Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter."

This reverts commit r213148.

Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/"

This reverts commit r213146.

llvm-svn: 213159
2014-07-16 15:12:48 +00:00
Benjamin Kramer 73ef216c73 [ASTMatchers] Add a usingDirectiveDecl matcher.
This matches 'using namespace' declarations.

Differential Revision: http://reviews.llvm.org/D4517

llvm-svn: 213152
2014-07-16 14:14:51 +00:00
NAKAMURA Takumi 890c895fbc clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]
llvm-svn: 213150
2014-07-16 13:42:43 +00:00
NAKAMURA Takumi 692d6bb544 clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.
llvm-svn: 213148
2014-07-16 13:36:39 +00:00
NAKAMURA Takumi f596539288 Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/
llvm-svn: 213146
2014-07-16 13:23:13 +00:00
NAKAMURA Takumi 7d452f198d Trailing linefeed.
llvm-svn: 213145
2014-07-16 13:21:58 +00:00
Simon Atanasyan 7018e1dbb5 [Driver][Mips] Reduce code duplication - use existing function
getMipsCPUAndABI() to get MIPS ABI name during multi-library selection.

No functional changes.

llvm-svn: 213143
2014-07-16 12:29:22 +00:00
Simon Atanasyan 18d6ad2705 [Driver][Mips] Remove flags which is not used in multi-library selection.
No functional changes.

llvm-svn: 213142
2014-07-16 12:29:05 +00:00
Simon Atanasyan ab6db9ff2a [Driver][Mips] Reduce code duplication. Remove static isMipsNan2008() function.
Use the tools::mips::isNaN2008() routine instead.

llvm-svn: 213141
2014-07-16 12:24:48 +00:00
NAKAMURA Takumi 1fb02cb62e clang/test: Introduce the feature "staticanalyzer" for --enable-clang-static-analyzer.
llvm-svn: 213140
2014-07-16 12:05:45 +00:00
NAKAMURA Takumi 61ce64ab15 clang/test/Sema/warn-documentation-almost-trailing.c: Rewrite checks with @LINE.
llvm-svn: 213139
2014-07-16 12:05:24 +00:00
Daniel Sanders 379d44bfdf [mips] Correct the invocation of GAS in several cases.
Summary:
As a result of this patch, assembling an empty file with GCC and Clang (using
GAS as the assembler) now produces identical objects.

-mfp32/-mfpxx/-mfp64 now form a trinity of options. -mfpxx is the default
when the triple vendor is 'img' or 'mti', the ABI is O32, and the CPU is
between mips2 and mips32r2/mips64r2 (inclusive).

-mno-shared is always given to the assembler to match the effect of
-mabicalls (currently unimplemented but Clang acts as if it is given).
Similarly, -call_nonpic is always given to match the effect of -mplt (also
unimplemented and acts as if given) except when the ABI is 64 in which case
-mplt has no effect so -KPIC is given instead.

-mhard-float/-msoft-float are now passed on.

-modd-spreg/-mno-odd-spreg are now passed on.

-mno-mips16 is correctly passed on. The assembler option is -no-mips16 not
-mno-mips16

Differential Revision: http://reviews.llvm.org/D4515

llvm-svn: 213138
2014-07-16 11:52:23 +00:00
Daniel Sanders 2e9427a175 [mips] Add support for -mfpxx and -mno-fpxx.
Differential Revision: http://reviews.llvm.org/D4464

llvm-svn: 213132
2014-07-16 09:57:54 +00:00
Evgeniy Stepanov a333117852 Don't add -Bsymbolic by default on Android.
-Bsymbolic is not a platform requirement and should not
be added unconditionally.

llvm-svn: 213126
2014-07-16 08:46:35 +00:00
David Majnemer bf3d430163 MS ABI: Up the required alignment after inserting padding between vbases
We would correctly insert sufficiently aligned padding between vbases
when our leading base was empty, however we would neglect to increase
the required alignment of the most derived class.

This fixes PR20315.

llvm-svn: 213123
2014-07-16 07:16:58 +00:00
David Majnemer 1272764b18 AST: Convert a SmallPtrSet to a SmallPtrSetImpl in RecordLayoutBuilder
No functionality changed, it just makes the code a little less brittle.

llvm-svn: 213122
2014-07-16 06:30:31 +00:00
David Majnemer c964b4b4d0 AST: Cleanup RecordLayoutBuilder
No functionality changed, just some cleanups:
- Switch some loops to range-based for.
- Name some iterators with a more creative name than "I".
- Reduce dependence on auto. Does RD->bases() give you a list of
  CXXBaseSpecifiers or CXXRecordDecls? It's more clear to just say which
  upfront.

llvm-svn: 213121
2014-07-16 06:04:00 +00:00
Serge Pavlov 458ea76041 Improve error recovery around colon.
Recognize additional cases, when '::' is mistyped as ':'.
This is a fix to RP18587 - colons have too much protection in member-declarations
Review is tracked by http://reviews.llvm.org/D3653.

This is an attempt to recommit the fix, initially committed as r212957 but then
reverted in r212965 as it broke self-build. In the updated patch ParseDirectDeclarator
turns on colon protection in for context as well.

llvm-svn: 213120
2014-07-16 05:16:52 +00:00
Saleem Abdulrasool c68237bc2c Driver: bifurcate extended and basic MSC versioning
This restores the original behaviour of -fmsc-version. The older option
remains as a mechanism for specifying the basic version information. A
secondary option, -fms-compatibility-version permits the user to specify an
extended version to the driver.

The new version takes the value as a dot-separated value rather than the
major * 100 + minor format that -fmsc-version format. This makes it easier to
specify the value as well as a more flexible manner for specifying the value.

Specifying both values is considered an error.

The older parameter is left solely as a driver option, which is normalised into
the newer parameter. This allows us to retain a single code path in the
compiler itself whilst preserving the semantics of the old parameter as well as
avoid having to determine which of two formats are being used by the invocation.

The test changes are due to the fact that the compiler no longer supports the
old option, and is a direct conversion to the new option.

llvm-svn: 213119
2014-07-16 03:13:50 +00:00
Hans Wennborg 7433281b5e Add a test for wildcard expansion on Windows
This depends on LLVM r213114

llvm-svn: 213115
2014-07-16 00:55:31 +00:00
Tyler Nowicki e470771b3a Handle diagnostic warnings in Frontend diagnostic handler.
Clang uses a diagnostic handler to grab diagnostic messages so it can print them
with the line of source code they refer to. This patch extends this to handle
diagnostic warnings that were added to llvm to produce a warning when
loop vectorization is explicitly specified (using a pragma clang loop directive)
but fails.

Reviewed by: Aaron Ballman

llvm-svn: 213112
2014-07-16 00:40:42 +00:00
Reid Kleckner 4e32604f60 Avoid referencing the vtable when calling the ctor without emitting it
This fixes compilation errors about incomplete types used with WebKit's
RefPtr template.  Simply calling an out of line constructor should not
instantiate all inline and defaulted virtual methods.

Tested by building and testing several big piles of code on Linux.

Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D4429

llvm-svn: 213109
2014-07-16 00:30:59 +00:00
Brad Smith 873d467bb6 Use the integrated assembler by default on OpenBSD/sparc.
llvm-svn: 213105
2014-07-15 23:07:10 +00:00
Aaron Ballman 1e606f4d46 Switching some iterator-based for loops to use range-based for loops. No functional changes intended.
llvm-svn: 213098
2014-07-15 22:03:49 +00:00
Joerg Sonnenberger f6432d83c3 Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.
llvm-svn: 213097
2014-07-15 21:58:11 +00:00
Aaron Ballman 2a89e8526a Added the pack_elements range accessor. Refactoring some for loops to use range-based for loops instead. No functional changes intended.
llvm-svn: 213095
2014-07-15 21:32:31 +00:00
Ehsan Akhgari eeb7e65c5f clang-cl: Implement the -arch flag
Summary:
This implements the -arch flag for both x86 and x86-64 by letting
them affect the default target features we pass to cc1.  -m machine
flags will override the features set by -arch.

Reviewers: hansw

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4519

llvm-svn: 213083
2014-07-15 18:27:51 +00:00
Fariborz Jahanian 3705790adf Improve test of my previous patch. rdar://17633301
llvm-svn: 213081
2014-07-15 17:47:58 +00:00
Matt Arsenault 8587711164 Add codegen for more R600 builtins
llvm-svn: 213079
2014-07-15 17:23:46 +00:00
Fariborz Jahanian bc94c94be4 Objective-C IRGen. Fixes an inconsistant linkage of
ObC's metaclass metadata with its class metadata which
results in an assert. rdar://17633301

llvm-svn: 213076
2014-07-15 17:14:34 +00:00
Joerg Sonnenberger cc43c85855 Don't create non-temporary twines.
llvm-svn: 213066
2014-07-15 12:18:40 +00:00
Joerg Sonnenberger 62277b37db Make sure int64_t and uint64_t are consistent.
llvm-svn: 213065
2014-07-15 11:51:38 +00:00
NAKAMURA Takumi 04b8b37f56 Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.
I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill.

llvm-svn: 213064
2014-07-15 11:37:03 +00:00
Joerg Sonnenberger be324f9832 Provide builtin macros as template for PRIab and SCNab, matching the
underlaying types.

llvm-svn: 213063
2014-07-15 11:30:00 +00:00
Daniel Jasper fcfac10c8a clang-format: Improve heuristic around avoiding bad line breaks.
Now, this can be properly formatted:
  static_cast<A< //
      B> *>(     //
      );

Before, clang-format could end up, not formatting the code at all.

llvm-svn: 213055
2014-07-15 09:00:34 +00:00
David Majnemer 6d4766535f AST: Don't walk all redeclarations when looking for a uuid attr
No funcionality changed, just a simplification of the existing code.

llvm-svn: 213044
2014-07-15 04:30:17 +00:00
Richard Smith 5e9e56a0a1 [modules] Rearrange and unify the way we determine if we need to pull in
redeclaration chains when pulling in a declaration. We need the redecl chain
unless we know some other declaration will trigger it to be pulled in; that
happens if our originally-canonical declaration had all the knowledge that
we have (and isn't us).

llvm-svn: 213043
2014-07-15 03:37:06 +00:00
Alexey Bataev 74a05c9445 [OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp single'.
llvm-svn: 213040
2014-07-15 02:55:09 +00:00
Ehsan Akhgari 833ed943d6 Don't get confused on the number of braces when braces start after the first __asm
Summary:
Without this, we would not consume the closing brace which would cause
the parser to start consuming C++ and bad things would happen.

Reviewers: majnemer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4505

llvm-svn: 213032
2014-07-15 02:21:41 +00:00
Justin Bogner 73466400b2 VirtualFileSystem: Correctly generate the mapping for an empty VFS
In r209332 I accidentally broke generation of empty VFS maps. This
fixes the issue and adds a test.

llvm-svn: 213028
2014-07-15 01:24:35 +00:00
Richard Smith 5a477c5e37 PR19751: (T())++ is not a cast-expression.
llvm-svn: 213022
2014-07-15 00:11:48 +00:00
David Majnemer 37de611c0f AST: Fix __uuidof for template specializations
While we previously supported __uuidof applied to a template
specialization, we would only find the uuid attribute if it was applied
to the template argument.  We would erroneously ignore the uuid
attribute on the specialization itself.

This is required to parse Windows Runtime C++ Template Library headers.

llvm-svn: 213016
2014-07-14 23:40:24 +00:00
Alp Toker 207c498978 Revert "Revert "Move clang feature flags settings out of LLVM core and into cfe""
It turns out this commit was fine. The problem was in the legacy build system (fixed r213010).

This reverts commit r213008.

llvm-svn: 213014
2014-07-14 23:28:38 +00:00
Richard Smith 9ef089dc97 Remove dead code.
llvm-svn: 213013
2014-07-14 23:25:30 +00:00
Alp Toker c3a7077068 Define ENABLE_CLANG_ARCMT in the legacy build system too
llvm-svn: 213010
2014-07-14 23:15:48 +00:00
David Majnemer 48b0863f52 AST: Cleanup __uuidof related code
Switch some things to use range-based for loops.
Change CXXUuidofExpr::GetUuidAttrOfType's return type to be const.
No functionality changed.

llvm-svn: 213009
2014-07-14 23:12:54 +00:00
Alp Toker 3be31a6319 Revert "Move clang feature flags settings out of LLVM core and into cfe"
Prospectively revert to get one of the many build configurations back working
(presumably the side-by-side+modular CMake config).

This reverts commit r212997.

llvm-svn: 213008
2014-07-14 23:10:07 +00:00
Kaelyn Takata 22101f9689 Continue parsing an expression list even after an error is encountered.
Otherwise, multiple errors such as having unknown identifiers for two
arguments won't be diagnosed properly (e.g. only the first one would
have a diagnostic message if typo correction fails even though both
would be diagnosed if typo correction suggests a replacement).

llvm-svn: 213003
2014-07-14 22:48:10 +00:00
Alp Toker 9a5665fc25 Move clang feature flags settings out of LLVM core and into cfe
llvm-svn: 212997
2014-07-14 22:17:26 +00:00
Alp Toker ccb9aa3586 Fix build with various feature flag combinations
llvm-svn: 212996
2014-07-14 22:17:22 +00:00
Alp Toker f55a306996 Fix the !CLANG_ENABLE_ARCMT build
llvm-svn: 212995
2014-07-14 22:17:16 +00:00
Ben Langmuir ba5bd0bed6 Try harder to supress the test from r212975 on Windows
The attempt in r212980 was broken because we might not fail if
LLVM_ON_UNIX is enabled for cross compiling to Windows, and it didn't
consider mingw either.

llvm-svn: 212989
2014-07-14 21:14:28 +00:00
Joerg Sonnenberger 9b7060e218 Drop separate UIntMaxType and just derive it from IntMaxType.
llvm-svn: 212987
2014-07-14 21:00:38 +00:00
Joerg Sonnenberger 3809a7a9f6 Introduce getCorrespondingUnsignedType() in TargetInfo to work like the
corresponding AST context function, only restricted to basic integer
types. Use this to ensure getUIntPtrType() gives types consistent with
getIntPtrType(). Fix NVPTX backend to give signed intptr_t.

llvm-svn: 212982
2014-07-14 20:40:56 +00:00
Ben Langmuir 2474e816cc XFAIL test that doesn't work on Windows yet
llvm-svn: 212980
2014-07-14 20:36:40 +00:00
Richard Smith b94afe1dd6 In C++98, if an rvalue reference binds to a function lvalue (or an xvalue or an
array prvalue), treat that as a direct binding. Only the class prvalue case
needs to be excluded here; the rest are extensions anyway, so we can treat them
as we would in C++11.

llvm-svn: 212978
2014-07-14 19:54:05 +00:00
Ben Langmuir 6b7f73451f Fix case-sensitivity of inferred framework modules
Just because we can open a directory named "COcoa.framework" doesn't
mean we should provide a "COcoa" module on a case-insensitive filesystem.

llvm-svn: 212975
2014-07-14 19:45:12 +00:00
Alp Toker 958027b698 Fix typos
Also consolidate 'backward compatibility'

llvm-svn: 212974
2014-07-14 19:42:55 +00:00
Alp Toker cd3acb5604 Avoid non-attributive uses of 'unsupported' in diagnostics
We don't have a style guide for diagnostic messages, but convention strongly
favours the forms:

  'attribute is not supported', 'unsupported attribute'

We generally avoid:

  'attribute is unsupported', 'non-supported attribute'

llvm-svn: 212972
2014-07-14 19:16:22 +00:00
Sylvestre Ledru 0e767b16f9 Document the forward of the -u option (r211756)
llvm-svn: 212969
2014-07-14 18:34:37 +00:00
Sylvestre Ledru 5e43f74d4c Document the warning triggered by the unsupported gcc optimization flags (r212805)
llvm-svn: 212968
2014-07-14 18:30:23 +00:00
Reid Kleckner c582f0137e Revert "Improve error recovery around colon."
This reverts commit r212957.  It broke the self-host on code like this
from LLVM's option library:
  for (auto Arg: filtered(Id0, Id1, Id2))

llvm-svn: 212965
2014-07-14 18:19:58 +00:00
Alp Toker 86f6934e27 Change the diagnostic group for unsupported gcc optimizations added r212805
Use -Winvalid-command-line-argument here to align with existing gcc opt
diagnostics. Meanwhile -Wunused-command-line-argument is for flags that we
support but were, say, fed into the wrong invocation.

Also tweak wording to make sense with -Werror.

llvm-svn: 212964
2014-07-14 18:11:38 +00:00
Serge Pavlov a88f27897a Improve error recovery around colon.
Recognize additional cases, when '::' is mistyped as ':'.
This is a fix to RP18587 - colons have too much protection in member-declarations.

Differential Revision: http://reviews.llvm.org/D3653

llvm-svn: 212957
2014-07-14 16:42:20 +00:00
David Majnemer ade4bee761 CodeGen: Let arrays be inputs to inline asm
An array showing up in an inline assembly input is accepted in ICC and
GCC 4.8

This fixes PR20201.

Differential Revision: http://reviews.llvm.org/D4382

llvm-svn: 212954
2014-07-14 16:27:53 +00:00
Yi Kong 472e521cec ARM: Add NOP intrinsic mapping in arm_acle.h
llvm-svn: 212950
2014-07-14 15:32:29 +00:00
Yi Kong 4d5e23f53a ARM: Implement __builtin_arm_nop intrinsic
This patch implements __builtin_arm_nop intrinsic for AArch32 and AArch64,
which generates hint 0x0, the alias of NOP instruction.

This intrinsic is necessary to implement ACLE __nop intrinsic.

Differential Revision: http://reviews.llvm.org/D4495

llvm-svn: 212947
2014-07-14 15:20:09 +00:00
Benjamin Kramer 09514492cc [ASTMatchers] Make hasOverloadedOperatorName also match freestanding overloads.
Freestanding overloads are represented as FunctionDecls in the AST, make
the matcher also match them.

Differential Revision: http://reviews.llvm.org/D4493

llvm-svn: 212940
2014-07-14 14:05:02 +00:00
Daniel Jasper 3064620d0d clang-format: Improve cast detection (fix false positive).
Before:
  fn(a)(b)+1;

After:
  fn(a)(b) + 1;

llvm-svn: 212935
2014-07-14 12:38:38 +00:00
Pavel Chupin 3362c5fb0f [x32] Add __ILP32__ macro for ILP32 platforms
Summary:
Add __ILP32__ and _ILP32 macro for corresponding platforms.
Cover x86_64-*-*-gnux32 with test.

Test Plan: test added

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, dschuff, zinovy.nis

Differential Revision: http://reviews.llvm.org/D4473

llvm-svn: 212931
2014-07-14 09:58:10 +00:00
NAKAMURA Takumi 23b702c8de [CMake] Update libdeps.
llvm-svn: 212920
2014-07-14 05:01:53 +00:00
NAKAMURA Takumi 4a070dc428 [CMake] Reorder libdeps by alphabetical order.
llvm-svn: 212919
2014-07-14 04:59:27 +00:00
Richard Smith 19172c4f70 Superficial fix for PR20218: binding a function lvalue to a const reference to
a function pointer is neither better nor worse than binding a function lvalue
to a function rvalue reference. Don't get confused and think that both bindings
are binding to a function lvalue (which would make the lvalue form win); the
const reference is binding to an rvalue.

The "real" bug in PR20218 is still present: we're getting the wrong answer from
template argument deduction, and that's what leads us to this weird overload
set.

llvm-svn: 212916
2014-07-14 02:28:44 +00:00
Pavel Chupin 10a8404771 Remove trailing spaces
llvm-svn: 212911
2014-07-13 17:11:45 +00:00
Yi Kong 19222dcb4c Add test cases for AArch64 hints codegen
llvm-svn: 212909
2014-07-13 16:17:30 +00:00
NAKAMURA Takumi 9b9de47d15 [CMake] Give explicit dependencies to a couple of modules, PrintFunctionNames and SampleAnalyzerPlugin, for Win32.DLL.
llvm-svn: 212906
2014-07-13 13:40:23 +00:00
NAKAMURA Takumi 6672b8e4ee PrintFunctionNames/CMakeLists.txt: Fix a comment.
llvm-svn: 212905
2014-07-13 13:38:55 +00:00
David Majnemer b2615aa44d MS ABI: Stick internal vftables in a comdat if they have RTTI data
Previously, we would have a private backing variable and an internal
alias pointing at it.

However, -fdata-sections only fires if a global variable has non-private
linkage.  This means that an unreferenced vftable wouldn't get
discarded, bloating the object file.

Instead, stick the backing variable in a comdat even if the alias has
internal linkage.  This will allow the linker to drop the vftable if it
is unused.

llvm-svn: 212901
2014-07-13 05:19:56 +00:00
Saleem Abdulrasool 3b165e7dbb tests: use a more precise target for tests
llvm-svn: 212892
2014-07-12 23:40:53 +00:00
Saleem Abdulrasool 07257fe14e Headers: add hint intrinsics to arm_acle.h
This adds the ARM ACLE hint intrinsic wrappers to arm_acle.h.  These need to be
protected with a !defined(_MSC_VER) since MSVC (and thus clang in compatibility
mode) provide these wrappers as proper builtin intrinsics.

llvm-svn: 212891
2014-07-12 23:27:26 +00:00
Saleem Abdulrasool 572250d60a CodeGen: support hint intrinsics from ACLE on AArch64
This adds support for the ACLE hint intrinsics on AArch64 similar to ARM.  This
is required to properly support ACLE on AArch64.

llvm-svn: 212890
2014-07-12 23:27:22 +00:00
Yi Kong 4e00ce7d0c Improve comments of ARM ACLE header file and tests
Include section number in ARM ACLE specification for easier navigation.

llvm-svn: 212887
2014-07-12 22:48:13 +00:00
Hal Finkel d8442b1b21 Add nonnull in CodeGen for __attribute__((returns_nonnull))
As a follow-up to r212835, also add the LLVM nonnull function attribute when
__attribute__((returns_nonnull)) is provided.

llvm-svn: 212874
2014-07-12 04:51:04 +00:00
Alexey Samsonov 15c9669615 [ASan] Collect unmangled names of global variables in Clang to print them in error reports.
Currently ASan instrumentation pass creates a string with global name
for each instrumented global (to include global names in the error report). Global
name is already mangled at this point, and we may not be able to demangle it
at runtime (e.g. there is no __cxa_demangle on Android).

Instead, create a string with fully qualified global name in Clang, and pass it
to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata
for some global, ASan will use the original algorithm.

This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264.

llvm-svn: 212872
2014-07-12 00:42:52 +00:00
Reid Kleckner fc31efe95a Require an x86 registered target for this test by splitting it out
This is a shot in the dark to fix the hexagon bot, so I'm not 100% sure
this is the issue.

llvm-svn: 212871
2014-07-12 00:40:59 +00:00
Reid Kleckner 681ae92083 clang-cl: Make all x86 CPU feature flags available, such as -msse3
Ideally, we would use the /arch cl.exe flag for this stuff.
Unfortunately, MSVC supports only 5 /arch flag values, which isn't
nearly enough to cover all the CPU features that LLVM cares about.  At
the very least, we need to know about SSE3 and SSE4.1 in addition to
SSE, SSE2, AVX, and AVX2.

In the future we should add the relevant /arch mappings in addition to
these gcc-style -m flags.

llvm-svn: 212869
2014-07-12 00:29:05 +00:00
Reid Kleckner f392ec6ecc Form a CallExpr from __noop without parens
MSVC accepts __noop without any trailing parens and treats it like a
literal zero.  We don't treat __noop as an integer literal, but now at
least we can parse a naked __noop expression.

Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D4476

llvm-svn: 212860
2014-07-11 23:54:29 +00:00
Argyrios Kyrtzidis baa97663c2 [Driver] clang::driver::getARMCPUForMArch() moved to llvm::Triple::getARMCPUForArch().
Depends on llvm r212846.
Suggested by Eric Christopher.

llvm-svn: 212858
2014-07-11 23:47:48 +00:00
Alp Toker 5d96e0a3a7 Consolidate header inclusion diagnostics
Make argument orders match, unify diagnostic IDs and reword the message to be a
little less saccharine.

llvm-svn: 212845
2014-07-11 20:53:51 +00:00
David Majnemer 9b21c33da4 CodeGen: Don't emit a thread-wrapper if we can't touch the backing variable
OS X TLS has all accesses going through the thread-wrapper function and
gives the backing thread-local variable internal linkage.  This means
that thread-wrappers must have WeakAnyLinkage so that references to the
internal thread-local variables do not get propagated to other code.

It also means that translation units which do not provide a definition
for the thread-local variable cannot attempt to emit a thread-wrapper
because the thread wrapper will attempt to reference the backing
variable.

Differential Revision: http://reviews.llvm.org/D4109

llvm-svn: 212841
2014-07-11 20:28:10 +00:00
Brad Smith 83510e70a9 oops. correct the prefix.
llvm-svn: 212840
2014-07-11 20:27:39 +00:00
Reid Kleckner ed5d4adb36 MS extension: Make __noop be the integer zero, not void
We still don't accept '__noop;', and we don't consider __noop to be the
integer literal zero.  More work is needed.

llvm-svn: 212839
2014-07-11 20:22:55 +00:00
Brad Smith 10cd0f457a Handle SPARC float command line parameters for SPARCv9.
llvm-svn: 212838
2014-07-11 20:12:08 +00:00
Richard Smith 547864d26a [modules] When merging a class template, also merge the definition of its pattern.
llvm-svn: 212836
2014-07-11 18:22:58 +00:00
Hal Finkel 82504f03ce Add nonnull in CodeGen for __attribute__((nonnull))
We now have an LLVM-level nonnull attribute that can be applied to function
parameters, and we emit it for reference types (as of r209723), but did not
emit it when an __attribute__((nonnull)) was provided. Now we will.

llvm-svn: 212835
2014-07-11 17:35:21 +00:00
Sylvestre Ledru 79e3da9653 Test for warning being silenced
Summary:
Added some tests to see if the new warning would be silenced with a flag.

Patch by Arthur Marble <arthur@info9.net> in the context of Debian Google Summer of code 2014.


Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

Differential Revision: http://reviews.llvm.org/D4475

llvm-svn: 212833
2014-07-11 17:23:13 +00:00
Aaron Ballman 6288d0648a The returns_nonnull attribute does not require a function prototype because it affects only the return value, not any arguments. In turn, asking for a function or method result type should not require a function prototype either, so getFunctionOrMethodResultType has been relaxed.
llvm-svn: 212827
2014-07-11 16:31:29 +00:00
NAKAMURA Takumi ad4c06c656 Instantiate llvm::Registry<clang::PluginASTAction> in FrontendAction.cpp.
- Plugins don't need to export _ZN4llvm8Registry*.
  - Win32.DLL cannot merge common symbols among DLLs. Static members in llvm::Registry should be instantiated in a parent.

llvm-svn: 212821
2014-07-11 15:06:24 +00:00
Zinovy Nis 3d16387413 [PATCH] [x32] Introduce -mx32 flag enforcing x32 mode for other triplets. By Pavel Chupin (@pavel.v.chupin).
-mx32 flag setup target environment to GNUX32 and can be used for 
other 32/64-bit triplets (i386-unknown-linux, x86_64-unknown-linux) to
turn on x32 mode. Compatible with GCC -mx32 flag.

Differential Revision: http://reviews.llvm.org/D4470

llvm-svn: 212817
2014-07-11 14:28:45 +00:00
Sylvestre Ledru 1028ae7441 Tiny improvement in a test (missing quote)
llvm-svn: 212806
2014-07-11 11:53:18 +00:00
Sylvestre Ledru 2fe501eef9 GCC compatibility: Create a Group to ignore unsupported optimization.
Returns a warning when using an unknown optimization flag.
This patch includes -finline-limit as one of those ignored flags.
More options will be moved in this group

Patch by Arthur Marble <arthur@info9.net> in the context of
Debian Google Summer of code 2014.

Reviewers: rnk, Sylvestre
llvm-svn: 212805
2014-07-11 11:43:57 +00:00
Alexey Bataev 9c2e8ee72f [OPENMP] Parsing and sema analysis for 'omp task' directive.
llvm-svn: 212804
2014-07-11 11:25:16 +00:00
Ben Langmuir e013bdc2e7 Don't assume StringRef.data() is null-terminated
llvm-svn: 212790
2014-07-11 00:43:47 +00:00
NAKAMURA Takumi 5787cc2ccf TestAfterDivZeroChecker.cpp: Avoid member initializer. It is unsupported in msc17.
llvm-svn: 212789
2014-07-11 00:32:35 +00:00
Richard Smith dc5523d38f [modules] Don't try to merge template specializations by performing name lookup
into their container; we won't find them there. These things are already being
merged when they're added to their primary template's folding set, so this
merging is redundant (and causes us to reject-valid because we think we've
found an odr violation).

llvm-svn: 212788
2014-07-11 00:20:06 +00:00