Commit Graph

38422 Commits

Author SHA1 Message Date
David Majnemer 380443a2ac Sema: Variable templates cannot be static bitfield members
We correctly forbid variables but not variable templates.  Diagnose this
case instead of crashing.

llvm-svn: 224905
2014-12-28 22:51:45 +00:00
David Majnemer 06039218f5 Parse: Don't crash when 'typename' shows up in an attribute
isDeclarationSpecifier performs error recovers which jostles the token
stream.  Specifically, TryAnnotateTypeOrScopeToken will end up consuming
a typename token which will confuse the attribute parsing machinery as
we no-longer have something identifier-like.

llvm-svn: 224903
2014-12-28 22:28:32 +00:00
David Majnemer 3087a2b949 Sema: Permit an atomic type to be initialized by the same atomic type
We forgot a conversion step when initializing an atomic type with an
rvalue of the same type.

This fixes PR22043.

llvm-svn: 224902
2014-12-28 21:47:31 +00:00
David Majnemer 738e58799c Sema: Don't crash when an inject class name has a nested redefinition
We expected the type of a TagDecl to be a TagType, not an
InjectedClassNameType.  Introduced a helper method, Type::getAsTagDecl,
to abstract away the difference; redefine Type::getAsCXXRecordDecl to be
in terms of it.

llvm-svn: 224898
2014-12-28 09:18:54 +00:00
David Majnemer f2d3bc0474 Lex: Don't let annotation tokens get into macro expansion
We'd let annotation tokens from '#pragma pack' and the like get inside a
function-like macro.  This would lead to terror and mayhem; stop the
madness early.

This fixes PR22037.

llvm-svn: 224896
2014-12-28 07:42:49 +00:00
Nico Weber 3fc6a28c34 Remove unneeded include of DeclCXX.h from libParse.
llvm-svn: 224893
2014-12-28 01:52:28 +00:00
Nico Weber ff4b35e6e7 Objective-C: Serialize "more than one decl" state of ObjCMethodList.
This fixes PR21587, what r221933 fixed for regular programs is now also
fixed for decls coming from PCH files.

Use another bit from the count/bits uint16_t for storing the "more than one
decl" bit.  This reduces the number of bits for the count from 14 to 13.
The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits
should still be plenty.  Since this changes the meaning of a serialized bit
pattern, also increase clang::serialization::VERSION_MAJOR.

Storing the "more than one decl" state of only the first overload isn't quite
correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at
the state of the first overload so it's good enough for now.

llvm-svn: 224892
2014-12-27 22:14:15 +00:00
Chandler Carruth 28daca211c [x86] Also add the missing type casts on the returns in the sha
intrinsic header file. Along with r224822, this should restore the build
bots to passing.

llvm-svn: 224883
2014-12-27 11:50:51 +00:00
Craig Topper ab70789199 [x86] Add missing typecast to __v4si to sha intrinsic header file.
llvm-svn: 224882
2014-12-27 07:19:25 +00:00
Nico Weber e3b11043d0 Objective-C: Tweak unavailability warning.
Don't warn when a selector has an unavailable and an available variant,
and the first also has an implementation.

