platform/upstream/llvm.git
11 years agoR600/SI: rework input interpolation v2
Christian Konig [Thu, 7 Mar 2013 09:04:14 +0000 (09:04 +0000)]
R600/SI: rework input interpolation v2

v2: update CMakeLists.txt as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176626

11 years agoR600/SI: remove SI_vs_load_buffer_index
Christian Konig [Thu, 7 Mar 2013 09:04:04 +0000 (09:04 +0000)]
R600/SI: remove SI_vs_load_buffer_index

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176625

11 years agoR600/SI: remove SGPR address space v2
Christian Konig [Thu, 7 Mar 2013 09:03:59 +0000 (09:03 +0000)]
R600/SI: remove SGPR address space v2

v2: fix R600 regressions

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176624

11 years agoR600/SI: add proper formal parameter handling for SI
Christian Konig [Thu, 7 Mar 2013 09:03:52 +0000 (09:03 +0000)]
R600/SI: add proper formal parameter handling for SI

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176623

11 years agoR600/SI: remove shader type intrinsic
Christian Konig [Thu, 7 Mar 2013 09:03:46 +0000 (09:03 +0000)]
R600/SI: remove shader type intrinsic

Just encode the type as target specific attribute.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176622

11 years agoR600/SI: switch types of SGPRs to v*i8
Christian Konig [Thu, 7 Mar 2013 09:03:38 +0000 (09:03 +0000)]
R600/SI: switch types of SGPRs to v*i8

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176621

11 years agoR600/SI: fix unused variable warning
Christian Konig [Thu, 7 Mar 2013 09:03:30 +0000 (09:03 +0000)]
R600/SI: fix unused variable warning

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176620

11 years agoFix build with clang, this was supposed to be part of r176617.
Nick Lewycky [Thu, 7 Mar 2013 08:42:27 +0000 (08:42 +0000)]
Fix build with clang, this was supposed to be part of r176617.

llvm-svn: 176619

11 years agoTake the GCDA version string as an input to llvm_gcda_start_file.
Nick Lewycky [Thu, 7 Mar 2013 08:28:54 +0000 (08:28 +0000)]
Take the GCDA version string as an input to llvm_gcda_start_file.

llvm-svn: 176618

11 years agoAdd flags for additional control over coverage generation. Pick the version
Nick Lewycky [Thu, 7 Mar 2013 08:28:53 +0000 (08:28 +0000)]
Add flags for additional control over coverage generation. Pick the version
string to be emitted, and two properties about the files themselves.

Use $PWD to absolut-ify the path to the coverage file. Yes, this is what GCC
does. Reverts my own r175706.

llvm-svn: 176617

11 years agoSwitch from a version 4.2/4.4 switch to a four-byte version string to be put
Nick Lewycky [Thu, 7 Mar 2013 08:28:49 +0000 (08:28 +0000)]
Switch from a version 4.2/4.4 switch to a four-byte version string to be put
into the actual gcov file.

Instead of using the bottom 4 bytes as the function identifier, use a counter.
This makes the identifier numbers stable across multiple runs.

llvm-svn: 176616

11 years agoNo need to go through int64 and APInt when generating a new constant.
Nadav Rotem [Thu, 7 Mar 2013 06:34:49 +0000 (06:34 +0000)]
No need to go through int64 and APInt when generating a new constant.

llvm-svn: 176615

11 years agoSDAG: Handle scalarizing an extend of a <1 x iN> vector.
Jim Grosbach [Thu, 7 Mar 2013 05:47:54 +0000 (05:47 +0000)]
SDAG: Handle scalarizing an extend of a <1 x iN> vector.

Just scalarize the element and rebuild a vector of the result type
from that.

rdar://13281568

llvm-svn: 176614

11 years agoAdded new properties to lldb.SBModule classes:
Greg Clayton [Thu, 7 Mar 2013 03:25:11 +0000 (03:25 +0000)]
Added new properties to lldb.SBModule classes:

"compile_units" returns an array of all compile units in a module as a list() of lldb.SBCompileUnit objects.

"compile_unit" returns a compile unit accessor object that allows indexed access, search by full or partial path, or by regex:

(lldb) script
comp_unit = lldb.target.module['TextEdit'].compile_unit['Document.m']
comp_unit = lldb.target.module['TextEdit'].compile_unit['/path/to/Document.m']
comp_unit = lldb.target.module['TextEdit'].compile_unit[0]
comp_unit = lldb.target.module['TextEdit'].compile_unit[1]
for comp_unit in lldb.target.module['TextEdit'].compile_unit[re.compile("\.m$")]
  print comp_unit

