platform/upstream/llvm.git
11 years agoFix another regression for pointer types.
Daniel Jasper [Wed, 23 Jan 2013 12:10:53 +0000 (12:10 +0000)]
Fix another regression for pointer types.

Before: if (int * a = &b) ...
After:  if (int *a = &b) ...

Also changed all the existing tests to test the expressions in question
both in a declaration and in an expression context.

llvm-svn: 173256

11 years agotsan: add stubs for malloc introspection (similar to what we have in asan)
Dmitry Vyukov [Wed, 23 Jan 2013 12:08:03 +0000 (12:08 +0000)]
tsan: add stubs for malloc introspection (similar to what we have in asan)

llvm-svn: 173255

11 years agoAdd a new LangOpt NativeHalfType. This option allows for native half/fp16
Joey Gouly [Wed, 23 Jan 2013 11:56:20 +0000 (11:56 +0000)]
Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.

llvm-svn: 173254

11 years agotsan: add missing interceptors
Dmitry Vyukov [Wed, 23 Jan 2013 11:52:19 +0000 (11:52 +0000)]
tsan: add missing interceptors

llvm-svn: 173253

11 years agoFix regression in formatting pointer types.
Daniel Jasper [Wed, 23 Jan 2013 11:15:14 +0000 (11:15 +0000)]
Fix regression in formatting pointer types.

We will need a more principled solution, but we should not leave this
unfixed until we come up with one.

Before: void f() { int * a; }
After:  void f() { int *a; }
llvm-svn: 173252

11 years ago[asan] simplify the code that poisons global redzones, add some more tests
Kostya Serebryany [Wed, 23 Jan 2013 11:14:21 +0000 (11:14 +0000)]
[asan] simplify the code that poisons global redzones, add some more tests

llvm-svn: 173251

11 years agoFixes incorrect handling of the declaration context stack.
Manuel Klimek [Wed, 23 Jan 2013 11:03:04 +0000 (11:03 +0000)]
Fixes incorrect handling of the declaration context stack.

llvm-svn: 173250

11 years ago[msan] gethostbyname interceptor.
Evgeniy Stepanov [Wed, 23 Jan 2013 10:43:38 +0000 (10:43 +0000)]
[msan] gethostbyname interceptor.

llvm-svn: 173249

11 years agoFix segfaults in the formatter.
Manuel Klimek [Wed, 23 Jan 2013 10:09:28 +0000 (10:09 +0000)]
Fix segfaults in the formatter.

Also: expletive deleted.
llvm-svn: 173247

11 years agoAdd option to allow putting all parameters onto the next line.
Daniel Jasper [Wed, 23 Jan 2013 10:08:28 +0000 (10:08 +0000)]
Add option to allow putting all parameters onto the next line.

This only affects styles where BinPackParameters is false.

With AllowAllParametersOnNextLine:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Without it:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaa,
                                         aaaaaaaaaa,
                                         aaaaaaaaaa,
                                         aaaaaaaaaaa,
                                         aaaaaaaaaaa);

llvm-svn: 173246

11 years agoAllow us to better guess the context of an unwrapped line.
Manuel Klimek [Wed, 23 Jan 2013 09:32:48 +0000 (09:32 +0000)]
Allow us to better guess the context of an unwrapped line.

This gives us the ability to guess better defaults for whether a *
between identifiers is a pointer dereference or binary operator.

Now correctly formats:
void f(a *b);
void f() { f(a * b); }

llvm-svn: 173243

11 years agoInitialize the components of this class. Otherwise GCC thinks that Array may be
Duncan Sands [Wed, 23 Jan 2013 09:09:50 +0000 (09:09 +0000)]
Initialize the components of this class.  Otherwise GCC thinks that Array may be
used uninitialized, since it fails to understand that Array is only used when
SingleValue is not, and outputs a warning.  It also seems generally safer given
that the constructor is non-trivial and has plenty of early exits.

llvm-svn: 173242

11 years agoExplicitly cast away the const-ness instead of doing it implicitly.
Bill Wendling [Wed, 23 Jan 2013 08:58:23 +0000 (08:58 +0000)]
Explicitly cast away the const-ness instead of doing it implicitly.

llvm-svn: 173241

