]> granicus.if.org Git - clang/log
clang
9 years agoDisable the keyword-as-macro warning for now until the noise level is
Joerg Sonnenberger [Wed, 17 Dec 2014 16:25:45 +0000 (16:25 +0000)]
Disable the keyword-as-macro warning for now until the noise level is
reduced.

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

9 years agos/ScheduleKind/SchedKind/ in \param. [-Wdocumentation]
NAKAMURA Takumi [Wed, 17 Dec 2014 14:47:06 +0000 (14:47 +0000)]
s/ScheduleKind/SchedKind/ in \param. [-Wdocumentation]

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

9 years agoExclude printLineState() in -Asserts. [-Wunused-function]
NAKAMURA Takumi [Wed, 17 Dec 2014 14:46:56 +0000 (14:46 +0000)]
Exclude printLineState() in -Asserts. [-Wunused-function]

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

9 years ago[mips] Always clobber $1 for MIPS inline asm.
Toma Tabacu [Wed, 17 Dec 2014 12:02:58 +0000 (12:02 +0000)]
[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

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

9 years agoTeach compile_commands.json test that windows-gnu is the new name for mingw32.
Yaron Keren [Wed, 17 Dec 2014 11:04:07 +0000 (11:04 +0000)]
Teach compile_commands.json test that windows-gnu is the new name for mingw32.

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

9 years agoTeach lit.cfg to recognize -windows-gnu in addition to -mingw32.
Yaron Keren [Wed, 17 Dec 2014 09:55:15 +0000 (09:55 +0000)]
Teach lit.cfg to recognize -windows-gnu in addition to -mingw32.

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

9 years agoclang-format: Fix incorrect calculation of token lenghts.
Daniel Jasper [Wed, 17 Dec 2014 09:11:08 +0000 (09:11 +0000)]
clang-format: Fix incorrect calculation of token lenghts.

This led, e.g. to break JavaScript regex literals too early.

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

9 years agoSema: Don't dyn_cast a null pointer in CheckUsingDeclQualifier
David Majnemer [Wed, 17 Dec 2014 02:41:36 +0000 (02:41 +0000)]
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.

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

9 years agoParse: Consume tokens more carefully in CheckForLParenAfterColonColon
David Majnemer [Wed, 17 Dec 2014 01:39:22 +0000 (01:39 +0000)]
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.

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

9 years agoAdd missing testcase from r224388.
Richard Smith [Wed, 17 Dec 2014 01:08:39 +0000 (01:08 +0000)]
Add missing testcase from r224388.

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

9 years ago[CallGraph] Make sure the edges are not missed due to re-declarations
Anna Zaks [Wed, 17 Dec 2014 00:34:07 +0000 (00:34 +0000)]
[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.)

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

9 years agoPR21909: Don't try (and crash) to generate debug info for explicit instantiations...
David Blaikie [Tue, 16 Dec 2014 23:49:18 +0000 (23:49 +0000)]
PR21909: Don't try (and crash) to generate debug info for explicit instantiations of explicit specializations.

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

9 years agoDR1684: a constexpr member function need not be a member of a literal class type.
Richard Smith [Tue, 16 Dec 2014 23:12:52 +0000 (23:12 +0000)]
DR1684: a constexpr member function need not be a member of a literal class type.

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

9 years agoTry typo correction on all initialization arguments and be less
Kaelyn Takata [Tue, 16 Dec 2014 23:07:00 +0000 (23:07 +0000)]
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.

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

9 years agoDebugInfo: Generalize debug info location handling
David Blaikie [Tue, 16 Dec 2014 22:49:17 +0000 (22:49 +0000)]
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.

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

9 years agoLook at whether TransformTypos returned a different Expr instead of looking at the...
Nick Lewycky [Tue, 16 Dec 2014 22:02:06 +0000 (22:02 +0000)]
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!

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

9 years agoFix handling of invalid -O options.
Rafael Espindola [Tue, 16 Dec 2014 21:57:03 +0000 (21:57 +0000)]
Fix handling of invalid -O options.

We were checking the value after truncating it to a bitfield.

Thanks to Yunzhong Gao for noticing it.

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

9 years agoFix typo in comment. NFC.
Nick Lewycky [Tue, 16 Dec 2014 21:48:39 +0000 (21:48 +0000)]
Fix typo in comment. NFC.

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

9 years agoAdd a new flag, -fspell-checking-limit=<number> to control how many times we'll do...
Nick Lewycky [Tue, 16 Dec 2014 21:39:02 +0000 (21:39 +0000)]
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.

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

9 years agoMove -Wkeyword-macro into -pedantic, remove -Wreserved-id-macro.
Nico Weber [Tue, 16 Dec 2014 21:16:10 +0000 (21:16 +0000)]
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.)

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