This helps do quick searches and scripting while debugging.

llvm-svn: 176613

11 years ago[analyzer] Warn on passing a reference to null pointer as an argument in a call
Anna Zaks [Thu, 7 Mar 2013 03:02:36 +0000 (03:02 +0000)]
[analyzer] Warn on passing a reference to null pointer as an argument in a call

Warn about null pointer dereference earlier when a reference to a null pointer is
passed in a call. The idea is that even though the standard might allow this, reporting
the issue earlier is better for diagnostics (the error is reported closer to the place where
the pointer was set to NULL). This also simplifies analyzer’s diagnostic logic, which has
to track “where the null came from”. As a consequence, some of our null pointer
warning suppression mechanisms started triggering more often.

TODO: Change the name of the file and class to reflect the new check.
llvm-svn: 176612

11 years agoStop the "module" property from throwing an exception when the module name was not...
Greg Clayton [Thu, 7 Mar 2013 02:58:47 +0000 (02:58 +0000)]
Stop the "module" property from throwing an exception when the module name was not found in the target module list.

llvm-svn: 176611

11 years agoAdded a new module that can dump all line tables for all compile units in any modules...
Greg Clayton [Thu, 7 Mar 2013 02:57:54 +0000 (02:57 +0000)]
Added a new module that can dump all line tables for all compile units in any modules that are specified as arguments to the "dump_module_line_tables" command.

I used this to verify that the debug map line tables were the same as previous LLDB releases prior to my change in the DWARF in .o file linking.

llvm-svn: 176610

11 years agoDon't duplicate function names. Thanks to Jordan Rose for pointing it out.
Rafael Espindola [Thu, 7 Mar 2013 02:43:24 +0000 (02:43 +0000)]
Don't duplicate function names. Thanks to Jordan Rose for pointing it out.

llvm-svn: 176609

11 years agoRemove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and
Nick Lewycky [Thu, 7 Mar 2013 02:03:08 +0000 (02:03 +0000)]
Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and
is the one that should be used.

llvm-svn: 176608

11 years agoAdd a hasExternalLinkage helper. No functionality change.
Rafael Espindola [Thu, 7 Mar 2013 02:00:27 +0000 (02:00 +0000)]
Add a hasExternalLinkage helper. No functionality change.

llvm-svn: 176607

11 years agoAdd a hasExternalStorageAsWritten helper. No functionality change.
Rafael Espindola [Thu, 7 Mar 2013 01:42:44 +0000 (01:42 +0000)]
Add a hasExternalStorageAsWritten helper. No functionality change.

It is possible that some of the current uses of
"getStorageClassAsWritten() == SC_Extern" should use this but I don't know
enough about SC_PrivateExtern to change and test them.

llvm-svn: 176606

11 years agoDebug Info: store the files and directories for each compile unit.
Manman Ren [Thu, 7 Mar 2013 01:42:00 +0000 (01:42 +0000)]
Debug Info: store the files and directories for each compile unit.

We now emit a line table for each compile unit. To reduce the prologue size
of each line table, the files and directories used by each compile unit are
stored in std::map<unsigned, std::vector< > > instead of std::vector< >.

The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each
compile unit causes a huge increase of debug info. With this patch, each
prologue will only emit the files required by the compile unit.

rdar://problem/13342023

llvm-svn: 176605

11 years agoArrayRef has a OneElt constructor. Beautify the code.
Nadav Rotem [Thu, 7 Mar 2013 01:38:04 +0000 (01:38 +0000)]
ArrayRef has a OneElt constructor. Beautify the code.

llvm-svn: 176604

11 years agoFix typo.
Rafael Espindola [Thu, 7 Mar 2013 01:34:57 +0000 (01:34 +0000)]
Fix typo.

llvm-svn: 176603

11 years agoSwitch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.
Nadav Rotem [Thu, 7 Mar 2013 01:30:40 +0000 (01:30 +0000)]
Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.

llvm-svn: 176602

11 years ago[analyzer] Check for returning null references in ReturnUndefChecker.
Jordan Rose [Thu, 7 Mar 2013 01:23:25 +0000 (01:23 +0000)]
[analyzer] Check for returning null references in ReturnUndefChecker.

Officially in the C++ standard, a null reference cannot exist. However,
it's still very easy to create one:

int &getNullRef() {
  int *p = 0;
  return *p;
}

We already check that binds to reference regions don't create null references.
This patch checks that we don't create null references by returning, either.

<rdar://problem/13364378>

llvm-svn: 176601

11 years ago[analyzer] Clean up a few doc comments for ProgramState and CallEvent.
Jordan Rose [Thu, 7 Mar 2013 01:23:14 +0000 (01:23 +0000)]
[analyzer] Clean up a few doc comments for ProgramState and CallEvent.