11 years agollvm/unittests: Use OwningPtr to fix --vg-leak.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:33:13 +0000 (08:33 +0000)]
llvm/unittests: Use OwningPtr to fix --vg-leak.

llvm-svn: 173240

11 years agoIRTests/WaymarkTest.cpp: Fix in --vg-leak.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:33:05 +0000 (08:33 +0000)]
IRTests/WaymarkTest.cpp: Fix in --vg-leak.

llvm-svn: 173239

11 years agoIRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not linked.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:31:28 +0000 (08:31 +0000)]
IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not linked.

llvm-svn: 173238

11 years agoIRTests/IRBuilderTest.cpp: Let GV added to the module.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:39 +0000 (08:30 +0000)]
IRTests/IRBuilderTest.cpp: Let GV added to the module.

It fixes --vg-leak.

llvm-svn: 173237

11 years agoIRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately...
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:26 +0000 (08:30 +0000)]
IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.

llvm-svn: 173236

11 years agoUntabify.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:21 +0000 (08:30 +0000)]
Untabify.

llvm-svn: 173235

11 years agoWhitespace.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:15 +0000 (08:30 +0000)]
Whitespace.

llvm-svn: 173234

11 years agoDominatorTreeTest.cpp: Add the file header.
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:10 +0000 (08:30 +0000)]
DominatorTreeTest.cpp: Add the file header.

llvm-svn: 173233

11 years agoExplicitly cast away the const-ness instead of doing it implicitly.
Bill Wendling [Wed, 23 Jan 2013 08:25:41 +0000 (08:25 +0000)]
Explicitly cast away the const-ness instead of doing it implicitly.

llvm-svn: 173232

11 years agoAdd the heuristic to differentiate SSPStrong from SSPRequired.
Bill Wendling [Wed, 23 Jan 2013 06:43:53 +0000 (06:43 +0000)]
Add the heuristic to differentiate SSPStrong from SSPRequired.

The requirements of the strong heuristic are:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)

llvm-svn: 173231

11 years agoAdd the IR attribute 'sspstrong'.
Bill Wendling [Wed, 23 Jan 2013 06:41:41 +0000 (06:41 +0000)]
Add the IR attribute 'sspstrong'.

SSPStrong applies a heuristic to insert stack protectors in these situations:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)

This patch implements the SSPString attribute to be equivalent to
SSPRequired. This will change in a subsequent patch.

llvm-svn: 173230

11 years agoRemove the last of uses that use the Attribute object as a collection of attributes.
Bill Wendling [Wed, 23 Jan 2013 06:15:10 +0000 (06:15 +0000)]
Remove the last of uses that use the Attribute object as a collection of attributes.

Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.

llvm-svn: 173229

11 years agoRemove the last of uses that use the Attribute object as a collection of attributes.
Bill Wendling [Wed, 23 Jan 2013 06:14:59 +0000 (06:14 +0000)]
Remove the last of uses that use the Attribute object as a collection of attributes.

Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.

llvm-svn: 173228

11 years agoMake __attribute__((nonnull)) use the general expression evaluator to search for
Nick Lewycky [Wed, 23 Jan 2013 05:08:29 +0000 (05:08 +0000)]
Make __attribute__((nonnull)) use the general expression evaluator to search for
nulls instead of limiting itself to the language-defined "null pointer
constant".

llvm-svn: 173227

11 years agoRemove a compile time warning in RNBRemote::HandlePacket_qProcessInfo
Jason Molenda [Wed, 23 Jan 2013 04:39:43 +0000 (04:39 +0000)]
Remove a compile time warning in RNBRemote::HandlePacket_qProcessInfo
for non-x86 builds.

llvm-svn: 173226

11 years agoChange the container-regs kv pair in the qRegsiterInfo
Jason Molenda [Wed, 23 Jan 2013 04:38:32 +0000 (04:38 +0000)]
Change the container-regs kv pair in the qRegsiterInfo
reply to be hex encoded, not decimal.

Fix the whitespace in the container-regs/invalidate-regs
documentation, fix one ambiguous hex/decimal number in an
example.

llvm-svn: 173225

11 years agodocs: Update title of external tutorial.
Sean Silva [Wed, 23 Jan 2013 03:21:41 +0000 (03:21 +0000)]
docs: Update title of external tutorial.

llvm-svn: 173224