9 years agoPut static local variables of inline functions in the function comdat.
Rafael Espindola [Tue, 16 Dec 2014 21:00:30 +0000 (21:00 +0000)]
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.

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

9 years agoConsider calls from implict host device functions as valid in SemaCUDA.
Jacques Pienaar [Tue, 16 Dec 2014 20:12:38 +0000 (20:12 +0000)]
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

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

9 years agoRenamed RefersToEnclosingLocal bitfield to RefersToCapturedVariable.
Alexey Bataev [Tue, 16 Dec 2014 08:01:48 +0000 (08:01 +0000)]
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.

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

9 years ago[OPENMP] Bugfix for processing of global variables in OpenMP regions.
Alexey Bataev [Tue, 16 Dec 2014 07:00:22 +0000 (07:00 +0000)]
[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

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

9 years agoSema: Don't crash converting to bool from _Atomic
David Majnemer [Tue, 16 Dec 2014 06:31:17 +0000 (06:31 +0000)]
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.

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

9 years agoImprove handling of value dependent expressions in __attribute__((enable_if)), both...
Nick Lewycky [Tue, 16 Dec 2014 06:12:01 +0000 (06:12 +0000)]
Improve handling of value dependent expressions in __attribute__((enable_if)), both in the condition expression and at the call site. Fixes PR20988!

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

9 years agoAST: Fix the linkage of static vars in fn template specializations
David Majnemer [Tue, 16 Dec 2014 04:52:14 +0000 (04:52 +0000)]
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.

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

9 years agoClarify the code in checkDLLAttribute()
Hans Wennborg [Tue, 16 Dec 2014 01:15:01 +0000 (01:15 +0000)]
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.

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

9 years agoSema: Check value dependent casts when possible
David Majnemer [Tue, 16 Dec 2014 00:46:30 +0000 (00:46 +0000)]
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.

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

9 years agoDiagnose function template definitions inside functions
Reid Kleckner [Mon, 15 Dec 2014 23:16:32 +0000 (23:16 +0000)]
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.

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

9 years agoSilene -Wreorder warning.
Roman Divacky [Mon, 15 Dec 2014 21:41:59 +0000 (21:41 +0000)]
Silene -Wreorder warning.

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

9 years agoHandle errors in lambda prototype instantiation correctly
Reid Kleckner [Mon, 15 Dec 2014 21:07:16 +0000 (21:07 +0000)]
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

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

9 years agoSema: Cleanup and improve string-plus-char checking.
Daniel Marjamaki [Mon, 15 Dec 2014 20:22:33 +0000 (20:22 +0000)]
Sema: Cleanup and improve string-plus-char checking.

Patch by Anders Rönnholm

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

9 years agoUpdate this testcase for the new metadata assembler syntax.
Adrian Prantl [Mon, 15 Dec 2014 19:25:33 +0000 (19:25 +0000)]
Update this testcase for the new metadata assembler syntax.

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

9 years agoIR: Make metadata typeless in assembly, clang side
Duncan P. N. Exon Smith [Mon, 15 Dec 2014 19:10:08 +0000 (19:10 +0000)]
IR: Make metadata typeless in assembly, clang side

Match LLVM changes from r224257.

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

9 years agoWarn when attribute 'optnone' conflicts with attributes on a
Paul Robinson [Mon, 15 Dec 2014 18:57:28 +0000 (18:57 +0000)]
Warn when attribute 'optnone' conflicts with attributes on a
different declaration of the same function.

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

9 years agoAdd voidType() matcher.
Samuel Benzaquen [Mon, 15 Dec 2014 15:09:22 +0000 (15:09 +0000)]
Add voidType() matcher.

Summary: Add voidType() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoSema: Don't diagnose string + int if the int is value dependent
David Majnemer [Mon, 15 Dec 2014 10:00:35 +0000 (10:00 +0000)]
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.

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

9 years agoPreprocessor: Recover instead of mutating a token in ExpandBuiltinMacro
David Majnemer [Mon, 15 Dec 2014 09:03:58 +0000 (09:03 +0000)]
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.

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

9 years agoSema: Don't leave switch stack inconsistent when recovering
David Majnemer [Mon, 15 Dec 2014 07:46:12 +0000 (07:46 +0000)]
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.

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

9 years agoTest for 'omp for' (for r224233).
Alexander Musman [Mon, 15 Dec 2014 07:08:38 +0000 (07:08 +0000)]
Test for 'omp for' (for r224233).

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

9 years agoFirst patch with codegen of the 'omp for' directive. It implements
Alexander Musman [Mon, 15 Dec 2014 07:07:06 +0000 (07:07 +0000)]
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

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

9 years agoParse: Don't reorder tokens using ConsumeToken
David Majnemer [Mon, 15 Dec 2014 07:00:05 +0000 (07:00 +0000)]
Parse: Don't reorder tokens using ConsumeToken

ConsumeToken doesn't work with special tokens.  Instead, just use PP.Lex
to eat the token.

This fixes PR21817.

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

9 years agoFixed test/CodeGen/atomic_ops.c for compatibility with hexagon target
Alexey Bataev [Mon, 15 Dec 2014 06:12:42 +0000 (06:12 +0000)]
Fixed test/CodeGen/atomic_ops.c for compatibility with hexagon target

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

9 years agoBugfix for Codegen of atomic load/store/other ops.
Alexey Bataev [Mon, 15 Dec 2014 05:25:25 +0000 (05:25 +0000)]
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

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

9 years agoMSVC: A wide string literal from L#macro_arg in a macro
Alexey Bataev [Mon, 15 Dec 2014 04:18:11 +0000 (04:18 +0000)]
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

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

9 years agoDon't break single-line raw string literals.
Alexander Kornienko [Sun, 14 Dec 2014 20:47:11 +0000 (20:47 +0000)]
Don't break single-line raw string literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

9 years agoDebugInfo: More accurate line information for placement new.
David Blaikie [Sun, 14 Dec 2014 18:48:18 +0000 (18:48 +0000)]
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.

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

9 years agoCodeGen: Compound literals with funny types shouldn't crash
David Majnemer [Sun, 14 Dec 2014 12:16:43 +0000 (12:16 +0000)]
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.

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

9 years agoAST: Limit zero-sized constexpr behavior to array types
David Majnemer [Sun, 14 Dec 2014 08:40:47 +0000 (08:40 +0000)]
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.

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

9 years agoLex: Don't crash if both conflict markers are on the same line
David Majnemer [Sun, 14 Dec 2014 04:53:11 +0000 (04:53 +0000)]
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.

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

9 years agoIf a non-template constructor instantiated to X(X),
John McCall [Sun, 14 Dec 2014 01:46:53 +0000 (01:46 +0000)]
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>.

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

9 years agoSema: attribute((annotate)) must have at least one argument
David Majnemer [Sun, 14 Dec 2014 01:05:01 +0000 (01:05 +0000)]
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.

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

9 years agoclang-cl: Fix handling of the /volatile flag (PR21893)
Hans Wennborg [Sat, 13 Dec 2014 22:44:46 +0000 (22:44 +0000)]
clang-cl: Fix handling of the /volatile flag (PR21893)

The /volatile:iso flag is our default behaviour, so it can be ignored.

Parse /volatile:ms as unsupported.

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

9 years agoclang-cl: ignore /cgthreads (PR21894)
Hans Wennborg [Sat, 13 Dec 2014 22:24:16 +0000 (22:24 +0000)]
clang-cl: ignore /cgthreads (PR21894)

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

9 years agoclang-cl: Make /Gd ignored instead of unsupported
Hans Wennborg [Sat, 13 Dec 2014 22:13:23 +0000 (22:13 +0000)]
clang-cl: Make /Gd ignored instead of unsupported

/Gd is the default calling convention setting, so we don't
need to take any action.

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

9 years agoclang-cl: Add unsupported /Gv option (PR21892)
Hans Wennborg [Sat, 13 Dec 2014 22:06:23 +0000 (22:06 +0000)]
clang-cl: Add unsupported /Gv option (PR21892)

We don't currently support any of the calling convention options.

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

9 years agoParse: MS property members cannot have an in-class initializer
David Majnemer [Sat, 13 Dec 2014 11:34:16 +0000 (11:34 +0000)]
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.

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

9 years agoSema: Constexpr functions must have return statements which have an expr
David Majnemer [Sat, 13 Dec 2014 08:12:56 +0000 (08:12 +0000)]
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.

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

9 years agoNFC: Minor formatting fix
Will Wilson [Sat, 13 Dec 2014 04:38:19 +0000 (04:38 +0000)]
NFC: Minor formatting fix

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

9 years agoPretty print support for template arg enum constants
Will Wilson [Sat, 13 Dec 2014 04:31:07 +0000 (04:31 +0000)]
Pretty print support for template arg enum constants

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

9 years agoFix two small bugs in typo correction. One assertion failure building member expressi...
Nick Lewycky [Sat, 13 Dec 2014 02:54:28 +0000 (02:54 +0000)]
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.

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

9 years agoImplement feedback on r224172 in PR21899
Reid Kleckner [Sat, 13 Dec 2014 01:11:23 +0000 (01:11 +0000)]
Implement feedback on r224172 in PR21899

Based on suggestions from Kaelyn.

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

9 years agoTypo correction: Ignore temporary binding exprs after overload resolution
Reid Kleckner [Sat, 13 Dec 2014 00:53:10 +0000 (00:53 +0000)]
Typo correction: Ignore temporary binding exprs after overload resolution

Transformation of a CallExpr doesn't always result in a new CallExpr.

Fixes PR21899.

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

9 years agoImplement the __builtin_call_with_static_chain GNU extension.
Peter Collingbourne [Fri, 12 Dec 2014 23:41:25 +0000 (23:41 +0000)]
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

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

9 years agoFrontend: Canonicalize to native paths when dumping module dependencies
Justin Bogner [Fri, 12 Dec 2014 23:12:27 +0000 (23:12 +0000)]
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.

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

9 years agoAllow module deps to be printed in an arbitrary order
Reid Kleckner [Fri, 12 Dec 2014 19:13:04 +0000 (19:13 +0000)]
Allow module deps to be printed in an arbitrary order

The order is different between Windows and Unix for reasons unknown, but
the compiler output appears to still be determinstic.

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

9 years agoFix the issue of mangling of local anonymous unions (Itanium C++ ABI):
Evgeny Astigeevich [Fri, 12 Dec 2014 16:17:46 +0000 (16:17 +0000)]
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

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

9 years agoDon't break string literals in Java and JavaScript.
Alexander Kornienko [Fri, 12 Dec 2014 13:03:22 +0000 (13:03 +0000)]
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.

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

9 years agoclang-format: Revamp nested block formatting.
Daniel Jasper [Fri, 12 Dec 2014 09:40:58 +0000 (09:40 +0000)]
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();
        })) {
    }
    }

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