No functionality change.

llvm-svn: 176600

11 years agoSimplifyCFG fix for volatile load/store.
Andrew Trick [Thu, 7 Mar 2013 01:03:35 +0000 (01:03 +0000)]
SimplifyCFG fix for volatile load/store.

Fixes rdar:13349374.

Volatile loads and stores need to be preserved even if the language
standard says they are undefined. "volatile" in this context means "get
out of the way compiler, let my platform handle it".

Additionally, this is the only way I know of with llvm to write to the
first page (when hardware allows) without dropping to assembly.

llvm-svn: 176599

11 years agoFix two remaining issue after fixing PR15355 when CMOV is not available
Michael Liao [Thu, 7 Mar 2013 01:01:29 +0000 (01:01 +0000)]
Fix two remaining issue after fixing PR15355 when CMOV is not available

- Phi nodes should be replaced/updated after lowering CMOV into branch
  because 'mainMBB' updating operand in Phi node is changed.
- Add EFLAGS in livein before lowering the 2nd CMOV. It's necessary as
  we will reuse the EFLAGS generated before the 1st lowered CMOV, which
  won't clobber EFLAGS. However, we need explicitly specify that.
- '-attr=-cmov' test case are added.

llvm-svn: 176598

11 years agoClean up LLDB CMake build output
Daniel Malea [Thu, 7 Mar 2013 00:52:25 +0000 (00:52 +0000)]
Clean up LLDB CMake build output
- remove "-debug" flag from swig scripts
- use "echo -n" instead of "echo" in dummy target to avoid printing a useless newline

llvm-svn: 176597

11 years agoFix running of LLDB tests with cmake+ninja+ccache
Daniel Malea [Thu, 7 Mar 2013 00:50:54 +0000 (00:50 +0000)]
Fix running of LLDB tests with cmake+ninja+ccache
- Avoid passing 'ccache' as the test compiler. Instead, use first arg after ccache.

llvm-svn: 176596

11 years agoFix Linux i386 build
Daniel Malea [Thu, 7 Mar 2013 00:48:53 +0000 (00:48 +0000)]
Fix Linux i386 build
- missing definitions were causing different definitions of type 'off_t', resulting in linker errors
- fix is to define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64

llvm-svn: 176595

11 years ago<rdar://problem/13119170>
Han Ming Ong [Wed, 6 Mar 2013 23:59:34 +0000 (23:59 +0000)]
<rdar://problem/13119170>

Reap the child process (debugserver) when it is done.

llvm-svn: 176594

11 years agoNo functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags...
Howard Hinnant [Wed, 6 Mar 2013 23:30:19 +0000 (23:30 +0000)]
No functionality change at this time.  I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS.  This is in preparation for taking advantage of clang's new __type_visibility__ attribute.

llvm-svn: 176593

11 years ago<rdar://problem/13362109>
Greg Clayton [Wed, 6 Mar 2013 23:23:27 +0000 (23:23 +0000)]
<rdar://problem/13362109>

LLDB was not parsing line tables correctly for DWARF in .o files after recent debug map changes. This has now been fixed.

llvm-svn: 176592

11 years agoRemove some tabs and extraneous space chars from ObjectFileMachO.cpp.
Jason Molenda [Wed, 6 Mar 2013 23:19:17 +0000 (23:19 +0000)]
Remove some tabs and extraneous space chars from ObjectFileMachO.cpp.
Noticed these while working on the last commit.

llvm-svn: 176590

11 years agoRetrieve the dyld shared cache mapping offset from the shared cache instead of hardco...
Jason Molenda [Wed, 6 Mar 2013 23:17:36 +0000 (23:17 +0000)]
Retrieve the dyld shared cache mapping offset from the shared cache instead of hardcoding the value.
Read the version number of the dyld shared cache.
<rdar://problem/13311882>

llvm-svn: 176589

11 years agoEnsure that DIType is regenerated after we visit an implementation
Adrian Prantl [Wed, 6 Mar 2013 22:03:30 +0000 (22:03 +0000)]
Ensure that DIType is regenerated after we visit an implementation
that adds ivars to an interface.

Fixes rdar://13175234

This is an update to r176116 that performs a smart caching of interfaces.

llvm-svn: 176584

11 years ago[ELF] Order weak symbols properly
Shankar Easwaran [Wed, 6 Mar 2013 21:59:27 +0000 (21:59 +0000)]
[ELF] Order weak symbols properly

llvm-svn: 176583