11 years agoR600: rework handling of the constants
Tom Stellard [Wed, 23 Jan 2013 02:09:06 +0000 (02:09 +0000)]
R600: rework handling of the constants

Remove Cxxx registers, add new special register - "ALU_CONST" and new
operand for each alu src - "sel". ALU_CONST is used to designate that the
new operand contains the value to override src.sel, src.kc_bank, src.chan
for constants in the driver.

Patch by: Vadim Girlin

Vincent Lejeune:
  - Use pointers for constants
  - Fold CONST_ADDRESS when possible

Tom Stellard:
  - Give CONSTANT_BUFFER_0 its own address space
  - Use integer types for constant loads

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173222

11 years agoR600: Add a CONST_ADDRESS node to model constant buf read
Tom Stellard [Wed, 23 Jan 2013 02:09:03 +0000 (02:09 +0000)]
R600: Add a CONST_ADDRESS node to model constant buf read

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173221

11 years agoR600: Factorise VTX_WORD0 and VTX_WORD1 in tblgen def
Tom Stellard [Wed, 23 Jan 2013 02:09:01 +0000 (02:09 +0000)]
R600: Factorise VTX_WORD0 and VTX_WORD1 in tblgen def

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173220

11 years agoAdd support for reverse pointer induction variables. These are loops that contain...
Nadav Rotem [Wed, 23 Jan 2013 01:35:00 +0000 (01:35 +0000)]
Add support for reverse pointer induction variables. These are loops that contain pointers that count backwards.
For example, this is the hot loop in BZIP:

  do {
    m = *--p;
    *p = ( ... );
  } while (--n);

llvm-svn: 173219

11 years agoclang/test/Driver/output-file-is-dir.c: This requires shell due to 'cd'.
NAKAMURA Takumi [Wed, 23 Jan 2013 01:25:23 +0000 (01:25 +0000)]
clang/test/Driver/output-file-is-dir.c: This requires shell due to 'cd'.

llvm-svn: 173218

11 years agoMove everything over to TargetInfo.
Michael J. Spencer [Wed, 23 Jan 2013 01:18:43 +0000 (01:18 +0000)]
Move everything over to TargetInfo.

I really would have liked to split this patch up, but it would greatly
complicate the lld-core and lld drivers having to deal with both
{Reader,Writer}Option and TargetInfo.

llvm-svn: 173217

11 years ago<rdar://problem/12711206>
Enrico Granata [Wed, 23 Jan 2013 01:17:27 +0000 (01:17 +0000)]
<rdar://problem/12711206>

Extending ValueObjectDynamicValue so that it stores a TypeAndOrName instead of a TypeSP.
This change allows us to reflect the notion that a ValueObject can have a dynamic type for which we have no debug information.
Previously, we would coalesce that to the static type of the object, potentially losing relevant information or even getting it wrong.
This fix ensures we can correctly report the class name for Cocoa objects whose types are hidden classes that we know nothing about (e.g. __NSArrayI for immutable arrays).
As a side effect, our --show-types argument to frame variable no longer needs to append custom dynamic type information.

llvm-svn: 173216

11 years ago[Driver] Don't remove non-regular files that were outputs.
Daniel Dunbar [Wed, 23 Jan 2013 01:08:23 +0000 (01:08 +0000)]
[Driver] Don't remove non-regular files that were outputs.

llvm-svn: 173215

11 years agoUse the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
Bill Wendling [Wed, 23 Jan 2013 00:45:55 +0000 (00:45 +0000)]
Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.

llvm-svn: 173214

11 years agoDocumentation cleanup: fixing documentation for FrontendAction.
James Dennett [Wed, 23 Jan 2013 00:45:44 +0000 (00:45 +0000)]
Documentation cleanup: fixing documentation for FrontendAction.
* Fix a typo, s/BeginSourceAction/BeginSourceFile/, so that the documentation
  for FrontendAction::BeginSourceFileAction links correctly to BeginSourceFile;
* Add some basic \file documentation for FrontendAction.h;
* More use of "\brief" instead of repeating the name of the entity being
  documented;
* Stop using Doxygen-style "///" comments in FrontendAction.cpp, as they were
  polluting the documentation for BeginSourceFile;
* Drop incorrect "\see" markup that broke Doxygen's formatting;
* Other minor documentation fixes.

llvm-svn: 173213

