platform/upstream/llvm.git
10 years agoindvars: cleanup the IV visitor. It does more than gather sext/zext info.
Andrew Trick [Thu, 2 Jan 2014 21:12:11 +0000 (21:12 +0000)]
indvars: cleanup the IV visitor. It does more than gather sext/zext info.

llvm-svn: 198353

10 years agoFix all the verifier tests I added for address spaces.
Matt Arsenault [Thu, 2 Jan 2014 21:09:05 +0000 (21:09 +0000)]
Fix all the verifier tests I added for address spaces.

I originally had these using opt -verify, and I never removed the
-verify when converting them to use llvm-as instead, so these were
failing because of using the -verify argument which llvm-as doesn't have
instead of what it's actually supposed to be testing.

llvm-svn: 198352

10 years agoFix up a couple of review comments:
Eric Christopher [Thu, 2 Jan 2014 21:03:28 +0000 (21:03 +0000)]
Fix up a couple of review comments:

Use an if statement instead of a pair of ternary operators checking
the same condition.
Use a cheap method call rather than returning the local symbol.

llvm-svn: 198351

10 years agoSimplify conditional.
Eric Christopher [Thu, 2 Jan 2014 21:03:22 +0000 (21:03 +0000)]
Simplify conditional.

llvm-svn: 198350

10 years agoAllow addrspacecast in global aliases
Matt Arsenault [Thu, 2 Jan 2014 20:55:01 +0000 (20:55 +0000)]
Allow addrspacecast in global aliases

llvm-svn: 198349