11 years agoSkipping TestConstVariables on Linux.
Andrew Kaylor [Wed, 6 Mar 2013 21:37:41 +0000 (21:37 +0000)]
Skipping TestConstVariables on Linux.

The test was marked as expectedFailureLinux, but now it passes with gcc and some versions of clang.  Newer versions of clang introduce a failure due to bad DWARF information.

llvm-svn: 176581

11 years ago[mips] Custom-legalize BR_JT.
Akira Hatanaka [Wed, 6 Mar 2013 21:32:03 +0000 (21:32 +0000)]
[mips] Custom-legalize BR_JT.

In N64-static, GOT address is needed to compute the branch address.

llvm-svn: 176580

11 years agoAdded tests to test for "settings set" with trailing whitespaces after the values.
Greg Clayton [Wed, 6 Mar 2013 21:17:06 +0000 (21:17 +0000)]
Added tests to test for "settings set" with trailing whitespaces after the values.

llvm-svn: 176579

11 years agoAdding support for DW_OP_stack_value in DWARFExpression::Evaluate
Andrew Kaylor [Wed, 6 Mar 2013 21:13:09 +0000 (21:13 +0000)]
Adding support for DW_OP_stack_value in DWARFExpression::Evaluate

llvm-svn: 176578

11 years ago[analyzer] Pass the correct Expr to the bug reporter visitors when dealing with Compo...
Anna Zaks [Wed, 6 Mar 2013 20:26:02 +0000 (20:26 +0000)]
[analyzer] Pass the correct Expr to the bug reporter visitors when dealing with CompoundLiteralExpr

This allows us to trigger the IDC visitor in the added test case.

llvm-svn: 176577

11 years ago[analyzer] IDC: Add config option; perform the idc check on first “null node” rather...
Anna Zaks [Wed, 6 Mar 2013 20:25:59 +0000 (20:25 +0000)]
[analyzer] IDC: Add config option; perform the idc check on first “null node” rather than last “non-null”.

The second modification does not lead to any visible result, but, theoretically, is what we should
have been looking at to begin with since we are checking if the node was assumed to be null in
an inlined function.

llvm-svn: 176576

11 years agoAdded a little bit of logging to ClangFunction to
Sean Callanan [Wed, 6 Mar 2013 19:57:25 +0000 (19:57 +0000)]
Added a little bit of logging to ClangFunction to
make it more obvious what's going on.

llvm-svn: 176575

11 years agoAdd support for non-register scalar values in DoMaterializeOneVariable.
Andrew Kaylor [Wed, 6 Mar 2013 19:35:33 +0000 (19:35 +0000)]
Add support for non-register scalar values in DoMaterializeOneVariable.

llvm-svn: 176574

11 years agoHave basic_istream::read call sgetn intead of sbumpc individual characters. This...
Howard Hinnant [Wed, 6 Mar 2013 19:27:56 +0000 (19:27 +0000)]
Have basic_istream::read call sgetn intead of sbumpc individual characters.  This addresses llvm.org/bugs/show_bug.cgi?id=15427.

llvm-svn: 176573

11 years agoGeneralize my previous fix for -print-options.
Andrew Trick [Wed, 6 Mar 2013 19:04:56 +0000 (19:04 +0000)]
Generalize my previous fix for -print-options.

Always print options that differ from their implicit default. At least
for simple option types.

llvm-svn: 176572

11 years agoRemove tailing whitespaces
Michael Liao [Wed, 6 Mar 2013 18:24:34 +0000 (18:24 +0000)]
Remove tailing whitespaces

llvm-svn: 176570

11 years agoGive -loop-vectorize an explicit default.
Andrew Trick [Wed, 6 Mar 2013 18:22:22 +0000 (18:22 +0000)]
Give -loop-vectorize an explicit default.

This way, clang -mllvm -print-options shows that the driver is overriding it.

llvm-svn: 176569

11 years agoCorrect silly type-o. Thanks Richard.
Howard Hinnant [Wed, 6 Mar 2013 18:16:12 +0000 (18:16 +0000)]
Correct silly type-o.  Thanks Richard.

llvm-svn: 176568

11 years ago[PCH] When pre-validating the headers from the PCH, only validate non-system headers.
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:50 +0000 (18:12 +0000)]
[PCH] When pre-validating the headers from the PCH, only validate non-system headers.

Stat'ing all the headers from the PCH to make sure they are up-to-date takes significant time.
In a particular source file (whose PCH file included Cocoa.h) from total -fsyntax-only time
12% was just stat calls. Change pre-validation to only check non-system headers.

There are some notable disadvantages:

-If a system header, that is not include-guarded, changes after the PCH was created, we will not
find it in the header info table and we will #import it, effectively #importing it twice, thus
we will emit some error due to a multiple definition and after that the "header was modified" error will likely
be emitted, for example something like:

NSDictionary.h:12:1: error: duplicate interface definition for class 'NSDictionary'
@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
NSDictionary.h:12:12: note: previous definition is here
@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
           ^
fatal error: file 'NSDictionary.h' has been modified since the precompiled header was built

Though we get the "header was modified" error, this is a bit confusing.

-Theoretically it is possible that such a system header will cause no errors but it will just cause an
unfortunate semantic change, though I find this rather unlikely.

The advantages:

-Reduces compilation time when using a huge PCH like the Cocoa ones
-System headers change very infrequent and when they do, users/build systems should be able to know that
re-building from scratch is needed.

Addresses rdar://13056262

llvm-svn: 176567

11 years ago[PCH] For HeaderFileInfoTrait, hash the key using size & time of the file.
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:47 +0000 (18:12 +0000)]
[PCH] For HeaderFileInfoTrait, hash the key using size & time of the file.

Previously the hash would be the filename portion of the path, which could be
different for a filename with different case or a symbolic link with a different
name completely.
This did not actually create any issue so far because by validating all headers
in the PCH we created uniqued FileEntries based on inodes, so an #include of
a symbolic link (refering to a file from the PCH) would end up with a FileEntry
with filename same as the one recorded in the PCH.

llvm-svn: 176566

11 years ago[PCH] We don't need to instantiate HeaderFileInfoTrait in ASTReader more than once.
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:44 +0000 (18:12 +0000)]
[PCH] We don't need to instantiate HeaderFileInfoTrait in ASTReader more than once.

We can just re-use the one from HeaderFileInfoLookupTable.

llvm-svn: 176565

11 years ago[PCH] Remove a couple of fields from serialization::reader::HeaderFileInfoTrait that...
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:41 +0000 (18:12 +0000)]
[PCH] Remove a couple of fields from serialization::reader::HeaderFileInfoTrait that are not used for anything.

llvm-svn: 176564

11 years agoSpell Objective-C correctly.
Fariborz Jahanian [Wed, 6 Mar 2013 17:55:30 +0000 (17:55 +0000)]
Spell Objective-C correctly.

llvm-svn: 176563

11 years agoMemory Dependence Analysis (not mem-dep test) take advantage of "invariant.load"...
Shuxin Yang [Wed, 6 Mar 2013 17:48:48 +0000 (17:48 +0000)]
Memory Dependence Analysis (not mem-dep test) take advantage of "invariant.load" metadata.

The "invariant.load" metadata indicates the memory unit being accessed is immutable.
A load annotated with this metadata can be moved across any store.

As I am not sure if it is legal to move such loads across barrier/fence, this
change dose not allow such transformation.

rdar://11311484

Thank Arnold for code review.

llvm-svn: 176562

11 years agosay objective-C in the warning and streamline
Fariborz Jahanian [Wed, 6 Mar 2013 17:36:51 +0000 (17:36 +0000)]
say objective-C in the warning and streamline
several diagnostics into one. // rdar://13094352

llvm-svn: 176560

11 years agoThe bitset(unsigned long long) constructor was broken by the constexpr additions...
Howard Hinnant [Wed, 6 Mar 2013 17:30:26 +0000 (17:30 +0000)]
The bitset(unsigned long long) constructor was broken by the constexpr additions only on 32 bit platforms.  Fixed.  This addresses llvm.org/bugs/show_bug.cgi?id=15444.

llvm-svn: 176559

11 years agoImprove/Cleanup ptrace wrapper and remove dependency on user.h
Matt Kopec [Wed, 6 Mar 2013 17:20:48 +0000 (17:20 +0000)]
Improve/Cleanup ptrace wrapper and remove dependency on user.h

Patch by Ashok Thirumurthi.

llvm-svn: 176558

11 years agoDriver: add support for new style multiarch in Ubuntu 13.04
Dmitri Gribenko [Wed, 6 Mar 2013 17:14:05 +0000 (17:14 +0000)]
Driver: add support for new style multiarch in Ubuntu 13.04

Patch by Sanne Wouda.

llvm-svn: 176557

11 years agoNew ASTMatchers and enhancement to hasOverloadedOperatorName
Edwin Vane [Wed, 6 Mar 2013 17:02:57 +0000 (17:02 +0000)]
New ASTMatchers and enhancement to hasOverloadedOperatorName

Added two new narrowing matchers:
* hasMethod: aplies a matcher to a CXXRecordDecl's methods until a match is made
  or there are no more methods.