9 years agoCodeGen: Loads/stores to allocas for atomic ops shouldn't be volatile
David Majnemer [Fri, 12 Dec 2014 08:16:09 +0000 (08:16 +0000)]
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.

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

9 years agoDo not warn on keyword undef
Serge Pavlov [Fri, 12 Dec 2014 06:37:55 +0000 (06:37 +0000)]
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.

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

9 years ago[Objective-C]. This patch extends objc_bridge attribute to support objc_bridge(id).
Fariborz Jahanian [Thu, 11 Dec 2014 22:56:26 +0000 (22:56 +0000)]
[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

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

9 years ago[modules] When constructing paths relative to a module, strip out /./ directory
Richard Smith [Thu, 11 Dec 2014 20:50:24 +0000 (20:50 +0000)]
[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.

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

9 years agoInstead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
Paul Robinson [Thu, 11 Dec 2014 20:14:04 +0000 (20:14 +0000)]
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.

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

9 years agoAST: Incomplete types might be zero sized
David Majnemer [Thu, 11 Dec 2014 19:36:24 +0000 (19:36 +0000)]
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.

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

9 years agoWhen checking for nonnull parameter attributes, also check the ParmVarDecl since...
Aaron Ballman [Thu, 11 Dec 2014 19:35:42 +0000 (19:35 +0000)]
When checking for nonnull parameter attributes, also check the ParmVarDecl since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668.

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

9 years agoEmit warning if define or undef reserved identifier or keyword.
Serge Pavlov [Thu, 11 Dec 2014 12:18:08 +0000 (12:18 +0000)]
Emit warning if define or undef reserved identifier or keyword.

Recommit of r223114, reverted in r223120.

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

9 years agoMS ABI: Fix mangling of unsigned int template params
Will Wilson [Thu, 11 Dec 2014 05:47:10 +0000 (05:47 +0000)]
MS ABI: Fix mangling of unsigned int template params

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

9 years agoParse: Concatenated string literals should be verified in inline asm
David Majnemer [Thu, 11 Dec 2014 01:00:48 +0000 (01:00 +0000)]
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.

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

9 years agoRevert r223578, perf data collection depends on the old symbol name.
Paul Robinson [Wed, 10 Dec 2014 23:49:03 +0000 (23:49 +0000)]
Revert r223578, perf data collection depends on the old symbol name.

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

9 years agoDiagnose attributes 'optnone' and 'minsize' on the same declaration.
Paul Robinson [Wed, 10 Dec 2014 23:34:36 +0000 (23:34 +0000)]
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.

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

9 years agoRevert r223980 as it had wrong commit message.
Paul Robinson [Wed, 10 Dec 2014 23:32:57 +0000 (23:32 +0000)]
Revert r223980 as it had wrong commit message.

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

9 years agoRename a couple of preprocessor symbols to be more descriptive. NFC.
Paul Robinson [Wed, 10 Dec 2014 23:12:37 +0000 (23:12 +0000)]
Rename a couple of preprocessor symbols to be more descriptive. NFC.
Review feedback from recent changes to GetSVN.cmake.

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

9 years agoForgot to commit this change with r223975
David Majnemer [Wed, 10 Dec 2014 23:08:43 +0000 (23:08 +0000)]
Forgot to commit this change with r223975

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

9 years agoAdd a FIXME for unifying ARM target abi handling.
Eric Christopher [Wed, 10 Dec 2014 22:58:34 +0000 (22:58 +0000)]
Add a FIXME for unifying ARM target abi handling.

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

9 years agoRevert the default changing behavior part of r216662 until we
Eric Christopher [Wed, 10 Dec 2014 22:58:32 +0000 (22:58 +0000)]
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.

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

9 years agoAST: Properly calculate the linkage of a IndirectFieldDecl
David Majnemer [Wed, 10 Dec 2014 22:58:14 +0000 (22:58 +0000)]
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.

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

9 years agoFixed an 80-column violation.
Sean Callanan [Wed, 10 Dec 2014 21:22:20 +0000 (21:22 +0000)]
Fixed an 80-column violation.

Thanks to Nico Weber for spotting this.

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

9 years agoDR1891, PR21787: a lambda closure type has no default constructor, rather than
Richard Smith [Wed, 10 Dec 2014 20:04:48 +0000 (20:04 +0000)]
DR1891, PR21787: a lambda closure type has no default constructor, rather than
having a deleted default constructor.

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

9 years agoMake test case 32/64 bit neutral
David Blaikie [Wed, 10 Dec 2014 19:19:24 +0000 (19:19 +0000)]
Make test case 32/64 bit neutral

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

9 years agoDebugInfo: Location information for scalar new expressions
David Blaikie [Wed, 10 Dec 2014 19:04:09 +0000 (19:04 +0000)]
DebugInfo: Location information for scalar new expressions

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

9 years agoclang-format: Factor out UnwrappedLineFormatter into a separate file.
Daniel Jasper [Wed, 10 Dec 2014 19:00:42 +0000 (19:00 +0000)]
clang-format: Factor out UnwrappedLineFormatter into a separate file.

No functional changes intended.

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

9 years agoAdded a testcase to make sure the parser allows
Sean Callanan [Wed, 10 Dec 2014 18:57:09 +0000 (18:57 +0000)]
Added a testcase to make sure the parser allows
but ignores module imports in debugger mode,
even inside functions.

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

9 years agoObjective-C SDK modernizer. When modernizing an enum to
Fariborz Jahanian [Wed, 10 Dec 2014 18:25:24 +0000 (18:25 +0000)]
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

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

9 years agoclang-format: Remove a few else after return statements.
Daniel Jasper [Wed, 10 Dec 2014 17:24:34 +0000 (17:24 +0000)]
clang-format: Remove a few else after return statements.

They are against the LLVM coding conventions. No functional changes
intended.

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

9 years agoOpenCL C: Add support for a set of floating point
Pekka Jaaskelainen [Wed, 10 Dec 2014 16:41:14 +0000 (16:41 +0000)]
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.

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

9 years ago[mips] Removing __SIZEOF_INT128__ macro for MIPS64
Simon Atanasyan [Wed, 10 Dec 2014 15:44:07 +0000 (15:44 +0000)]
[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

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

9 years agoclang/test/Modules/modular_maps.cpp REQUIRES shell. chdir is unsupported on Lit inter...
NAKAMURA Takumi [Wed, 10 Dec 2014 08:20:32 +0000 (08:20 +0000)]
clang/test/Modules/modular_maps.cpp REQUIRES shell. chdir is unsupported on Lit internal runner.

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

9 years agoReinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.
Richard Smith [Wed, 10 Dec 2014 03:09:48 +0000 (03:09 +0000)]
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).

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