11 years ago[Support][ErrorOr] Don't use nullptr :(
Michael J. Spencer [Wed, 23 Jan 2013 00:22:30 +0000 (00:22 +0000)]
[Support][ErrorOr] Don't use nullptr :(

llvm-svn: 173212

11 years agoUse the AttributeSet when adding multiple attributes and an Attribute::AttrKind
Bill Wendling [Wed, 23 Jan 2013 00:21:06 +0000 (00:21 +0000)]
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.

llvm-svn: 173211

11 years agoUse the AttributeSet when adding multiple attributes and an Attribute::AttrKind
Bill Wendling [Wed, 23 Jan 2013 00:20:53 +0000 (00:20 +0000)]
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.

llvm-svn: 173210

11 years ago[Support][ErrorOr] Add optimized specialization of ErrorOr<void>.
Michael J. Spencer [Wed, 23 Jan 2013 00:18:31 +0000 (00:18 +0000)]
[Support][ErrorOr] Add optimized specialization of ErrorOr<void>.

ErrorOr<void> represents an operation that returns nothing, but can still fail.
It should be used in cases where you need the aditional user data that ErrorOr
provides over error_code.

llvm-svn: 173209

11 years agoFix compilation on Linux, which defines PATH_MAX in a weird place,
Douglas Gregor [Tue, 22 Jan 2013 23:49:45 +0000 (23:49 +0000)]
Fix compilation on Linux, which defines PATH_MAX in a weird place,
from Saleem Abdulrasool!

llvm-svn: 173208

11 years agoAdd instruction encodings / disassembly support for u10 / lu10 instructions.
Richard Osborne [Tue, 22 Jan 2013 22:55:04 +0000 (22:55 +0000)]
Add instruction encodings / disassembly support for u10 / lu10 instructions.

llvm-svn: 173204

11 years ago[Support][ErrorOr] Make old gcc happy.
Michael J. Spencer [Tue, 22 Jan 2013 22:48:46 +0000 (22:48 +0000)]
[Support][ErrorOr] Make old gcc happy.

Apparently this is how C++98 worked pre-DR. (Thanks Richard).

llvm-svn: 173203

11 years agoFixed typo.
Michael Gottesman [Tue, 22 Jan 2013 21:53:43 +0000 (21:53 +0000)]
Fixed typo.

llvm-svn: 173202

11 years ago[ObjCARC] Refactored out the inner most 2-loops from PerformCodePlacement into the...
Michael Gottesman [Tue, 22 Jan 2013 21:49:00 +0000 (21:49 +0000)]
[ObjCARC] Refactored out the inner most 2-loops from PerformCodePlacement into the method ConnectTDBUTraversals.

The method PerformCodePlacement was doing too much (i.e. 3x loops, lots of
different checking). This refactoring separates the analysis section of the
method into a separate function while leaving the actual code placement and
analysis preparation in PerformCodePlacement.

*NOTE* Really this part of ObjCARC should be refactored out of the main pass
class into its own seperate class/struct. But, it is not time to make that
change yet though (don't want to make such an invasive change without fixing all
of the bugs first).

llvm-svn: 173201

11 years agoFix an issue of pseudo atomic instruction DAG schedule
Michael Liao [Tue, 22 Jan 2013 21:47:38 +0000 (21:47 +0000)]
Fix an issue of pseudo atomic instruction DAG schedule

- Add list of physical registers clobbered in pseudo atomic insts
  Physical registers are clobbered when pseudo atomic instructions are
  expanded. Add them in clobber list to prevent DAG scheduler to
  mis-schedule them after these insns are declared side-effect free.
- Add test case from Michael Kuperstein <michael.m.kuperstein@intel.com>

llvm-svn: 173200

11 years agoAdd a warning when there is a macro defintion that has named parameters but
Kevin Enderby [Tue, 22 Jan 2013 21:44:53 +0000 (21:44 +0000)]
Add a warning when there is a macro defintion that has named parameters but
the body does not use them and it appears the body has positional parameters.

This can cause unexpected results as in the added test case.  As the darwin
version of gas(1) which only supported positional parameters, happened to
ignore the named parameters.  Now that we want to support both styles of
macros we issue a warning in this specific case.

rdar://12861644

llvm-svn: 173199