* hasCanonicalType: applies a matcher to a QualType's canonicalType.

Enhanced hasOverloadedOperatorName to work on CXXMethodDecl as well as
CXXOperatorCallExpr.

Updated tests and docs.

Reviewers: klimek, gribozavr
llvm-svn: 176556

11 years ago[msan] Block reports from interceptors during _Unwind_Backtrace
Reid Kleckner [Wed, 6 Mar 2013 16:11:58 +0000 (16:11 +0000)]
[msan] Block reports from interceptors during _Unwind_Backtrace

Summary:
I'm hitting a big recursive report from:
  uninit on strlen ->
  __msan::PrintWarningWithOrigin() ->
  __msan::GetStackTrace() ->
  __sanitizer::StackTrace::SlowUnwindStack() ->
  _Unwind_Backtrace() ->
  ... libgcc calls ->
  uninit on strlen() ->
  ... repeats

Reviewers: eugenis

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

llvm-svn: 176555

11 years ago[msan] pthread_join() returns int, not void*
Reid Kleckner [Wed, 6 Mar 2013 15:41:35 +0000 (15:41 +0000)]
[msan] pthread_join() returns int, not void*

pthread_join() returns an error code, not the result of the
pthread_create() function like I thought.

llvm-svn: 176554

11 years agoTest case for PR-15414 - nullptr_t functions
Stefanus Du Toit [Wed, 6 Mar 2013 15:32:20 +0000 (15:32 +0000)]
Test case for PR-15414 - nullptr_t functions

The use-null-ptr transform will transform calls to functions that return a
nullptr_t. Even if the function were to only return a null pointer and do
nothing else, this replacement would still be undesired as the behavior and
signature of the function could change in the future.

This adds an XFAILed test case to demonstrate the issue.

Reviewed by: Edwin Vane, Tareq Siraj

llvm-svn: 176553

11 years ago[sanitizers] Fix check failure on dealloc from new thread
Reid Kleckner [Wed, 6 Mar 2013 14:54:08 +0000 (14:54 +0000)]
[sanitizers] Fix check failure on dealloc from new thread

Summary:
Adds a test for this case, which was reduced from a chromium build of
WebKit's DumpRenderTree.

Reviewers: eugenis

CC: glider
Differential Revision: http://llvm-reviews.chandlerc.com/D495

llvm-svn: 176552

11 years agoFixed Use-Nullptr when replacing return(0)
Edwin Vane [Wed, 6 Mar 2013 14:51:34 +0000 (14:51 +0000)]
Fixed Use-Nullptr when replacing return(0)

Before fix, the paren expression was being replaced resulting in returnnullptr.
ParenExpr and implicit casts now ignored so we get return(nullptr) instead.

Added new test cases.

Fixes PR15398

Author: Ariel Bernal <ariel.j.bernal@intel.com>
llvm-svn: 176551

11 years ago[Sanitize] Don't emit function attribute sanitize_address/thread/memory if the functi...
Alexey Samsonov [Wed, 6 Mar 2013 10:54:18 +0000 (10:54 +0000)]
[Sanitize] Don't emit function attribute sanitize_address/thread/memory if the function is blacklisted.

llvm-svn: 176550

11 years agoFixed enum printing for negative enums. There previously was no testing to validate...
Greg Clayton [Wed, 6 Mar 2013 06:23:54 +0000 (06:23 +0000)]
Fixed enum printing for negative enums. There previously was no testing to validate that enum values were being displayed correctly.

Also added C++11 enum test cases to cover enums as int8_t, int16_t int32_t, int64_t, uint8_t, uint16_t, uint32_t, and uint64_t both for DWARF and dSYM cases. The DWARF being emitted by clang is missing the enum integer type, but the code is now ready to accept and deal with the integral type if it is supplied.

llvm-svn: 176548

11 years agoInstCombine: Don't shrink allocas when combining with a bitcast.
Jim Grosbach [Wed, 6 Mar 2013 05:44:53 +0000 (05:44 +0000)]
InstCombine: Don't shrink allocas when combining with a bitcast.

When considering folding a bitcast of an alloca into the alloca itself,
make sure we don't shrink the amount of memory being allocated, or
things rapidly go sideways.

rdar://13324424

llvm-svn: 176547

11 years agoFixed test suite errors due to new clang -v output.
Greg Clayton [Wed, 6 Mar 2013 02:34:51 +0000 (02:34 +0000)]
Fixed test suite errors due to new clang -v output.

llvm-svn: 176546