10 years ago[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses
Hal Finkel [Thu, 2 Jan 2014 20:47:09 +0000 (20:47 +0000)]
[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses

Even within a multiclass, we had been generating concrete implicit anonymous
defs when parsing values (generally in value lists). This behavior was
incorrect, and led to errors when multiclass parameters were used in the
parameter list of the implicit anonymous def.

If we had some multiclass:

multiclass mc<string n> {

 ... : SomeClass<SomeOtherClass<n> >

The capture of the multiclass parameter 'n' would not work correctly, and
depending on how the implicit SomeOtherClass was used, either TableGen would
ignore something it shouldn't, or would crash.

To fix this problem, when inside a multiclass, we generate prototype anonymous
defs for implicit anonymous defs (just as we do for explicit anonymous defs).
Within the multiclass, the current record prototype is populated with a node
that is essentially: !cast<SomeOtherClass>(!strconcat(NAME, anon_value_name)).
This is then resolved to the correct concrete anonymous def, in the usual way,
when NAME is resolved during multiclass instantiation.

llvm-svn: 198348

10 years ago[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults
Hal Finkel [Thu, 2 Jan 2014 20:47:05 +0000 (20:47 +0000)]
[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults

A ValueType in a pattern dag is a type cast, and GetNumNodeResults should
handle it (the type cast has only one result).

This comes up, for example, during the type checking of pattern fragments, for
example, AArch64's Neon_combine_2d fragment is:
  dag Operands = (ops node:$Rm, node:$Rn);
  dag Fragment = (v2f64 (concat_vectors (v1f64 node:$Rm), (v1f64 node:$Rn)));

llvm-svn: 198347

10 years agoDelete unread globals through addrspacecast
Matt Arsenault [Thu, 2 Jan 2014 20:01:43 +0000 (20:01 +0000)]
Delete unread globals through addrspacecast

llvm-svn: 198346

10 years agoFix addrspacecast with metadata globals
Matt Arsenault [Thu, 2 Jan 2014 19:53:49 +0000 (19:53 +0000)]
Fix addrspacecast with metadata globals

llvm-svn: 198345

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 19:47:45 +0000 (19:47 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

Plugins need to go in build/Debug/lib as well (rather than build/lib/Debug).

Also, fix the SHLIBDIR path for Xcode, which by default includes Xcode build
settings rather than a simple %(build_mode)s parameter.

llvm-svn: 198344

10 years agoObjective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.
Douglas Gregor [Thu, 2 Jan 2014 19:42:02 +0000 (19:42 +0000)]
Objective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.

Fixes <rdar://problem/15713945>.

llvm-svn: 198343

10 years agoRemove redundant fold call introduced in r195944. Thanks very much to Juergen
Lang Hames [Thu, 2 Jan 2014 19:38:41 +0000 (19:38 +0000)]
Remove redundant fold call introduced in r195944. Thanks very much to Juergen
for pointing this out.

llvm-svn: 198341

10 years ago[TableGen] Use the same anonymous name as the prefix on all multiclass defs
Hal Finkel [Thu, 2 Jan 2014 19:35:33 +0000 (19:35 +0000)]
[TableGen] Use the same anonymous name as the prefix on all multiclass defs

TableGen had been generating a different name for an anonymous multiclass's
NAME for every def in the multiclass. This had an unfortunate side effect: it
was impossible to reference one def within the multiclass from another (in the
parameter list, for example). By making sure we only generate an anonymous name
once per multiclass (which, as it turns out, requires only changing the name
parameter to reference type), we can now concatenate NAME within the multiclass
with a def name in order to generate a reference to that def.

This does not matter so much, in and of itself, but is necessary for a
follow-up commit that will fix variable capturing in implicit anonymous
multiclass defs (and that is important).

llvm-svn: 198340

10 years agoNo else after return.
Joerg Sonnenberger [Thu, 2 Jan 2014 19:30:56 +0000 (19:30 +0000)]
No else after return.

llvm-svn: 198339

10 years agoindvars: insert truncate at loop boundary to avoid redundant IVs.
Andrew Trick [Thu, 2 Jan 2014 19:29:38 +0000 (19:29 +0000)]
indvars: insert truncate at loop boundary to avoid redundant IVs.

When widening an IV to remove s/zext, we generally try to eliminate
the original narrow IV. However, LCSSA phi nodes outside the loop were
still using the original IV. Clean this up more aggressively to avoid
redundancy in generated code.

llvm-svn: 198338

10 years agoAdd default search path if -nostdlib is not provided.
Joerg Sonnenberger [Thu, 2 Jan 2014 19:18:36 +0000 (19:18 +0000)]
Add default search path if -nostdlib is not provided.
Add basic emulation mapping for NetBSD/amd64, so that clang -m32 works
as expected.

llvm-svn: 198337

10 years agoMark REX64_PREFIX as In64BitMode, remove hack from X86RecognizableInstr.
Craig Topper [Thu, 2 Jan 2014 19:12:10 +0000 (19:12 +0000)]
Mark REX64_PREFIX as In64BitMode, remove hack from X86RecognizableInstr.

llvm-svn: 198336

10 years agoCMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.
Douglas Gregor [Thu, 2 Jan 2014 19:07:19 +0000 (19:07 +0000)]
CMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.

llvm-svn: 198335

10 years agoMake llvm::Regex non-copyable but movable.
David Blaikie [Thu, 2 Jan 2014 19:04:59 +0000 (19:04 +0000)]
Make llvm::Regex non-copyable but movable.

Based on a patch by Maciej Piechotka.

llvm-svn: 198334

10 years agoRevert "Debug info: Add enumerators to the __apple_names accelerator table."
Adrian Prantl [Thu, 2 Jan 2014 18:48:24 +0000 (18:48 +0000)]
Revert "Debug info: Add enumerators to the __apple_names accelerator table."

This reverts r197927 until the discussion on llvm-commits comes to a
conclusion.

llvm-svn: 198333

10 years agoRemove unused HasFROperands field from disassembler.
Craig Topper [Thu, 2 Jan 2014 18:44:21 +0000 (18:44 +0000)]
Remove unused HasFROperands field from disassembler.

llvm-svn: 198332

10 years agoCMake separate projects: finish output-directory changes.
Douglas Gregor [Thu, 2 Jan 2014 18:37:47 +0000 (18:37 +0000)]
CMake separate projects: finish output-directory changes.

Make sure clang-tblgen, clang++, and clang-cl get created in the Clang
binary build directory.

llvm-svn: 198331

10 years agoUse LLVM_STATIC_ASSERT rather than a hand-rolled implementation.
David Blaikie [Thu, 2 Jan 2014 18:29:40 +0000 (18:29 +0000)]
Use LLVM_STATIC_ASSERT rather than a hand-rolled implementation.

llvm-svn: 198330

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 18:28:32 +0000 (18:28 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

In a standalone build, Clang binaries should end up in Clang's build folder,
not LLVM's.

Xcode still has a few issues finding auxiliary tools and libraries in the
build folders. I'll fix those next.

llvm-svn: 198328

10 years agoMark PUSHFS64/PUSHGS64/POPFS64/POPGS64 as In64BitMode and remove the hack from the...
Craig Topper [Thu, 2 Jan 2014 18:20:48 +0000 (18:20 +0000)]
Mark PUSHFS64/PUSHGS64/POPFS64/POPGS64 as In64BitMode and remove the hack from the disassembler table builder.

llvm-svn: 198327

10 years agoUsing the quoted version of an attribute name for consistency with other attribute...
Aaron Ballman [Thu, 2 Jan 2014 18:10:17 +0000 (18:10 +0000)]
Using the quoted version of an attribute name for consistency with other attribute diagnostics.

llvm-svn: 198326

10 years agoRemove unnecessary stirng comparison from disassembler.
Craig Topper [Thu, 2 Jan 2014 17:41:40 +0000 (17:41 +0000)]
Remove unnecessary stirng comparison from disassembler.

llvm-svn: 198325

10 years agoMark all x86 Int_ and _Int patterns as isCodeGenOnly so the disassembler table builde...
Craig Topper [Thu, 2 Jan 2014 17:28:14 +0000 (17:28 +0000)]
Mark all x86 Int_ and _Int patterns as isCodeGenOnly so the disassembler table builder doesn't need to string match them to exclude them.

llvm-svn: 198323

10 years agoObjectiveC. Class methods must be ignored when looking for
Fariborz Jahanian [Thu, 2 Jan 2014 17:24:32 +0000 (17:24 +0000)]
ObjectiveC. Class methods must be ignored when looking for
property accessor's missing backing ivar. This eliminates
the bogus warning being issued. // rdar://15728901

llvm-svn: 198322

10 years agoAdd test for r198311.
Roman Divacky [Thu, 2 Jan 2014 17:18:03 +0000 (17:18 +0000)]
Add test for r198311.

llvm-svn: 198321

10 years agoCMake: Unbreak separated LLVM/Clang project builds for Xcode.
Douglas Gregor [Thu, 2 Jan 2014 17:11:02 +0000 (17:11 +0000)]
CMake: Unbreak separated LLVM/Clang project builds for Xcode.

The separate Xcode project generated for Clang is putting the clang
executables into the same location where the LLVM executables are
going. This is wrong, and breaks the Clang build because we try to
create clang++ and clang-cl symlinks in the wrong place and to the
wrong place.

As a stop-gap to get these builds working again, teach the symlink
generation to point into the LLVM executable directory instead.

llvm-svn: 198319

10 years agoRemove CMake-Xcode hack that symlinked llvm-config into a common place.
Douglas Gregor [Thu, 2 Jan 2014 16:30:55 +0000 (16:30 +0000)]
Remove CMake-Xcode hack that symlinked llvm-config into a common place.

When building Clang separately from LLVM with CMake, one should set
the path of llvm-config via the cache variable LLVM_CONFIG.

llvm-svn: 198316

10 years ago[arm] Add softvfp to supported FPU names.
Logan Chien [Thu, 2 Jan 2014 15:50:02 +0000 (15:50 +0000)]
[arm] Add softvfp to supported FPU names.

llvm-svn: 198313

10 years agoRemove a tab that snuck in.
Roman Divacky [Thu, 2 Jan 2014 15:34:59 +0000 (15:34 +0000)]
Remove a tab that snuck in.

llvm-svn: 198312

10 years agoIn the FreeBSD assembler driver, inform the sparc assembler that we're producing
Roman Divacky [Thu, 2 Jan 2014 15:13:18 +0000 (15:13 +0000)]
In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.

llvm-svn: 198311

10 years agoAdded an option to avoid splitting certain kinds of comments into lines.
Alexander Kornienko [Thu, 2 Jan 2014 15:13:14 +0000 (15:13 +0000)]
Added an option to avoid splitting certain kinds of comments into lines.

Summary: Added CommentPragmas option for this.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2460

llvm-svn: 198310

10 years agoVerify that clang TargetInfo descriptions match DataLayout strings from LLVM
Alp Toker [Thu, 2 Jan 2014 15:08:04 +0000 (15:08 +0000)]
Verify that clang TargetInfo descriptions match DataLayout strings from LLVM

The backend string is only verified when available as it's possible to run
clang IRGen for targets that haven't been built or don't exist in LLVM.

llvm-svn: 198309

10 years agoRemove the now unused 's' specifications.
Rafael Espindola [Thu, 2 Jan 2014 14:06:59 +0000 (14:06 +0000)]
Remove the now unused 's' specifications.

llvm-svn: 198308

10 years agoPass the aapcs and apcs features down to llvm.
Rafael Espindola [Thu, 2 Jan 2014 13:57:18 +0000 (13:57 +0000)]
Pass the aapcs and apcs features down to llvm.

No functionality change, but unblocks asserting that llvm's and clang's
datalayout strings are the same.

llvm-svn: 198306

10 years agoMake the ARM ABI selectable via SubtargetFeature.
Rafael Espindola [Thu, 2 Jan 2014 13:40:08 +0000 (13:40 +0000)]
Make the ARM ABI selectable via SubtargetFeature.

This patch makes it possible to select the ABI with -mattr. It will be used to
forward clang's -target-abi option to llvm's CodeGen.

llvm-svn: 198304

10 years ago[OpenCL] The kernel attribute can only be used on functions.
Joey Gouly [Thu, 2 Jan 2014 12:04:42 +0000 (12:04 +0000)]
[OpenCL] The kernel attribute can only be used on functions.

llvm-svn: 198300

10 years agoSupport LLVM_STATIC_ASSERT() in clang pre-C++11 mode
Alp Toker [Thu, 2 Jan 2014 04:07:41 +0000 (04:07 +0000)]
Support LLVM_STATIC_ASSERT() in clang pre-C++11 mode

llvm-svn: 198292

10 years agoRemove unused function argument.
Craig Topper [Thu, 2 Jan 2014 03:58:45 +0000 (03:58 +0000)]
Remove unused function argument.

llvm-svn: 198291

10 years agoBasicAA: Fix value equality and phi cycles
Arnold Schwaighofer [Thu, 2 Jan 2014 03:31:36 +0000 (03:31 +0000)]
BasicAA: Fix value equality and phi cycles

When there are cycles in the value graph we have to be careful interpreting
"Value*" identity as "value" equivalence. We interpret the value of a phi node
as the value of its operands.
When we check for value equivalence now we make sure that the "Value*" dominates
all cycles (phis).

%0 = phi [%noaliasval, %addr2]
%l = load %ptr
%addr1 = gep @a, 0, %l
%addr2 = gep @a, 0, (%l + 1)
store %ptr ...

Before this patch we would return NoAlias for (%0, %addr1) which is wrong
because the value of the load is from different iterations of the loop.

Tested on x86_64 -mavx at O3 and O3 -flto with no performance or compile time
regressions.

PR18068
radar://15653794

llvm-svn: 198290

10 years agoRename 'assert' to something less loaded in CompileAssertHasType
Alp Toker [Wed, 1 Jan 2014 23:34:16 +0000 (23:34 +0000)]
Rename 'assert' to something less loaded in CompileAssertHasType

Suggested by Aaron Ballman.

llvm-svn: 198288

10 years agoRemove the 's' DataLayout specification
Rafael Espindola [Wed, 1 Jan 2014 22:29:43 +0000 (22:29 +0000)]
Remove the 's' DataLayout specification

During the years there have been some attempts at figuring out how to
align byval arguments. A look at the commit log suggests that they
were

* Use the ABI alignment.
* When that was not sufficient for x86-64, I added the 's' specification to
  DataLayout.
* When that was not sufficient Evan added the virtual getByValTypeAlignment.
* When even that was not sufficient, we just got the FE to add the alignment
  to the byval.

This patch is just a simple cleanup that removes my first attempt at fixing the
problem. I also added an AArch64 implementation of getByValTypeAlignment to
make sure this patch is a nop. I also left the 's' parsing for backward
compatibility.

I will send a short email to llvmdev about the change for anyone maintaining
an out of tree target.

llvm-svn: 198287

10 years ago[Sparc] Handle atomic loads/stores in sparc backend.
Venkatraman Govindaraju [Wed, 1 Jan 2014 22:11:54 +0000 (22:11 +0000)]
[Sparc] Handle atomic loads/stores in sparc backend.

llvm-svn: 198286

10 years agoRemove modifierType/Base from X86 disassembler tables as they are no longer used...
Craig Topper [Wed, 1 Jan 2014 21:52:57 +0000 (21:52 +0000)]
Remove modifierType/Base from X86 disassembler tables as they are no longer used. Removes ~11.5K from static tables.

llvm-svn: 198284

10 years ago[SparcV9]: Custom lower UMULO/SMULO so that the arguments are send to __multi3()...
Venkatraman Govindaraju [Wed, 1 Jan 2014 20:22:45 +0000 (20:22 +0000)]
[SparcV9]: Custom lower UMULO/SMULO so that the arguments are send to __multi3() in correct order.

llvm-svn: 198281

10 years ago[SparcV9]: Use SRL instead of SLL to clear top 32-bits in ctpop:i32. SLL does not...
Venkatraman Govindaraju [Wed, 1 Jan 2014 19:00:10 +0000 (19:00 +0000)]
[SparcV9]: Use SRL instead of SLL to clear top 32-bits in ctpop:i32. SLL does not clear top 32 bit, only SRL does.

llvm-svn: 198280

10 years agoX86Disassembler.cpp: Prune stray @return on translateFPRegister(). [-Wdocumentation]
NAKAMURA Takumi [Wed, 1 Jan 2014 16:19:26 +0000 (16:19 +0000)]
X86Disassembler.cpp: Prune stray @return on translateFPRegister(). [-Wdocumentation]

llvm-svn: 198279

10 years agoRemove need for MODIFIER_OPCODE in the disassembler tables. AddRegFrms are really...
Craig Topper [Wed, 1 Jan 2014 15:29:32 +0000 (15:29 +0000)]
Remove need for MODIFIER_OPCODE in the disassembler tables. AddRegFrms are really more like OrRegFrm so we don't need a difference since we can just mask bits.

llvm-svn: 198278

10 years agoAVX-512: Added intrinsics for vcvt, vcvtt, vrndscale, vcmp
Elena Demikhovsky [Wed, 1 Jan 2014 15:12:34 +0000 (15:12 +0000)]
AVX-512: Added intrinsics for vcvt, vcvtt, vrndscale, vcmp
Printing rounding control.
Enncoding for EVEX_RC (rounding control).

llvm-svn: 198277

10 years agoSecond attempt at Removing special form of AddRegFrm used by FP instructions. These...
Craig Topper [Wed, 1 Jan 2014 14:22:37 +0000 (14:22 +0000)]
Second attempt at Removing special form of AddRegFrm used by FP instructions. These instructions can be handled by MRMXr instead.

llvm-svn: 198276

10 years agoRemove extra semicolon.
Joey Gouly [Wed, 1 Jan 2014 10:07:45 +0000 (10:07 +0000)]
Remove extra semicolon.

llvm-svn: 198275

10 years agoUpdate the copyright credits -- Happy new year 2014!
NAKAMURA Takumi [Wed, 1 Jan 2014 08:27:31 +0000 (08:27 +0000)]
Update the copyright credits -- Happy new year 2014!

FIXME: Dragonegg may be updated at non-trivial changes.
llvm-svn: 198274

10 years agoSilence g++ 4.9 build issue in unit tests
Alp Toker [Wed, 1 Jan 2014 06:57:01 +0000 (06:57 +0000)]
Silence g++ 4.9 build issue in unit tests

Stopgap measure until we can just use static_assert().

llvm-svn: 198273

10 years agoRemove an unused diag left over from r198046
Alp Toker [Wed, 1 Jan 2014 06:07:48 +0000 (06:07 +0000)]
Remove an unused diag left over from r198046

llvm-svn: 198272

10 years agoEliminate UnaryTypeTraitExpr
Alp Toker [Wed, 1 Jan 2014 05:57:51 +0000 (05:57 +0000)]
Eliminate UnaryTypeTraitExpr

Remove UnaryTypeTraitExpr and switch all remaining type trait related handling
over to TypeTraitExpr.

The UTT/BTT/TT enum prefix and evaluation code is retained pending further
cleanup.

This is part of the ongoing work to unify type traits following the removal of
BinaryTypeTraitExpr in r197273.

llvm-svn: 198271

10 years agoExpectAndConsume: Diagnose errors automatically
Alp Toker [Wed, 1 Jan 2014 03:08:43 +0000 (03:08 +0000)]
ExpectAndConsume: Diagnose errors automatically

 1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics
    using the generic diagnostic descriptions added in r197972, eliminating another
    set of trivial err_expected_* variations while maintaining existing behaviour.

 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume
    family of functions are primitive parser operations that now have the
    well-defined property of operating on single tokens. Factoring out recovery
    exposes opportunities for more consistent and tailored error recover at the
    call sites instead of just relying on a bottled SkipUntil formula.

llvm-svn: 198270

10 years agoAdd two fp test cases I missed in my previous commit.
Craig Topper [Tue, 31 Dec 2013 23:15:19 +0000 (23:15 +0000)]
Add two fp test cases I missed in my previous commit.

llvm-svn: 198269

10 years agoAdd more X86 FP stack disassembler test cases.
Craig Topper [Tue, 31 Dec 2013 22:51:53 +0000 (22:51 +0000)]
Add more X86 FP stack disassembler test cases.

llvm-svn: 198268

10 years agoFold vector selects with undef elements in the condition. Fixes PR18319.
Nick Lewycky [Tue, 31 Dec 2013 19:30:47 +0000 (19:30 +0000)]
Fold vector selects with undef elements in the condition. Fixes PR18319.
Patch by Ilia Filippov!

llvm-svn: 198267

10 years agoThe return value of createInternalFiles is unused, so remove it.
Joey Gouly [Tue, 31 Dec 2013 19:15:42 +0000 (19:15 +0000)]
The return value of createInternalFiles is unused, so remove it.

llvm-svn: 198266

10 years agoRevert r198238 and add FP disassembler tests. It didn't work and I didn't realized...
Craig Topper [Tue, 31 Dec 2013 17:21:44 +0000 (17:21 +0000)]
Revert r198238 and add FP disassembler tests. It didn't work and I didn't realized we had no FP disassembler test cases.

llvm-svn: 198265

10 years ago[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.
Joey Gouly [Tue, 31 Dec 2013 15:47:49 +0000 (15:47 +0000)]
[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.

Patch by joey.gouly@arm.com

llvm-svn: 198264

10 years agoRemove old comment referring to an argument that no longer exists.
Craig Topper [Tue, 31 Dec 2013 15:29:14 +0000 (15:29 +0000)]
Remove old comment referring to an argument that no longer exists.

llvm-svn: 198263

10 years agoFix misaligned indentation in "if" block in MipsMCCodeEmitter.cpp
Mark Seaborn [Tue, 31 Dec 2013 13:05:15 +0000 (13:05 +0000)]
Fix misaligned indentation in "if" block in MipsMCCodeEmitter.cpp

llvm-svn: 198262

10 years agotsan: fix Go build
Dmitry Vyukov [Tue, 31 Dec 2013 09:38:23 +0000 (09:38 +0000)]
tsan: fix Go build
Currently fails with:
gotsan.cc:7686:40: error: the address of 'int __sanitizer_pthread_attr_getstack(void*, void**, size_t*)' will always evaluate as 'true' [-Werror=address]

llvm-svn: 198261

10 years agoRecover from errors in enum definition
Serge Pavlov [Tue, 31 Dec 2013 06:26:03 +0000 (06:26 +0000)]
Recover from errors in enum definition

Previously any error in enum definition body stopped parsing it. With this
change parser tries to recover from errors.
The patch fixes PR10982.

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

llvm-svn: 198259

10 years agoAdd missing MRM_XX forms to the old JIT emitter for consistency.
Craig Topper [Tue, 31 Dec 2013 03:26:24 +0000 (03:26 +0000)]
Add missing MRM_XX forms to the old JIT emitter for consistency.

llvm-svn: 198258

10 years agoRemove MRMInitReg form now that it's last use is gone.
Craig Topper [Tue, 31 Dec 2013 03:19:03 +0000 (03:19 +0000)]
Remove MRMInitReg form now that it's last use is gone.

llvm-svn: 198257

10 years agoSilence g++ 4.9 build issue
Alp Toker [Tue, 31 Dec 2013 03:16:57 +0000 (03:16 +0000)]
Silence g++ 4.9 build issue

lib/ASTMatchers/ASTMatchFinder.cpp:276:28: error: typedef 'traverse_can_only_be_instantiated_with_base_type' locally defined but not used [-Werror=unused-local-typedefs]
                            traverse_can_only_be_instantiated_with_base_type);

llvm-svn: 198256

10 years agoSilence g++ 4.9 build issue
Alp Toker [Tue, 31 Dec 2013 03:16:55 +0000 (03:16 +0000)]
Silence g++ 4.9 build issue

lib/Support/ThreadLocal.cpp:53:15: error: typedef 'SIZE_TOO_BIG' locally defined but not used [-Werror=unused-local-typedefs]
   typedef int SIZE_TOO_BIG[sizeof(pthread_key_t) <= sizeof(data) ? 1 : -1];

Done the C++11 way, switching on and using LLVM_STATIC_ASSERT() instead of LLVM_ATTRIBUTE_UNUSED.

llvm-svn: 198255

10 years agoHandle MOV32r0 in expandPostRAPseudo instead of MCInst lowering. No functional change...
Craig Topper [Tue, 31 Dec 2013 03:05:38 +0000 (03:05 +0000)]
Handle MOV32r0 in expandPostRAPseudo instead of MCInst lowering. No functional change intended.

llvm-svn: 198254

10 years agoFix an ODR violation in the sanitizer runtimes.
Chandler Carruth [Mon, 30 Dec 2013 23:36:11 +0000 (23:36 +0000)]
Fix an ODR violation in the sanitizer runtimes.

A helper function is a C++ function, and so even though one of the two
definitions is weak, it still technically triggers the ODR. Perhaps
these two definitions are ODR equivalent, but I'm not even confident in
that.

Instead, just define the function once, declare it as weak, and use
a wrapper that is clearly file-local. This avoids two definitions. Also
make the function extern "C" so that we can't even mess up the type
signature somehow or otherwise fail to match up the weak declaration
here with the interceptor defined elsewhere.

llvm-svn: 198253

10 years agoSwitch over more of the parser to err_expected
Alp Toker [Mon, 30 Dec 2013 23:29:50 +0000 (23:29 +0000)]
Switch over more of the parser to err_expected

Includes a fix for a missing highlight range caused by a ',' typo in the PP
diagnostics.

llvm-svn: 198252

10 years agoUpdate DataRecursiveASTVisitor so that it visits attributes.
DeLesley Hutchins [Mon, 30 Dec 2013 21:03:02 +0000 (21:03 +0000)]
Update DataRecursiveASTVisitor so that it visits attributes.

llvm-svn: 198249

10 years agoFix two typos in comments. No functionality change.
Nick Lewycky [Mon, 30 Dec 2013 20:16:30 +0000 (20:16 +0000)]
Fix two typos in comments. No functionality change.

llvm-svn: 198243

10 years agoMerge case statements to remove redundant code.
Craig Topper [Mon, 30 Dec 2013 19:47:49 +0000 (19:47 +0000)]
Merge case statements to remove redundant code.

llvm-svn: 198241

10 years agoRemove special form of AddRegFrm used by FP instructions. These instructions can...
Craig Topper [Mon, 30 Dec 2013 19:16:48 +0000 (19:16 +0000)]
Remove special form of AddRegFrm used by FP instructions. These instructions can be handled by MRMXr instead.

llvm-svn: 198238

10 years agoARM IAS: account for predicated pre-UAL mnemonics
Saleem Abdulrasool [Mon, 30 Dec 2013 18:38:01 +0000 (18:38 +0000)]
ARM IAS: account for predicated pre-UAL mnemonics

Checking the trailing letter of the mnemonic is insufficient.  Be more thorough
in the scanning of the instruction to ensure that we correctly work with the
predicated mnemonics.

llvm-svn: 198235

10 years agoRefactor and reduce code duplication for non-split dwarf strings.
Eric Christopher [Mon, 30 Dec 2013 18:32:31 +0000 (18:32 +0000)]
Refactor and reduce code duplication for non-split dwarf strings.

llvm-svn: 198233

10 years agoRemove linkage macro from the CXLanguageKind enum
Reid Kleckner [Mon, 30 Dec 2013 17:48:49 +0000 (17:48 +0000)]
Remove linkage macro from the CXLanguageKind enum

Enums don't have linkage, so clang warns when this expands to dllimport.

llvm-svn: 198227

10 years agoRemove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilt...
Craig Topper [Mon, 30 Dec 2013 17:37:10 +0000 (17:37 +0000)]
Remove EscapeFilter. It's funcionality can be covered by correctly using ExtendedFilter and ExactFilter. No functional change.

llvm-svn: 198226

10 years agoUpdate RecursiveASTVisitor so that it visits attributes. This is currently
DeLesley Hutchins [Mon, 30 Dec 2013 17:24:36 +0000 (17:24 +0000)]
Update RecursiveASTVisitor so that it visits attributes.  This is currently
important for thread safety attributes, which contain expressions that were
not being visited, and were thus invisible to various tools.  There are now
Visit*Attr methods that can be overridden for every attribute.

llvm-svn: 198224

10 years agoRevert r198208 and reapply:
Eric Christopher [Mon, 30 Dec 2013 17:22:27 +0000 (17:22 +0000)]
Revert r198208 and reapply:

      r198196: Use a pointer to keep track of the skeleton unit for each normal unit and construct it up front.
      r198199: Reapply r198196 with a fix to zero initialize the skeleton pointer.
      r198202: Fix aranges and split dwarf by ensuring that the symbol and relocation back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo.

with a fix to use integer 0 for DW_AT_low_pc since the relocation to the text section symbol was causing issues with COFF. Accordingly remove addLocalLabelAddress and machinery since we're not currently using it.

llvm-svn: 198222

10 years agoSimplify filter accepts function to just return 'condition' instead of branching...
Craig Topper [Mon, 30 Dec 2013 17:22:20 +0000 (17:22 +0000)]
Simplify filter accepts function to just return 'condition' instead of branching to return true/false. No functional change.

llvm-svn: 198221

10 years agoChanged the test to avoid EXPECT_EQ(false, ...), which leads to
Alexander Kornienko [Mon, 30 Dec 2013 16:11:28 +0000 (16:11 +0000)]
Changed the test to avoid EXPECT_EQ(false, ...), which leads to
-Wconversion-null warning in GCC.

llvm-svn: 198214

10 years ago[libsanitizer] fix lint errors
Alexander Potapenko [Mon, 30 Dec 2013 11:12:11 +0000 (11:12 +0000)]
[libsanitizer] fix lint errors

llvm-svn: 198209

10 years agoRevert r198199 (and r198202). It broke 3 DebugInfo tests for targeting i686-cygming.
NAKAMURA Takumi [Mon, 30 Dec 2013 09:26:10 +0000 (09:26 +0000)]
Revert r198199 (and r198202). It broke 3 DebugInfo tests for targeting i686-cygming.

  r198196: Use a pointer to keep track of the skeleton unit for each normal unit and construct it up front.
  r198199: Reapply r198196 with a fix to zero initialize the skeleton pointer.
  r198202: Fix aranges and split dwarf by ensuring that the symbol and relocation back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo.

They could be reproducible with explicit target.

  llvm/lib/MC/WinCOFFObjectWriter.cpp:224: bool {anonymous}::COFFSymbol::should_keep() const: Assertion `Section->Number != -1 && "Sections with relocations must be real!"' failed.

llvm-svn: 198208

10 years ago[libsanitizer] Remove the redundant spaces between '#' and 'define'.
Alexander Potapenko [Mon, 30 Dec 2013 09:22:06 +0000 (09:22 +0000)]
[libsanitizer] Remove the redundant spaces between '#' and 'define'.
These definitions weren't included in any #ifdef blocks, and the spaces were placed inconsistently.

llvm-svn: 198207

10 years ago[CMake] Generate ${BUILD_MODE}/llvm-lit for each ${CMAKE_CONFIGURATION_TYPES}.
NAKAMURA Takumi [Mon, 30 Dec 2013 07:02:12 +0000 (07:02 +0000)]
[CMake] Generate ${BUILD_MODE}/llvm-lit for each ${CMAKE_CONFIGURATION_TYPES}.

llvm-lit can be invoked;

  $ Release/bin/llvm-lit

instead of;

  $ bin/llvm-lit --param buid_mode=Release

llvm-svn: 198206

10 years ago[CMake][VS][XCode] Restruct the output directory layout more comfortable, ${BINARY_DI...
NAKAMURA Takumi [Mon, 30 Dec 2013 06:48:30 +0000 (06:48 +0000)]
[CMake][VS][XCode] Restruct the output directory layout more comfortable, ${BINARY_DIR}/${BUILD_MODE}/(bin|lib)

We have been seeing nasty directory layout with CMake multiconfig, such as,
  bin/Release/clang.exe
  lib/clang/3.x/...
  lib/Release/clang/3.x/.. (duplicated)

Move the layout similar to autoconf's;
  Release/bin/clang.exe
  Release/lib/clang/3.x/...

Checked on Visual Studio 10. Could you guys please confirm my change on XCode(and other multiconfig builders)?

Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more, or a certain builder, for eaxample, msbuild.exe, would be confused.
llvm-svn: 198205

10 years agoMake lit.site.cfg Py3-compatible. Copied from r188041.
NAKAMURA Takumi [Mon, 30 Dec 2013 06:18:08 +0000 (06:18 +0000)]
Make lit.site.cfg Py3-compatible. Copied from r188041.

llvm-svn: 198204

10 years ago Visual C++ does not support -ffunction-sections -fdata-sections.
Yaron Keren [Mon, 30 Dec 2013 05:31:53 +0000 (05:31 +0000)]
 Visual C++ does not support -ffunction-sections -fdata-sections.

llvm-svn: 198203

10 years agoFix aranges and split dwarf by ensuring that the symbol and relocation
Eric Christopher [Mon, 30 Dec 2013 05:25:49 +0000 (05:25 +0000)]
Fix aranges and split dwarf by ensuring that the symbol and relocation
back to the compile unit from the aranges section is to the skeleton
unit and not the one in the dwo.

Do this by adding a method to grab a forwarded on local sym and local
section by querying the skeleton if one exists and using that. Add
a few tests to verify the relocations are back to the correct section.

llvm-svn: 198202

10 years agoKeep comment with 'Subtarget' ivar.
Bill Wendling [Mon, 30 Dec 2013 05:17:29 +0000 (05:17 +0000)]
Keep comment with 'Subtarget' ivar.

llvm-svn: 198201

10 years agoPort r198088 (set NO_DEAD_STRIP for clang) from make to cmake.
Nico Weber [Mon, 30 Dec 2013 03:43:30 +0000 (03:43 +0000)]
Port r198088 (set NO_DEAD_STRIP for clang) from make to cmake.

Also stop setting passing -dead_strip explicitly for libclang and instead
rely on this now happening by default. (And make it happen by default for
add_clang_library, which doesn't use the library cmake functions from llvm.)

llvm-svn: 198200

10 years agoReapply r198196 with a fix to zero initialize the skeleton pointer.
Eric Christopher [Mon, 30 Dec 2013 03:40:32 +0000 (03:40 +0000)]
Reapply r198196 with a fix to zero initialize the skeleton pointer.

llvm-svn: 198199