11 years agoAdd a triple, per Ben's suggestion.
Chad Rosier [Tue, 22 Jan 2013 21:39:58 +0000 (21:39 +0000)]
Add a triple, per Ben's suggestion.

llvm-svn: 173198

11 years ago[mips] Implement MipsRegisterInfo::getRegPressureLimit.
Akira Hatanaka [Tue, 22 Jan 2013 21:34:25 +0000 (21:34 +0000)]
[mips] Implement MipsRegisterInfo::getRegPressureLimit.

llvm-svn: 173197

11 years agoMore encapsulation work.
Bill Wendling [Tue, 22 Jan 2013 21:15:51 +0000 (21:15 +0000)]
More encapsulation work.

Use the AttributeSet when we're talking about more than one attribute. Add a
function that adds a single attribute. No functionality change intended.

llvm-svn: 173196

11 years agoHave the integrated assembler give an error if $1 is used as an identifier in
Kevin Enderby [Tue, 22 Jan 2013 21:09:20 +0000 (21:09 +0000)]
Have the integrated assembler give an error if $1 is used as an identifier in
an expression.  Currently this bug causes the line to be ignored in a
release build and an assert in a debug build.

rdar://13062484

llvm-svn: 173195

11 years agoSecond attempt to fix ppc bots.
Chad Rosier [Tue, 22 Jan 2013 20:57:10 +0000 (20:57 +0000)]
Second attempt to fix ppc bots.

llvm-svn: 173193

11 years ago[Core] Move Resolver and SymbolTable over to TargetInfo.
Michael J. Spencer [Tue, 22 Jan 2013 20:49:42 +0000 (20:49 +0000)]
[Core] Move Resolver and SymbolTable over to TargetInfo.

No functionality change.

llvm-svn: 173192

11 years agoAdd x86 requirement to hopefully fix ppc bots.
Chad Rosier [Tue, 22 Jan 2013 20:16:41 +0000 (20:16 +0000)]
Add x86 requirement to hopefully fix ppc bots.

llvm-svn: 173190

11 years ago[mips] Clean up code in MipsTargetLowering::LowerCall. No functional change
Akira Hatanaka [Tue, 22 Jan 2013 20:05:56 +0000 (20:05 +0000)]
[mips] Clean up code in MipsTargetLowering::LowerCall. No functional change
intended

llvm-svn: 173189

11 years agoPowerPC: fix __builtin_eh_return_data_regno return
Adhemerval Zanella [Tue, 22 Jan 2013 20:02:45 +0000 (20:02 +0000)]
PowerPC: fix __builtin_eh_return_data_regno return

llvm-svn: 173188