11 years agoNow that "settings set" will strip leading and trailing spaces, we need a way to...
Greg Clayton [Wed, 6 Mar 2013 02:19:38 +0000 (02:19 +0000)]
Now that "settings set" will strip leading and trailing spaces, we need a way to be able to specify string values that contain spaces. So now settings setting <property> <value>" can have a <value> that is quoted:

settings set prompt "(lldb2) "

llvm-svn: 176545

11 years agorevert r176531 due to clan-native-arm fails
Weiming Zhao [Wed, 6 Mar 2013 02:08:54 +0000 (02:08 +0000)]
revert r176531 due to clan-native-arm fails

llvm-svn: 176544

11 years ago[mips] Add a line which checks function name. Rename file.
Akira Hatanaka [Wed, 6 Mar 2013 01:58:03 +0000 (01:58 +0000)]
[mips] Add a line which checks function name. Rename file.

llvm-svn: 176543

11 years agoPR15390: If a function returns a pointer to a function, that function type
Richard Smith [Wed, 6 Mar 2013 01:37:38 +0000 (01:37 +0000)]
PR15390: If a function returns a pointer to a function, that function type
can't have default arguments even though it's a parameter-declaration-clause in
a function declaration.

llvm-svn: 176542

11 years agoDisable JITed code in any processes that use DynamicLoaderStatic.
Greg Clayton [Wed, 6 Mar 2013 00:59:41 +0000 (00:59 +0000)]
Disable JITed code in any processes that use DynamicLoaderStatic.

llvm-svn: 176541

11 years agoAfter issuing a diagnostic for undefining or redefining a builtin macro,
Richard Smith [Wed, 6 Mar 2013 00:46:00 +0000 (00:46 +0000)]
After issuing a diagnostic for undefining or redefining a builtin macro,
continue parsing the directive rather than silently discarding it.

Allowing undef or redef of __TIME__ and __DATE__ is important to folks
who want stable, reproducible builds.

llvm-svn: 176540

11 years agoobjective-C: don't crash after diagnosing
Fariborz Jahanian [Wed, 6 Mar 2013 00:37:40 +0000 (00:37 +0000)]
objective-C: don't crash after diagnosing
using object subscripting without declaring objectForKeyedSubscript:
// rdar://13333205

llvm-svn: 176539

11 years agoFix PR15355
Michael Liao [Wed, 6 Mar 2013 00:17:04 +0000 (00:17 +0000)]
Fix PR15355

- Clear 'mayStore' flag when loading from the atomic variable before the
  spin loop
- Clear kill flag from one use to multiple use in registers forming the
  address to that atomic variable
- don't use a physical register as live-in register in BB (neither entry
  nor landing pad.) by copying it into virtual register

(patch by Cameron Zwarich)

llvm-svn: 176538

11 years agoUse dyn_cast instead of isa && cast. No functionality change.
Jakub Staszak [Wed, 6 Mar 2013 00:16:16 +0000 (00:16 +0000)]
Use dyn_cast instead of isa && cast. No functionality change.

llvm-svn: 176537

11 years agoRemove duplicated forward declaration.
Jakub Staszak [Wed, 6 Mar 2013 00:04:32 +0000 (00:04 +0000)]
Remove duplicated forward declaration.

llvm-svn: 176536

11 years agoRemove unused static variable.
Douglas Gregor [Tue, 5 Mar 2013 23:59:13 +0000 (23:59 +0000)]
Remove unused static variable.

llvm-svn: 176535

11 years agoPreprocessor: don't keep comments under -traditional-cpp.
Jordan Rose [Tue, 5 Mar 2013 23:54:55 +0000 (23:54 +0000)]
Preprocessor: don't keep comments under -traditional-cpp.

This patch is designed for minimal intrusion into normal preprocessing
and compilation; under -E -traditional-cpp, the lexer will still
generate tok::comment nodes since it is preserving all whitespace, but
the output printer will then throw it away.

<rdar://problem/13338680>

llvm-svn: 176534

11 years ago<rdar://problem/13341472>
Greg Clayton [Tue, 5 Mar 2013 23:54:39 +0000 (23:54 +0000)]
<rdar://problem/13341472>

LLDB wasn't printing the names for negative enums. Fixed the signed extraction of enumerators and how they were registered with clang's type system.

llvm-svn: 176533

11 years ago<rdar://problem/13184855>
Greg Clayton [Tue, 5 Mar 2013 23:52:49 +0000 (23:52 +0000)]
<rdar://problem/13184855>

Spaces in "settings set" value strings no longer cause setting failures.

llvm-svn: 176532

11 years agoPR 11326: Lack diagnosic message when ABI conflicts on ARM
Weiming Zhao [Tue, 5 Mar 2013 23:27:21 +0000 (23:27 +0000)]
PR 11326: Lack diagnosic message when ABI conflicts on ARM