llvm-svn: 224881
2014-12-27 07:09:37 +00:00
Craig Topper dd84ec5fd9 [x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.
llvm-svn: 224880
2014-12-27 07:00:08 +00:00
Craig Topper 2094d8fe88 [x86] Add the (v)cmpps/pd/ss/sd builtins to match gcc. Use them in the sse intrinsic files.
This still lower to the same intrinsics as before.

This is preparation for bounds checking the immediate on the avx version of the builtin so we don't pass illegal immediates into the backend. Since SSE uses a smaller size immediate its not possible to bounds check when using a shared builtin. Rather than creating a clang specific builtin for the different immediate, I decided (after consulting with Chandler) that it was better to match gcc.

llvm-svn: 224879
2014-12-27 06:59:57 +00:00
Craig Topper a31a5da904 Fix formatting. NFC.
llvm-svn: 224877
2014-12-27 06:59:37 +00:00
Nico Weber 2e0c8f79d9 Address review feedback on r221933.
Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in
the low bit of the ObjCMethodDecl pointer, using a PointerIntPair.

Most of this patch is replacing ".Method" with ".getMethod()".

No intended behavior change.

llvm-svn: 224876
2014-12-27 03:58:08 +00:00
David Majnemer 3e7743ed2c WIP
llvm-svn: 224843
2014-12-26 06:06:53 +00:00
Yaron Keren 2f5ec2f2ba Initialize BackendConsumer::Context in constructor.
llvm-svn: 224836
2014-12-25 12:21:56 +00:00
Yaron Keren 5fb94242bb Initialize CodeGeneratorImpl::Ctx in constructor.
llvm-svn: 224835
2014-12-25 11:38:15 +00:00
Nico Weber 007215044b Add driver flags -ftrigraphs, -fno-trigraphs.
-trigraphs is now an alias for -ftrigraphs.  -fno-trigraphs makes it possible
to explicitly disable trigraphs, which couldn't be done before.

  clang -std=c++11 -fno-trigraphs

now builds without GNU extensions, but with trigraphs disabled.  Previously,
trigraphs were only disabled in GNU modes or with -std=c++1z.

Make the new -f flags the cc1 interface too.  This requires changing -trigraphs
to -ftrigraphs in a few cc1 tests.

Related to PR21974.

llvm-svn: 224790
2014-12-23 22:32:37 +00:00
Adrian Prantl ee24e14bdc Debug Info: Pass the pointer size into createMemberPointerType().
Paired commit with LLVM.

llvm-svn: 224781
2014-12-23 19:11:54 +00:00
Rafael Espindola 43eba818cd This reverts commit r224668 and r224667.
r224667 broke bootstrap on Fedora 20 X86_64 (at least).

See pr22006 for the details.

r224668 depends on r224667.

llvm-svn: 224770
2014-12-23 15:57:12 +00:00
Nico Weber b62ba516e7 Disable trigraphs in microsoft mode by default. Matches cl.exe.
The default value of Opts.Trigraphs now no longer depends solely on the
language input kind, so move the code out of setLangDefaults().  Also make
sure that Opts.MSVCCompat is set before the Trigraph code runs.

Related to PR21974.

llvm-svn: 224719
2014-12-22 18:35:03 +00:00
David Majnemer 07bc611fb3 MS ABI: Make the string mangling code more concise
No functional change intended.

llvm-svn: 224696
2014-12-22 06:24:49 +00:00
Nico Weber 4701ffda95 Wrap to 80 columns. NfC.
llvm-svn: 224695
2014-12-22 05:21:03 +00:00
Bob Wilson 23a55f1eee Reapply "Change -save-temps to emit unoptimized bitcode files."
This reapplies r224503 along with a fix for compiling Fortran by having the
clang driver invoke gcc (see r224546, where it was reverted). I have added
a testcase for that as well.

Original commit message:
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.

This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.

Based in part on a patch by Steven Wu.
rdar://problem/18909437

llvm-svn: 224688
2014-12-21 07:00:00 +00:00
Logan Chien 968a21de24 Frontend: Fix typo in comments.
llvm-svn: 224680
2014-12-20 08:51:22 +00:00
Richard Trieu 2cb463ed08 Fix a bunch of integer template argument problems in template type diffing.
Reverts most of the changes from r168005.  Since template arguments have proper
conversions now, no extending of integers is needed.  Further, since the
integers are the correct size now, use APSInt::operator== instead of
APSInt::hasSameValue since operator== will check the size and signness match.

Prior to one comparison of APSInt's, check that both are valid.  Previous, one
could be uninitialized.  Also changed APInt to APSInt in GetInt.  This
occassionally produced a sign flip, which will now be caught by operator==.

llvm-svn: 224668
2014-12-20 03:03:32 +00:00
Richard Trieu d787e8dc9d Fix for PR21758
When a non-type template argument expression needs a conversion to change it
into the argument type, preserve that information by remaking the
TemplateArgument with an expression that has those conversions.  Also a small
fix to template type diffing to handle the extra conversions in some cases.

llvm-svn: 224667
2014-12-20 02:42:08 +00:00
Aaron Ballman a7a715698a Removing an outdated FIXME; try block attributes are parsed with the rest of the statement attributes (as per the standard), and function-try-blocks may not have attributes. NFC.
llvm-svn: 224662
2014-12-20 01:54:07 +00:00
Saleem Abdulrasool 9a215461f1 Driver: hoist an assertion
Remove an unnecessary conditional, hoisting the assertion.  Minor style
tweaks/reflowing.  NFC.

llvm-svn: 224654
2014-12-19 23:56:31 +00:00
Saleem Abdulrasool 21b1876dd2 Driver: refactor a local variable
Pull out a getToolChain() into a local variable to share the call across to all
the uses.  NFC.

llvm-svn: 224653
2014-12-19 23:56:28 +00:00
Nico Weber e497438c9c Don't drop attributes when checking explicit specializations.
Consider a template class with attributes on a method, and an explicit
specialization of that method:

    template <int>
    struct A {
      void foo() final;
    };

    template <>
    void A<0>::foo() {}

In this example, the attribute is `final`, but it might also be an
__attribute__((visibility("foo"))), noreturn, inline, etc. clang's current
behavior is to strip all attributes, which for some attributes is wrong
(the snippet above allows a subclass of A<0> to override the final method, for
example) and for others disagrees with gcc.

So stop dropping attributes. r95845 added this code without a test case, and
r176728 added the code for dropping attributes on parameters (with tests, but
they still pass).

As an additional wrinkle, do drop dllimport and dllexport, since that's how
these two attributes work. (This is covered by existing tests.)

Fixes PR21942.

The approach is by Richard Smith, initial analysis and typing was done by me.

With this, clang also matches GCC and EDG on all attributes Richard tested.

llvm-svn: 224651
2014-12-19 23:52:45 +00:00
Hans Wennborg 0c0a8c868c Tweak the assert in ModuleBuilder from r224533 (PR21989)
Turns out there will be left-over deferred inline methods if there have
been errors, because in that case HandleTopLevelDecl bails out early.

llvm-svn: 224649
2014-12-19 23:35:11 +00:00
Richard Smith 5a0e50cd87 DR1048: drop top-level cv-qualifiers when deducing the return type of a
lambda-expression in C++11, to match the C++14 rules.

llvm-svn: 224620
2014-12-19 22:10:51 +00:00
Alexey Samsonov abd5bead3f Allow to disable all sanitizers with "-fno-sanitize=all" option.
Summary:
This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all"
can be used to disable all sanitizers for a given source file.

"-fsanitize=all" option makes no sense, and will produce an error.

This group can also be useful when we add "-fsanitize-recover=<list>"
options (patch in http://reviews.llvm.org/D6302), as it would allow
to conveniently enable/disable recovery for all specified sanitizers.

Test Plan: regression test suite

Reviewers: kcc, rsmith

Subscribers: cfe-commits

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

llvm-svn: 224596
2014-12-19 18:41:43 +00:00
Aaron Ballman 9b7cee666b Added a fixit to remove empty parens from a C++11 attribute argument list when we diagnose this as an error.
llvm-svn: 224595
2014-12-19 18:37:22 +00:00
Pekka Jaaskelainen e94b0e1870 Fix an address space id reset with array decay's
implicit conversion. 

The issue was produced with OpenCL C code that 
called a function with a constant string literal
argument.

llvm-svn: 224592
2014-12-19 18:04:27 +00:00
Aaron Ballman 55ef151502 Attributes accepting an EnumArgument are allowed to pass a string literal, or an identifier. VariadicEnumArguments now behave consistently instead of only accepting a string literal.
This change affects the only attribute accepting a variadic enumeration: callable_when.

llvm-svn: 224582
2014-12-19 16:42:04 +00:00
Alexey Samsonov 799f79337f [Sanitizer] Get rid of parseArgument helper function. NFC.
llvm-svn: 224564
2014-12-19 02:35:16 +00:00
David Majnemer ce1d30142c Fix layering violation, Lex shouldn't know about Decl
llvm-svn: 224562
2014-12-19 02:13:56 +00:00
Richard Smith a865a1683a PR21969: Improve diagnostics for a conversion function that has any pieces of a
declared return type (including a trailing-return-type in C++14).

llvm-svn: 224561
2014-12-19 02:07:47 +00:00
Kaelyn Takata 9112607400 Correct delayed typos in the operand to typeof expressions.
Fixes PR21947.

llvm-svn: 224558
2014-12-19 01:28:40 +00:00
Adrian Prantl 97f7685516 Fix a typo.
llvm-svn: 224557
2014-12-19 01:02:11 +00:00
Fariborz Jahanian 0fc95ad758 [c Sema]. Patch fixes pointer-bool-conversion warning on C code
when source range is incorrect causing the warning to be
issued when it should not because expression is in a macro.
rdar://19256338

llvm-svn: 224549
2014-12-18 23:14:51 +00:00
Reid Kleckner da0acc816c Revert "Change -save-temps to emit unoptimized bitcode files."
This reverts commit r224503.

It broke compilation of fortran through the Clang driver. Previously
`clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it
tries to call `clang -cc1 t.f` which fails for obvious reasons.

llvm-svn: 224546
2014-12-18 23:07:04 +00:00
Hans Wennborg 2b0d014834 ModuleBuilder: assert that all deferred inline method defs get handled
While we're here, also move the declaration of DeferredInlineMethodDefinitions
closer to the other member vars and make it a SmallVector. NFC.

llvm-svn: 224533
2014-12-18 19:19:00 +00:00
Reid Kleckner 034531d7af Revert "Don't build invalid AST nodes during recovery"
This reverts commit r224451. It caused us to reject some valid existing
code.

This code appears to run in non-error cases as well as error cases. If
the scope of a DependentScopeDeclRefExpr is still incomplete it probably
means we still have more instantiation to do.

llvm-svn: 224526
2014-12-18 18:17:42 +00:00
Fariborz Jahanian 661a97bede [Objective-C]. Patch to unify code generation for ObjCMsgSend and ObjCBoxedExpr.
Patch by Alex Denisov. NFC.

llvm-svn: 224525
2014-12-18 17:13:56 +00:00
Richard Barton 2c5a89728d Correction to -mfu=neon-vfpv4 to pass the correct backend feature name
Change-Id: I4dbfe1d97670fc4e626368ef1f91fc008778dfca
llvm-svn: 224523
2014-12-18 16:31:18 +00:00
Daniel Jasper 3a623dbd2a clang-format: Fix incorrect detection of ObjC "in" keyword.
Before:
  for (auto v : in [1]) { ..

After:
  for (auto v : in[1]) { ..

llvm-svn: 224513
2014-12-18 12:11:01 +00:00
Serge Pavlov 07c0f04e08 Fixed warnings on redefine keywords and reserved ids.
Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro.
The warning -Wkeyword-macro now is not issued in patterns that are used
in configuration scripts:

    #define inline

also for 'const', 'extern' and 'static'. If macro repalcement is identical
to macro name, the warning also is not issued:

    #define volatile volatile

And finally if macro replacement is also a keyword identical to the replaced
one but decorated with leading/trailing underscores:

    #define inline __inline
    #define inline __inline__
    #define inline _inline // in MSVC compatibility mode

Warning -Wreserved-id-macro is off by default, it could help catching
things like:

    #undef __cplusplus

llvm-svn: 224512
2014-12-18 11:14:21 +00:00
David Majnemer 2d3663e559 Parse: Don't parse after the eof has been consumed
ParseCXXNonStaticMemberInitializer stashes away all the tokens for the
initializer and an additional EOF token to denote where the initializer
ends.  However, it is possible for ParseLexedMemberInitializer to get
its hands on the "real" EOF token; since the two tokens are
indistinguishable, we end up consuming the EOF and descend into madness.

Instead, make it possible to tell which EOF token we are looking at.

This fixes PR21872.

llvm-svn: 224505
2014-12-18 09:57:31 +00:00
Alexey Bataev 7cb1789011 Fix for PR21915: assert on multidimensional VLA in function arguments.
Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA
Differential Revision: http://reviews.llvm.org/D6655

llvm-svn: 224504
2014-12-18 06:54:53 +00:00
Bob Wilson f5ba8288ad Change -save-temps to emit unoptimized bitcode files.
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.

This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.

Based in part on a patch by Steven Wu.
rdar://problem/18909437

llvm-svn: 224503
2014-12-18 06:08:26 +00:00
Eric Christopher 526ca20011 Update for llvm front end change and use the TargetOptions struct
for ABI.

llvm-svn: 224493
2014-12-18 02:23:27 +00:00
Eric Christopher 560cc4fb44 Make sure that arm-linux-gnu is still the apcs-gnu ABI when we
use clang -cc1 matching the front end and backend. Fix up a couple
of tests that were testing aapcs for arm-linux-gnu.

The test that removes the aapcs abi calling convention removes
them because the default triple matches what the backend uses
for the calling convention there and so it doesn't need to be
explicitly stated - see the code in TargetInfo.cpp.

llvm-svn: 224491
2014-12-18 02:08:55 +00:00
Eric Christopher 7a8b31d631 Reinstate aapcs as the default arm abi.
llvm-svn: 224490
2014-12-18 02:08:51 +00:00
Duncan P. N. Exon Smith c8ee63e2d0 CGDebugInfo: Use DIBuilder API for self-referencing DICompositeTypes
Use new `DIBuilder` API from LLVM r224482 to mutate `DICompositeType`s,
rather than changing them directly.  This allows `DIBuilder` to track
otherwise orphaned cycles when `CollectContainingType()` creates a
self-reference.

Fixes PR21941.

llvm-svn: 224483
2014-12-18 00:48:56 +00:00
Reid Kleckner ae628965c4 Fix diagnostic for static methods referencing fields from using decls
Previously we thought the instance member was a function, not a field,
and we'd say something silly like:
  t.cpp:4:27: error: call to non-static member function without an object argument
    static int f() { return n; }
                            ^

Noticed in PR21923.

llvm-svn: 224480
2014-12-18 00:42:51 +00:00
Justin Bogner 8e015ff43b InstrProf: Simplify/reduce state in CoverageMapping (NFC)
This state object makes things harder to reason about and isn't really
useful, since we can just emit the mappings before the state changes
rather than holding on to it.

llvm-svn: 224476
2014-12-17 23:55:04 +00:00
Rafael Espindola d1cdcb2377 Revert "Put static local variables of inline functions in the function comdat."
This reverts commit r224369.

Thanks to Reid Kleckner for pointing out that we need a bigger gun to fix this
case.

llvm-svn: 224475
2014-12-17 23:49:22 +00:00
Reid Kleckner af9bf59ba9 Don't assume friended C++ method decls have qualifiers
There are a few cases where unqualified lookup can find C++ methods.
Unfortunately, none of them seem to have illegal access paths, so I
can't excercise the diagnostic source range code that I am changing
here.

Fixes PR21851, which was a crash on valid.

llvm-svn: 224471
2014-12-17 23:40:46 +00:00
Aaron Ballman 6c93b3e29c Adding a -Wunused-value warning for expressions with side effects used in an unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case.
llvm-svn: 224465
2014-12-17 21:57:17 +00:00
Kostya Serebryany 78df9d03fa [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, clang part
llvm-svn: 224462
2014-12-17 21:46:33 +00:00
Richard Smith d663fdd216 [c++1z] Fixes for generalized non-type template argument support: check for
exact type match for deduced template arguments, and be sure to produce correct
canonical TemplateArgument representations to enable correct redeclaration
matching.

llvm-svn: 224456
2014-12-17 20:42:37 +00:00
Reid Kleckner dccbabfacf Destroy the diagnostic client first in ~DiagnosticEngine
Add a comment and a test to ~DiagnosticEngine about the ordering
requirements on the teardown of DiagnosticConsumer. This could also be
accomplished by rearranging the fields of ~DiagnosticEngine, but I felt
that this was a better, more explicit solution.

This fixes PR21911, an issue that occurred after the unique_ptr
migration in r222193.

llvm-svn: 224454
2014-12-17 20:23:11 +00:00
Reid Kleckner 8d7aac8406 Don't build invalid AST nodes during recovery
A DependentScopeDeclRefExpr should always have a nested name specifier.
During template instantiation, if we found that the named context was
incomplete, we would previously build a DependentScopeDeclRefExpr with
an empty qualifier.

This error recovery path has been asserting for some time. The other
error codepaths use ExprError, so we can do the same.

Fixes PR21864.

llvm-svn: 224451
2014-12-17 19:34:15 +00:00
Richard Smith 513955c487 Support constant evaluation for member calls on std::initializer_list
temporaries.

llvm-svn: 224449
2014-12-17 19:24:30 +00:00
David Blaikie 06b2c54db9 Revert "DebugInfo: Generalize debug info location handling"
Fails an ASan bootstrap - I'll try to reproduce locally & sort that out
before recommitting.

This reverts commit r224385.

llvm-svn: 224441
2014-12-17 18:02:04 +00:00
Saleem Abdulrasool 86b881c63e CodeGen: implement __emit intrinsic
For MSVC compatibility, add the `__emit' builtin. This is used in the Windows
SDK headers, and must therefore be implemented as a builtin rather than an
intrinsic.

The `__emit' builtin provides a mechanism to emit a 16-bit opcode instruction
into the stream. The value must be a compile time constant expression. No
guarantees are made about the CPU and memory states after the execution of the
instruction.

Due to the unchecked nature of the builtin, only support this on Windows on ARM.

llvm-svn: 224438
2014-12-17 17:52:30 +00:00
Yaron Keren c6328f1dcb Rangify for loop, NFC.
llvm-svn: 224434
2014-12-17 16:56:54 +00:00
NAKAMURA Takumi eca08380ce s/ScheduleKind/SchedKind/ in \param. [-Wdocumentation]
llvm-svn: 224431
2014-12-17 14:47:06 +00:00
NAKAMURA Takumi e9ac8b4d63 Exclude printLineState() in -Asserts. [-Wunused-function]
llvm-svn: 224430
2014-12-17 14:46:56 +00:00
Toma Tabacu 9941195a9f [mips] Always clobber $1 for MIPS inline asm.
Summary:
Because GCC doesn't use $1 for code generation, inline assembly code can use $1 without having to add it to the clobbers list.

LLVM, on the other hand, does not shy away from using $1, and this can cause conflicts with inline assembly which assumes GCC-like code generation.

A solution to this problem is to make Clang automatically clobber $1 for all MIPS inline assembly.
This is not the optimal solution, but it seems like a necessary compromise, for now.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: cfe-commits

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

llvm-svn: 224428
2014-12-17 12:02:58 +00:00
Daniel Jasper 0580ff0ec6 clang-format: Fix incorrect calculation of token lenghts.
This led, e.g. to break JavaScript regex literals too early.

llvm-svn: 224419
2014-12-17 09:11:08 +00:00
David Majnemer 4d2de1b03f Sema: Don't dyn_cast a null pointer in CheckUsingDeclQualifier
This code was written with the intent that a pointer could be null but
we dyn_cast'd it anyway.  Change the dyn_cast to a dyn_cast_or_null.

This fixes PR21933.

llvm-svn: 224411
2014-12-17 02:41:36 +00:00
David Majnemer 6ca445e0dd Parse: Consume tokens more carefully in CheckForLParenAfterColonColon
We would consume the lparen even if it wasn't followed by an identifier
or a star-identifier pair.

This fixes PR21815.

llvm-svn: 224403
2014-12-17 01:39:22 +00:00
Anna Zaks 87d404d458 [CallGraph] Make sure the edges are not missed due to re-declarations
A patch by Daniel DeFreez!

We were previously dropping edges on re-declarations. Store the
canonical declarations in the graph to ensure that different
references to the same function end up reflected with the same call graph
node.

(Note, this might lead to performance fluctuation because call graph
is used to determine the function analysis order.)

llvm-svn: 224398
2014-12-17 00:34:07 +00:00
David Blaikie 0317bc9e55 PR21909: Don't try (and crash) to generate debug info for explicit instantiations of explicit specializations.
llvm-svn: 224394
2014-12-16 23:49:18 +00:00
Richard Smith d52186ff5a DR1684: a constexpr member function need not be a member of a literal class type.
llvm-svn: 224388
2014-12-16 23:12:52 +00:00
Kaelyn Takata 938204aa02 Try typo correction on all initialization arguments and be less
pessimistic about when to do so.

This also fixes PR21905 as the initialization argument was no longer
viewed as being type dependent due to the TypoExpr being type-cast.

llvm-svn: 224386
2014-12-16 23:07:00 +00:00
David Blaikie bf22a4eaee DebugInfo: Generalize debug info location handling
This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.

This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.

I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.

Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.

I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.

llvm-svn: 224385
2014-12-16 22:49:17 +00:00
Nick Lewycky 4d59b77883 Look at whether TransformTypos returned a different Expr instead of looking at the number of uncorrected typos before and after. Correcting one typo may produce an expression with another TypoExpr in it, leading to matching counts even though a typo was corrected.
Fixes PR21925!

llvm-svn: 224380
2014-12-16 22:02:06 +00:00
Rafael Espindola fd8de1c3ae Fix handling of invalid -O options.
We were checking the value after truncating it to a bitfield.

Thanks to Yunzhong Gao for noticing it.

llvm-svn: 224378
2014-12-16 21:57:03 +00:00
Nick Lewycky 39f9dbc877 Fix typo in comment. NFC.
llvm-svn: 224377
2014-12-16 21:48:39 +00:00
Nick Lewycky 246532627e Add a new flag, -fspell-checking-limit=<number> to control how many times we'll do spell checking. Note that spell checking will change the produced AST, so we don't automatically change this value when someone sets -ferror-limit=. With this, merge test typo-correction-pt2.cpp into typo-correction.cpp.
Remove Sema::UnqualifiedTyposCorrected, a cache of corrected typos. It would only cache typo corrections that didn't provide ValidateCandidate of which there were few left, and it had a bug when we had the same identifier spelled wrong twice. See the last two tests in typo-correction.cpp for cases this fires.

llvm-svn: 224375
2014-12-16 21:39:02 +00:00
Nico Weber 92c14bb2ff Move -Wkeyword-macro into -pedantic, remove -Wreserved-id-macro.
As discussed on the post-commit review thread for r224012, -Wkeyword-macro fires
mostly on headers trying to set up portable defines and doesn't find much bad
stuff in practice.  But [macro.names]p2 does disallow defining or undefining
keywords, override and final, and alignas, so keep the warning but move it
into -pedantic.

-Wreserved-id-macro warns on

    #define __need_size_t

which is more or less public api for glibc headers. Since this warning isn't
motivated by a standard, remove it.

(See also r223114 for a previous follow-up to r224012.)

llvm-svn: 224371
2014-12-16 21:16:10 +00:00
Rafael Espindola ce4757b8e7 Put static local variables of inline functions in the function comdat.
The variable (and the GV) is only ever used if the function is. Putting it
in the function's comdat make it easier for the linker to discard them.

The motivating example is

struct S {
  static const int x;
};
// const int S::x = 42;
inline const int *f() {
  static const int y = S::x;
  return &y;
}
const int *g() { return f(); }

With S::x commented out, _ZZ1fvE1y is a variable with a guard variable
that is initialized by f.

With S::x present, _ZZ1fvE1y is a constant.

llvm-svn: 224369
2014-12-16 21:00:30 +00:00
Jacques Pienaar 5bdd67778f Consider calls from implict host device functions as valid in SemaCUDA.
In SemaCUDA all implicit functions were considered host device, this led to
errors such as the following code snippet failing to compile:

struct Copyable {
  const Copyable& operator=(const Copyable& x) { return *this; }
};

struct Simple {
  Copyable b;
};

void foo() {
  Simple a, b;

  a = b;
}

Above the implicit copy assignment operator was inferred as host device but
there was only a host assignment copy defined which is an error in device
compilation mode.

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

llvm-svn: 224358
2014-12-16 20:12:38 +00:00
Alexey Bataev 07649fb7c5 Renamed RefersToEnclosingLocal bitfield to RefersToCapturedVariable.
Bitfield RefersToEnclosingLocal of Stmt::DeclRefExprBitfields renamed to RefersToCapturedVariable to reflect latest changes introduced in commit 224323. Also renamed method Expr::refersToEnclosingLocal() to Expr::refersToCapturedVariable() and comments for constant arguments.
No functional changes.

llvm-svn: 224329
2014-12-16 08:01:48 +00:00
Alexey Bataev f841bd9fcd [OPENMP] Bugfix for processing of global variables in OpenMP regions.
Currently, if global variable is marked as a private OpenMP variable, the compiler crashes in debug version or generates incorrect code in release version. It happens because in the OpenMP region the original global variable is used instead of the generated private copy. It happens because currently globals variables are not captured in the OpenMP region.
This patch adds capturing of global variables iff private copy of the global variable must be used in the OpenMP region.
Differential Revision: http://reviews.llvm.org/D6259

llvm-svn: 224323
2014-12-16 07:00:22 +00:00
David Majnemer e7029bce82 Sema: Don't crash converting to bool from _Atomic
Turning our _Atomic L-value into an R-value removes its _Atomic-ness.
However, we didn't update our 'FromType' which made
ScalarTypeToBooleanCastKind think we were trying to pass it a
non-scalar.

This fixes PR21836.

llvm-svn: 224322
2014-12-16 06:31:17 +00:00
Nick Lewycky f0202ca775 Improve handling of value dependent expressions in __attribute__((enable_if)), both in the condition expression and at the call site. Fixes PR20988!
llvm-svn: 224320
2014-12-16 06:12:01 +00:00
David Majnemer 9963adeaef AST: Fix the linkage of static vars in fn template specializations
We that static variables in function template specializations were
externally visible.  The manglers assumed that externally visible static
variables were numbered in Sema.  We would end up mangling static
variables in the same specialization with the same mangling number which
would give all of them the same name.

This fixes PR21904.

llvm-svn: 224316
2014-12-16 04:52:14 +00:00
Hans Wennborg 45810b4631 Clarify the code in checkDLLAttribute()
Update the comments to make it more clear what's going on, and address
Richard's comments from PR21718. This doesn't fix that bug, but hopefully
makes the code easier to understand.

llvm-svn: 224303
2014-12-16 01:15:01 +00:00
David Majnemer e64941fa60 Sema: Check value dependent casts when possible
We know that const_cast<char *>((void)Something) is ill-formed, even if
'Something' is dependent because you can't cast from void to a pointer
type.

This fixes PR21845.

llvm-svn: 224299
2014-12-16 00:46:30 +00:00
Reid Kleckner d61a311010 Diagnose function template definitions inside functions
The parser can only be tricked into parsing a function template
definition by inserting a typename keyword before the function template
declaration. This used to make us crash, and now it's fixed.

While here, remove an unneeded boolean parameter from ParseDeclGroup.
This boolean always corresponded to non-typedef declarators at file
scope. ParseDeclGroup already has precise diagnostics for the function
definition typedef case, so we can let that through.

Fixes PR21839.

llvm-svn: 224287
2014-12-15 23:16:32 +00:00
Reid Kleckner aac43c6a77 Handle errors in lambda prototype instantiation correctly
Previously we would attempt to build a TypeSourceInfo for a null type,
and then we would forget to pop the function scope before returning an
error.

Reviewers: rsmith

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

llvm-svn: 224271
2014-12-15 21:07:16 +00:00
Daniel Marjamaki 368590094a Sema: Cleanup and improve string-plus-char checking.
Patch by Anders Rönnholm

llvm-svn: 224268
2014-12-15 20:22:33 +00:00
Paul Robinson 30e41fb4da Warn when attribute 'optnone' conflicts with attributes on a
different declaration of the same function.

llvm-svn: 224256
2014-12-15 18:57:28 +00:00
Samuel Benzaquen b405c08bdb Add voidType() matcher.
Summary: Add voidType() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 224250
2014-12-15 15:09:22 +00:00
David Majnemer 7e21745e22 Sema: Don't diagnose string + int if the int is value dependent
Don't send a value dependent expression into the expression evaluator,
HandleSizeof would crash.  Making HandleSizeof handle dependent types
would noisily warn about the operation even if everything turns out OK
after instantiation.

This fixes PR21848.

llvm-svn: 224240
2014-12-15 10:00:35 +00:00
David Majnemer d616362fe3 Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacro
We would CreateString on arbitrary garbage instead of just skipping to
the end of the builtin macro.  Eventually, this would cause us to crash
because we would end up replacing the contents of a character token with
a numeric literal.

This fixes PR21825.

llvm-svn: 224238
2014-12-15 09:03:58 +00:00
David Majnemer 418ad3ff10 Sema: Don't leave switch stack inconsistent when recovering
We would exit Sema::ActOnFinishSwitchStmt early if we didn't have a
body.  This would leave an extra SwitchStmt on the SwitchStack.

This fixes PR21841.

llvm-svn: 224237
2014-12-15 07:46:12 +00:00
Alexander Musman c638868bdf First patch with codegen of the 'omp for' directive. It implements
the simplest case, which is used when no chunk_size is specified in
the schedule(static) or no 'schedule' clause is specified - the
iteration space is divided by the library into chunks that are
approximately equal in size, and at most one chunk is distributed
to each thread. In this case, we do not need an outer loop in each
thread - each thread requests once which iterations range it should
handle (using __kmpc_for_static_init runtime call) and then runs the
inner loop on this range.

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

llvm-svn: 224233
2014-12-15 07:07:06 +00:00
Alexey Bataev 452d8e1133 Bugfix for Codegen of atomic load/store/other ops.
Currently clang fires assertions on x86-64 on any atomic operations for long double operands. Patch fixes codegen for such operations.
Differential Revision: http://reviews.llvm.org/D6499

llvm-svn: 224230
2014-12-15 05:25:25 +00:00
Alexey Bataev 583b076223 MSVC: A wide string literal from L#macro_arg in a macro
Clang should form a wide string literal from L#macro_arg in a function-like macro in -fms-compatibility mode.
Fix for http://llvm.org/PR9984.
Differential Revision: http://reviews.llvm.org/D6604

llvm-svn: 224228
2014-12-15 04:18:11 +00:00
Alexander Kornienko 732b6bd4d1 Don't break single-line raw string literals.
Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 224223
2014-12-14 20:47:11 +00:00
David Blaikie 09f12fa1ca DebugInfo: More accurate line information for placement new.
This actually came up as a break in UBSan tests (look for a follow-up
commit to this one to see the UBSan test fallout) when I tried a broader
fix to location information.

I have some other ideas about how to do that broader change & will keep
looking into it.

llvm-svn: 224221
2014-12-14 18:48:18 +00:00
David Majnemer 17e2633cd6 CodeGen: Compound literals with funny types shouldn't crash
CodeGen assumed that a compound literal with array type should have a
corresponding LLVM IR array type.

We had two bugs in this area:
- Zero sized arrays in compound literals would lead to the creation of
  an opaque type.  This is unnecessary, we should just create an array
  type with a bound of zero.
- Funny record types (like unions) lead to exotic IR types for compound
  literals.  In this case, CodeGen must be prepared to deal with the
  possibility that it might not have an array IR type.

This fixes PR21912.

llvm-svn: 224219
2014-12-14 12:16:43 +00:00
David Majnemer 8c92b87cd0 AST: Limit zero-sized constexpr behavior to array types
Restricting this "extension" to array types maximizes our standards
conformance while not miscompiling real-world programs.

llvm-svn: 224215
2014-12-14 08:40:47 +00:00
David Majnemer 5a54977ea8 Lex: Don't crash if both conflict markers are on the same line
We would check if the terminator marker is on a newline.  However, the
logic would end up out-of-bounds if the terminator marker immediately
follows the start marker.

This fixes PR21820.

llvm-svn: 224210
2014-12-14 04:53:11 +00:00
John McCall 578a1f8c6d If a non-template constructor instantiated to X(X),
ignore it during overload resolution when initializing
X from a value of type cv X.

Previously, our rule here only ignored specializations
of constructor templates.  That's probably because the
standard says that constructors are outright ill-formed
if their first parameter is literally X and they're
callable with one argument.  However, Clang only
enforces that prohibition against non-implicit
instantiations; I'm not sure why, but it seems to be
deliberate.  Given that, the most sensible thing to
do is to just ignore the "illegal" constructor
regardless of where it came from.

Also, stop ignoring such constructors silently:
print a note explaining why they're being ignored.

Fixes <rdar://19199836>.

llvm-svn: 224205
2014-12-14 01:46:53 +00:00
David Majnemer 706f315e65 Sema: attribute((annotate)) must have at least one argument
Sema::handleAnnotateAttr expects that some basic validation is done on
the given AttributeList.  However, ProcessAccessDeclAttributeList called
it directly.  Instead, pass the list to ProcessDeclAttribute.

This fixes PR21847.

llvm-svn: 224204
2014-12-14 01:05:01 +00:00
David Majnemer 87ff66ccc7 Parse: MS property members cannot have an in-class initializer
We would crash trying to treat a property member as a field.  These
shoudl be forbidden anyway, reject programs which contain them.

This fixes PR21840.

llvm-svn: 224193
2014-12-13 11:34:16 +00:00
David Majnemer 2887ad35c5 Sema: Constexpr functions must have return statements which have an expr
clang lets programmers be pretty cavalier when it comes to void return
statements in functions which have non-void return types.  However, we
cannot be so forgiving in constexpr functions: evaluation will go off
the rails very quickly.

Instead, keep the return statement in the AST but mark the function as
invalid.  Doing so gives us nice diagnostics while making constexpr
evaluation halt.

This fixes PR21859.

llvm-svn: 224189
2014-12-13 08:12:56 +00:00
Will Wilson 70a1568d91 NFC: Minor formatting fix
llvm-svn: 224185
2014-12-13 04:38:19 +00:00
Will Wilson 67c41ba0dd Pretty print support for template arg enum constants
llvm-svn: 224184
2014-12-13 04:31:07 +00:00
Nick Lewycky 01ad4ae72b Fix two small bugs in typo correction. One assertion failure building member expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression.
The testcase shows a third bug with a FIXME in it.

llvm-svn: 224183
2014-12-13 02:54:28 +00:00
Reid Kleckner a9e65ba19d Implement feedback on r224172 in PR21899
Based on suggestions from Kaelyn.

llvm-svn: 224173
2014-12-13 01:11:23 +00:00
Reid Kleckner a7fe33e0f6 Typo correction: Ignore temporary binding exprs after overload resolution
Transformation of a CallExpr doesn't always result in a new CallExpr.

Fixes PR21899.

llvm-svn: 224172
2014-12-13 00:53:10 +00:00
Peter Collingbourne f770683f14 Implement the __builtin_call_with_static_chain GNU extension.
The extension has the following syntax:

  __builtin_call_with_static_chain(Call, Chain)
  where Call must be a function call expression and Chain must be of pointer type

This extension performs a function call Call with a static chain pointer
Chain passed to the callee in a designated register. This is useful for
calling foreign language functions whose ABI uses static chain pointers
(e.g. to implement closures).

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

llvm-svn: 224167
2014-12-12 23:41:25 +00:00
Justin Bogner 93e3cfcf99 Frontend: Canonicalize to native paths when dumping module dependencies
Mixed path separators (ie, both / and \\) can mess up the sort order
of the VFS map when dumping module dependencies, as was recently
exposed by r224055 and papered over in r224145. Instead, we should
simply use native paths for consistency.

This also adds a TODO to add handling of .. in paths. There was some
code for this before r224055, but it was untested and probably broken.

llvm-svn: 224164
2014-12-12 23:12:27 +00:00
Evgeny Astigeevich 665027dbc4 Fix the issue of mangling of local anonymous unions (Itanium C++ ABI):
A discriminator is used for the first occurrence of a name.
inline int f1 () {
  static union {
    int a;
    long int b;
  };

  static union {
    int c;
    double d;
  };

  return a+c;
}
The name of the second union is mangled as _ZZ2f1vE1c_0 instead of _ZZ2f1vE1c.

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

llvm-svn: 224131
2014-12-12 16:17:46 +00:00
Alexander Kornienko ff2437fe84 Don't break string literals in Java and JavaScript.
The proper way to break string literals in these languages is by inserting a "+"
between parts which we don't support yet. So we disable string literal breaking
until then.

llvm-svn: 224120
2014-12-12 13:03:22 +00:00
Daniel Jasper 11a0ac66e1 clang-format: Revamp nested block formatting.
This fixed llvm.org/PR21804 and hopefully a few other strange cases.

Before:
    if (blah_blah(whatever, whatever, [] {
      doo_dah();
      doo_dah();
    })) {
    }
    }

After:
    if (blah_blah(whatever, whatever, [] {
          doo_dah();
          doo_dah();
        })) {
    }
    }

llvm-svn: 224112
2014-12-12 09:40:58 +00:00
David Majnemer ee8d04d8dd CodeGen: Loads/stores to allocas for atomic ops shouldn't be volatile
Don't inherit the volatile-ness of the input pointer to the volatile
operation for memory allocated on the side.

This fixes PR17306.

llvm-svn: 224110
2014-12-12 08:16:09 +00:00
Serge Pavlov 59da7b8a68 Do not warn on keyword undef
#undef a keyword is generally harmless but used often in configuration scripts.
Also added tests that I forgot to include to commit in r223114.

llvm-svn: 224100
2014-12-12 06:37:55 +00:00
Fariborz Jahanian c9e266b8cf [Objective-C]. This patch extends objc_bridge attribute to support objc_bridge(id).
This means that a pointer to the struct type to which the attribute appertains 
is a CF type (and therefore an Objective-C object of some type), but not of any 
specific class. rdar://19157264

llvm-svn: 224072
2014-12-11 22:56:26 +00:00
Richard Smith 54cc3c2f23 [modules] When constructing paths relative to a module, strip out /./ directory
components. These sometimes get synthetically added, and we don't want -Ifoo
and -I./foo to be treated fundamentally differently here.

llvm-svn: 224055
2014-12-11 20:50:24 +00:00
Paul Robinson 0855695159 Instead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
having OptimizeNone remove them again, just don't add them in the
first place if the function already has OptimizeNone.

Note that MinSize can still appear due to attributes on different
declarations; a future patch will address that.

llvm-svn: 224047
2014-12-11 20:14:04 +00:00
David Majnemer 27db35878d AST: Incomplete types might be zero sized
Comparing the address of an object with an incomplete type might return
true with a 'distinct' object if the former has a size of zero.
However, such an object should compare unequal with null.

llvm-svn: 224040
2014-12-11 19:36:24 +00:00
Aaron Ballman 2521f36e5d When checking for nonnull parameter attributes, also check the ParmVarDecl since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668.
llvm-svn: 224039
2014-12-11 19:35:42 +00:00
Serge Pavlov 83cf078f8f Emit warning if define or undef reserved identifier or keyword.
Recommit of r223114, reverted in r223120.

llvm-svn: 224012
2014-12-11 12:18:08 +00:00
Will Wilson e74c28105d MS ABI: Fix mangling of unsigned int template params
llvm-svn: 223999
2014-12-11 05:47:10 +00:00
David Majnemer b3e96f700e Parse: Concatenated string literals should be verified in inline asm
While we would correctly handle asm("foo") and reject asm(L"bar"), we
weren't careful to handle cases where an ascii literal could be
concatenated with a wide literal.

This fixes PR21822.

llvm-svn: 223992
2014-12-11 01:00:48 +00:00
Paul Robinson af6b86ca98 Revert r223578, perf data collection depends on the old symbol name.
llvm-svn: 223987
2014-12-10 23:49:03 +00:00
Paul Robinson aae2fba540 Diagnose attributes 'optnone' and 'minsize' on the same declaration.
Eventually we'll diagnose them on different declarations, but let's
get this part out of the way first.

llvm-svn: 223985
2014-12-10 23:34:36 +00:00
Paul Robinson 621b6d3bf7 Revert r223980 as it had wrong commit message.
llvm-svn: 223984
2014-12-10 23:32:57 +00:00
Paul Robinson 2936851426 Rename a couple of preprocessor symbols to be more descriptive. NFC.
Review feedback from recent changes to GetSVN.cmake.

llvm-svn: 223980
2014-12-10 23:12:37 +00:00
Eric Christopher 52276536f8 Add a FIXME for unifying ARM target abi handling.
llvm-svn: 223977
2014-12-10 22:58:34 +00:00
Eric Christopher 3c1176c888 Revert the default changing behavior part of r216662 until we
can change the backend to be the same default. Leave the
modified/new testcases with the exception of the default behavior
since it increases our testing footprint.

llvm-svn: 223976
2014-12-10 22:58:32 +00:00
David Majnemer 18fac3b1dd AST: Properly calculate the linkage of a IndirectFieldDecl
getLVForNamespaceScopeDecl believed that it wasn't possible for it to
ever see an IndirectFieldDecl.  However, this can occur when determining
whether or not something is a redeclaration of a member of an anonymous
static union.

This fixes PR21858.

llvm-svn: 223975
2014-12-10 22:58:14 +00:00
Sean Callanan b12a855ba8 Fixed an 80-column violation.
Thanks to Nico Weber for spotting this.

llvm-svn: 223966
2014-12-10 21:22:20 +00:00
David Blaikie a2c1124f9c DebugInfo: Location information for scalar new expressions
llvm-svn: 223937
2014-12-10 19:04:09 +00:00
Daniel Jasper 0df50938be clang-format: Factor out UnwrappedLineFormatter into a separate file.
No functional changes intended.

llvm-svn: 223936
2014-12-10 19:00:42 +00:00
Fariborz Jahanian 1406c878cb Objective-C SDK modernizer. When modernizing an enum to
NS_ENUM/NS_OPTIONS use the underlying type if there is 
no associated type. rdar://19198042

llvm-svn: 223934
2014-12-10 18:25:24 +00:00
Daniel Jasper 24a147776e clang-format: Remove a few else after return statements.
They are against the LLVM coding conventions. No functional changes
intended.

llvm-svn: 223930
2014-12-10 17:24:34 +00:00
Pekka Jaaskelainen 3701450b06 OpenCL C: Add support for a set of floating point
arithmetic relaxation flags:

-cl-no-signed-zeros
-cl-unsafe-math-optimizations
-cl-finite-math-only
-cl-fast-relaxed-math

Propagate the info to FP instruction flags as well
as function attributes where they are available.

llvm-svn: 223928
2014-12-10 16:41:14 +00:00
Simon Atanasyan d83248e60c [mips] Removing __SIZEOF_INT128__ macro for MIPS64
This is a temporary workaround while MIPS64 has not yet fully supported
128-bit integers. But declaration of int128 type is necessary even though
`__SIZEOF_INT128__` is undefined because c++ standard header files like
`limits` throw error message if `__int128` is not available.

Patch by Sagar Thakur.

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

llvm-svn: 223927
2014-12-10 15:44:07 +00:00
Richard Smith 9acb99e342 Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.
Original commit message:

[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.

For files named by -fmodule-map-file=, and files found by 'extern module'
directives, this flag specifies that we should resolve filenames relative to
the current working directory rather than relative to the directory in which
the module map file resides. This is aimed at fixing path handling, in
particular for relative -I paths, when building modules that represent
components of the current project (rather than libraries installed on the
current system, which the current project has as dependencies, where we'd
typically expect the module map files to be looked up implicitly).

llvm-svn: 223913
2014-12-10 03:09:48 +00:00