11 years ago[ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-style
Chad Rosier [Tue, 22 Jan 2013 19:38:32 +0000 (19:38 +0000)]
[ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag.  MS-style
inline assembly can be enable with -fasm-blocks or -fms-extensions alone.

llvm-svn: 173186

11 years agoSplit "discards qualifiers" warnings of -Wincompatible-pointer-types into subgroup.
Ted Kremenek [Tue, 22 Jan 2013 19:32:27 +0000 (19:32 +0000)]
Split "discards qualifiers" warnings of -Wincompatible-pointer-types into subgroup.

This allows users to promote -Wincompatible-pointer-type warnings to
errors but keep those for "discard qualifiers" as warnings (if they
so desire).

Addresses <rdar://problem/13062738>.

llvm-svn: 173184

11 years agoUpdate docs: nullptr conversion tool landed
Dmitri Gribenko [Tue, 22 Jan 2013 19:22:22 +0000 (19:22 +0000)]
Update docs: nullptr conversion tool landed

llvm-svn: 173183

11 years agoSmall code change to improve performance
Fariborz Jahanian [Tue, 22 Jan 2013 19:05:17 +0000 (19:05 +0000)]
Small code change to improve performance
in my last patch, suggested by Argyrios.

llvm-svn: 173182

11 years agoAdd forgotten test case for the x32 commit
Eli Bendersky [Tue, 22 Jan 2013 18:52:39 +0000 (18:52 +0000)]
Add forgotten test case for the x32 commit

llvm-svn: 173181

11 years agoobjectiveC (take two): don't warn when in -Wselector mode and
Fariborz Jahanian [Tue, 22 Jan 2013 18:35:43 +0000 (18:35 +0000)]
objectiveC (take two): don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

llvm-svn: 173179

11 years agoAdd use-nullptr transform to cpp11-migrate
Edwin Vane [Tue, 22 Jan 2013 18:31:49 +0000 (18:31 +0000)]
Add use-nullptr transform to cpp11-migrate

This transform converts the usage of null pointer constants (e.g. NULL, 0,
etc.) in legacy C++ code and converts them to use the new C++11 nullptr
keyword.
- Added use-nullptr transform.
- Added C++11 support to the final syntax check. Used ArgumentAdjuster class to
  add -std=c++11 option to the command line options.
- Added tests for use-nullptr transform.
- Added tests that exercises both loop-convert and use-nullptr in the source
  file.

TODO: There's a known bug when using both -loop-convert and -use-nullptr at the
      same time.

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
Reviewers: klimek, gribozavr
llvm-svn: 173178

11 years ago[ms-inline asm] Remove a warning about ms-style inline assembly not being
Chad Rosier [Tue, 22 Jan 2013 18:18:22 +0000 (18:18 +0000)]
[ms-inline asm] Remove a warning about ms-style inline assembly not being
supported.

llvm-svn: 173177

11 years agoX86: Make sure we account for the FMA4 register immediate value, otherwise rip-rel...
Benjamin Kramer [Tue, 22 Jan 2013 18:05:59 +0000 (18:05 +0000)]
X86: Make sure we account for the FMA4 register immediate value, otherwise rip-rel relocations will be off by one byte.

PR15040.

llvm-svn: 173176

11 years agoInitial patch for x32 ABI support.
Eli Bendersky [Tue, 22 Jan 2013 18:02:49 +0000 (18:02 +0000)]
Initial patch for x32 ABI support.

Add the x32 environment kind to the triple, and separate the concept of
pointer size and callee save stack slot size, since they're not equal
on x32.

llvm-svn: 173175

11 years agoSaleem Abdulrasool: If errno is defined as volatile int, the qualifier differences...
Howard Hinnant [Tue, 22 Jan 2013 17:26:08 +0000 (17:26 +0000)]
Saleem Abdulrasool: If errno is defined as volatile int, the qualifier differences can cause
template typename deductions on swap<> (used in string.cpp).  Use
decltype(errno) to replicate the type and qualifier information for holding the
errno value.  Because errno is expected to be assignable, there is no need to
use typename std::remove_const<decltype(errno)>::type to hold the value.

llvm-svn: 173172

11 years agoMake getDefinitiveDeclContext() actually return a DeclContext, as one
Douglas Gregor [Tue, 22 Jan 2013 17:08:30 +0000 (17:08 +0000)]
Make getDefinitiveDeclContext() actually return a DeclContext, as one
would expect, and clean up the return/break inconsistencies. Thanks,
Sebastian!

llvm-svn: 173171

11 years agoFix a bug in VarDecl::getSourceRange() for static member arrays with an element
Nico Weber [Tue, 22 Jan 2013 17:00:09 +0000 (17:00 +0000)]
Fix a bug in VarDecl::getSourceRange() for static member arrays with an element
type with an implicit initializer expression.

Patch from Will Wilson <will@indefiant.com>!

llvm-svn: 173170

11 years agoFormatter: Remove a fixme klimek fixed in r173168.
Nico Weber [Tue, 22 Jan 2013 16:53:59 +0000 (16:53 +0000)]
Formatter: Remove a fixme klimek fixed in r173168.

Add a few comments to the ObjC test cases.

llvm-svn: 173169

11 years agoImplements more principled comment parsing.
Manuel Klimek [Tue, 22 Jan 2013 16:31:55 +0000 (16:31 +0000)]
Implements more principled comment parsing.

Changing nextToken() in the UnwrappedLineParser to get the next
non-comment token. This allows us to correctly layout a whole class of
snippets, like:

if /* */(/* */ a /* */) /* */
  f() /* */; /* */
else /* */
  g();

Fixes a bug in the formatter where we would assume there is a previous
non-comment token.
Also adds the indent level of an unwrapped line to the debug output in
the parser.

llvm-svn: 173168

11 years agochange enum class to enum, as g++ doesnot support bitfields with enumerated classes...
Shankar Easwaran [Tue, 22 Jan 2013 14:58:51 +0000 (14:58 +0000)]
change enum class to enum, as g++ doesnot support bitfields with enumerated classes with c++11 flag set

llvm-svn: 173166

11 years agoSaleem Abdulrasool: __terminate_handler and __unexpected_handler are defined but...
Howard Hinnant [Tue, 22 Jan 2013 14:48:10 +0000 (14:48 +0000)]
Saleem Abdulrasool: __terminate_handler and __unexpected_handler are defined but not used when
building against libsupc++ as the functions for which they are used are provided
by libsupc++.  Simply preprocess them away when building against libsupc++.

llvm-svn: 173165

11 years agoSaleem Abdulrasool: Ensure that __GLIBCXX__ is defined when building with libsupc++.
Howard Hinnant [Tue, 22 Jan 2013 14:44:06 +0000 (14:44 +0000)]
Saleem Abdulrasool: Ensure that __GLIBCXX__ is defined when building with libsupc++.

llvm-svn: 173164

11 years agoTests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID
Dmitri Gribenko [Tue, 22 Jan 2013 14:39:21 +0000 (14:39 +0000)]
Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID

This is done to avoid odd test failures, like the one fixed in r171243.

llvm-svn: 173163

11 years ago[msan] Remove the trap handler code.
Evgeniy Stepanov [Tue, 22 Jan 2013 14:29:15 +0000 (14:29 +0000)]
[msan] Remove the trap handler code.

llvm-svn: 173161

11 years agoLet the formatter be more restrictive for breaking around . and ->
Daniel Jasper [Tue, 22 Jan 2013 14:28:24 +0000 (14:28 +0000)]
Let the formatter be more restrictive for breaking around . and ->

Before:
aaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
    .aaaaaaaaaaaaaaaaaa();

After:
aaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,
                aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa();

llvm-svn: 173160

11 years agollvm-symbolizer: factor out bits of the tool into separate LLVMSymbolize.{h,cpp}...
Alexey Samsonov [Tue, 22 Jan 2013 14:21:19 +0000 (14:21 +0000)]
llvm-symbolizer: factor out bits of the tool into separate LLVMSymbolize.{h,cpp} files. No functionality change.

llvm-svn: 173159

11 years ago[msan] Follow -msan-keep-going in reports from interceptors.
Evgeniy Stepanov [Tue, 22 Jan 2013 13:35:45 +0000 (13:35 +0000)]
[msan] Follow -msan-keep-going in reports from interceptors.

llvm-svn: 173158

11 years ago[msan] Fix linkage type of __msan_track_origins.
Evgeniy Stepanov [Tue, 22 Jan 2013 13:34:57 +0000 (13:34 +0000)]
[msan] Fix linkage type of __msan_track_origins.

llvm-svn: 173157

11 years ago[msan] Export the value of msan-keep-going flag for the runtime.
Evgeniy Stepanov [Tue, 22 Jan 2013 13:26:53 +0000 (13:26 +0000)]
[msan] Export the value of msan-keep-going flag for the runtime.

llvm-svn: 173156

11 years ago[msan] Simplify test code.
Evgeniy Stepanov [Tue, 22 Jan 2013 12:33:11 +0000 (12:33 +0000)]
[msan] Simplify test code.

llvm-svn: 173155

11 years ago[msan] Test handling of volatile bitfields.
Evgeniy Stepanov [Tue, 22 Jan 2013 12:31:39 +0000 (12:31 +0000)]
[msan] Test handling of volatile bitfields.

llvm-svn: 173154

11 years ago[msan] Do not insert check on volatile store.
Evgeniy Stepanov [Tue, 22 Jan 2013 12:30:52 +0000 (12:30 +0000)]
[msan] Do not insert check on volatile store.

Volatile bitfields can cause valid stores of uninitialized bits.

llvm-svn: 173153

11 years ago[msan] Stop using volatile assignments as undef checks in MSan tests.
Evgeniy Stepanov [Tue, 22 Jan 2013 12:29:00 +0000 (12:29 +0000)]
[msan] Stop using volatile assignments as undef checks in MSan tests.

A runtime call is used instead.
MSan will stop adding shadow checks on volatile stores soon.

llvm-svn: 173152

11 years agoFix truncation of relocation types in Support/ELF.h
Tim Northover [Tue, 22 Jan 2013 12:01:43 +0000 (12:01 +0000)]
Fix truncation of relocation types in Support/ELF.h

This is a follow-up to r171845, which fixes the same issue in the Support code.
Only targets with >256 relocations (principally AArch64) should be affected.

llvm-svn: 173151

11 years agoFix "*" formatting when creating arrays of pointers.
Daniel Jasper [Tue, 22 Jan 2013 11:46:26 +0000 (11:46 +0000)]
Fix "*" formatting when creating arrays of pointers.

Before: A = new int * [10]();
After:  A = new int *[10]();
llvm-svn: 173150

11 years ago[ASan] Disable the new/delete implementations for OSX
Alexander Potapenko [Tue, 22 Jan 2013 11:39:28 +0000 (11:39 +0000)]
[ASan] Disable the new/delete implementations for OSX
See https://code.google.com/p/address-sanitizer/issues/detail?id=131

llvm-svn: 173149

11 years agoBegin fleshing out an interface in TTI for modelling the costs of
Chandler Carruth [Tue, 22 Jan 2013 11:26:02 +0000 (11:26 +0000)]
Begin fleshing out an interface in TTI for modelling the costs of
generic function calls and intrinsics. This is somewhat overlapping with
an existing intrinsic cost method, but that one seems targetted at
vector intrinsics. I'll merge them or separate their names and use cases
in a separate commit.

This sinks the test of 'callIsSmall' down into TTI where targets can
control it. The whole thing feels very hack-ish to me though. I've left
a FIXME comment about the fundamental design problem this presents. It
isn't yet clear to me what the users of this function *really* care
about. I'll have to do more analysis to figure that out. Putting this
here at least provides it access to proper analysis pass tools and other
such. It also allows us to more cleanly implement the baseline cost
interfaces in TTI.

With this commit, it is now theoretically possible to simplify much of
the inline cost analysis's handling of calls by calling through to this
interface. That conversion will have to happen in subsequent commits as
it requires more extensive restructuring of the inline cost analysis.

The CodeMetrics class is now really only in the business of running over
a block of code and aggregating the metrics on that block of code, with
the actual cost evaluation done entirely in terms of TTI.

llvm-svn: 173148

11 years agoASan: add output test for -fsanitize-address-zero-based-shadow option on Linux
Alexey Samsonov [Tue, 22 Jan 2013 10:45:20 +0000 (10:45 +0000)]
ASan: add output test for -fsanitize-address-zero-based-shadow option on Linux

llvm-svn: 173146

11 years agoADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign...
NAKAMURA Takumi [Tue, 22 Jan 2013 10:39:31 +0000 (10:39 +0000)]
ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign-compare]

llvm-svn: 173144

11 years ago[ASan] Remove the declarations of pthread_workqueue_t and pthread_workitem_handle_t...
Alexander Potapenko [Tue, 22 Jan 2013 10:32:06 +0000 (10:32 +0000)]
[ASan] Remove the declarations of pthread_workqueue_t and pthread_workitem_handle_t, which are used no more.
Kudos to Jeremy Huddleston Sequoia <jeremyhu@apple.com>

llvm-svn: 173143

11 years agoASan: use Clang -fsanitize-blacklist flag in unit tests (instead of -mllvm)
Alexey Samsonov [Tue, 22 Jan 2013 10:30:17 +0000 (10:30 +0000)]
ASan: use Clang -fsanitize-blacklist flag in unit tests (instead of -mllvm)

llvm-svn: 173142

11 years agoFix missed out llvm-stress after APFloat change.
Tim Northover [Tue, 22 Jan 2013 10:18:26 +0000 (10:18 +0000)]
Fix missed out llvm-stress after APFloat change.

llvm-svn: 173141

11 years ago[ASan] Fix the path to ASan interface in interface_symbols_linux.c
Alexander Potapenko [Tue, 22 Jan 2013 10:13:37 +0000 (10:13 +0000)]
[ASan] Fix the path to ASan interface in interface_symbols_linux.c

llvm-svn: 173140

11 years agoSwitch to APFloat constructor taking fltSemantics.
Tim Northover [Tue, 22 Jan 2013 09:46:51 +0000 (09:46 +0000)]
Switch to APFloat constructor taking fltSemantics.

This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.

llvm-svn: 173139