When both Triple and -mabi are used, it may result into conflicting ABI value.

llvm-svn: 176531

11 years ago[mips] Remove android calling convention.
Akira Hatanaka [Tue, 5 Mar 2013 23:22:30 +0000 (23:22 +0000)]
[mips] Remove android calling convention.

This calling convention was added just to handle functions which return vector
of floats. The fix committed in r165585 solves the problem.

llvm-svn: 176530

11 years agofix a missing check in my last patch.
Fariborz Jahanian [Tue, 5 Mar 2013 23:20:29 +0000 (23:20 +0000)]
fix a missing check in my last patch.
// rdar://13094352

llvm-svn: 176529

11 years agoBe more precise in GCC/autoconf build instructions about compiler versions
Daniel Malea [Tue, 5 Mar 2013 22:58:53 +0000 (22:58 +0000)]
Be more precise in GCC/autoconf build instructions about compiler versions

llvm-svn: 176528

11 years ago[mips] Fix MipsCC::analyzeReturn so that, in soft-float mode, fp128 gets
Akira Hatanaka [Tue, 5 Mar 2013 22:54:59 +0000 (22:54 +0000)]
[mips] Fix MipsCC::analyzeReturn so that, in soft-float mode, fp128 gets
returned in registers $2 and $4.

llvm-svn: 176527

11 years agoPreprocessor: don't consider // to be a line comment in -E -std=c89 mode.
Jordan Rose [Tue, 5 Mar 2013 22:51:04 +0000 (22:51 +0000)]
Preprocessor: don't consider // to be a line comment in -E -std=c89 mode.

It's beneficial when compiling to treat // as the start of a line
comment even in -std=c89 mode, since it's not valid C code (with a few
rare exceptions) and is usually intended as such. We emit a pedantic
warning and then continue on as if line comments were enabled.
This has been our behavior for quite some time.

However, people use the preprocessor for things besides C source files.
In today's prompting example, the input contains (unquoted) URLs, which
contain // but should still be preserved.

This change instructs the lexer to treat // as a plain token if Clang is
in C90 mode and generating preprocessed output rather than actually compiling.

<rdar://problem/13338743>

llvm-svn: 176526

11 years agodoc. parsing. Improve on diagnostics on my last patch.
Fariborz Jahanian [Tue, 5 Mar 2013 22:46:07 +0000 (22:46 +0000)]
doc. parsing. Improve on diagnostics on my last patch.
// rdar://13094352.

llvm-svn: 176525

11 years agoTypos: be more precise on the build page when mentioning the non-cmake build system
Daniel Malea [Tue, 5 Mar 2013 22:43:08 +0000 (22:43 +0000)]
Typos: be more precise on the build page when mentioning the non-cmake build system

llvm-svn: 176524

11 years ago[mips] Fix MipsTargetLowering::LowerCallResult and LowerReturn to correctly
Akira Hatanaka [Tue, 5 Mar 2013 22:41:55 +0000 (22:41 +0000)]
[mips] Fix MipsTargetLowering::LowerCallResult and LowerReturn to correctly
handle fp128 returns.

llvm-svn: 176523

11 years agoAdd instructions for building LLDB with CMake
Daniel Malea [Tue, 5 Mar 2013 22:38:50 +0000 (22:38 +0000)]
Add instructions for building LLDB with CMake
- suported generators: Ninja and Unix Makefiles
- added instructions to run tests when building with autoconf

llvm-svn: 176522

11 years ago[mips] Fix MipsTargetLowering::LowerCall to pass fp128 arguments in floating
Akira Hatanaka [Tue, 5 Mar 2013 22:20:28 +0000 (22:20 +0000)]
[mips] Fix MipsTargetLowering::LowerCall to pass fp128 arguments in floating
point registers.

llvm-svn: 176521

11 years ago[mips] Correct handling of fp128 (long double) formals and read long double
Akira Hatanaka [Tue, 5 Mar 2013 22:13:04 +0000 (22:13 +0000)]
[mips] Correct handling of fp128 (long double) formals and read long double
parameters from floating point registers if target is mips64 hard float.

llvm-svn: 176520

11 years agoFix a few typos in comments.
Jakub Staszak [Tue, 5 Mar 2013 22:05:16 +0000 (22:05 +0000)]
Fix a few typos in comments.

llvm-svn: 176519

11 years agoAdd some constantness.
Jakub Staszak [Tue, 5 Mar 2013 22:01:15 +0000 (22:01 +0000)]
Add some constantness.

llvm-svn: 176518