Commit Graph

157512 Commits

Author SHA1 Message Date
Eli Friedman 1891f69323 Remove unused functions.
llvm-svn: 190442
2013-09-10 22:42:31 +00:00
Reid Kleckner f978886ea4 Ignore noreturn when checking function template specializations
As requested when applying the same logic to calling conventions.

Reviewers: rsmith

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

llvm-svn: 190441
2013-09-10 22:21:37 +00:00
Eric Christopher 13b99d2aba Hoist section call out of loop.
llvm-svn: 190440
2013-09-10 21:49:37 +00:00
Richard Smith 84c6b3d293 PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.

llvm-svn: 190439
2013-09-10 21:34:14 +00:00
Rui Ueyama 754a3ead62 Try to unbreak mingw32 buildbot.
llvm-svn: 190438
2013-09-10 21:32:42 +00:00
Eli Friedman a5dfebdcfd Fix regression from r190382.
Make sure we perform the correct "referenced-but-not-used" check for
static member constants.

Fixes bug reported on cfe-commits by Alexey Samsonov.

llvm-svn: 190437
2013-09-10 21:10:25 +00:00
Enrico Granata 1ea6f1e7f9 <rdar://problem/14071463>
The wrong method was being called in some instances here, causing class lookups to fail

llvm-svn: 190436
2013-09-10 21:04:54 +00:00
Hans Wennborg 4e6bec7e26 Fix cl-link.c test failure on Mac platforms
The test filename (%s) is easily confused with an option when
it starts with /Users...

llvm-svn: 190435
2013-09-10 20:53:34 +00:00
Reid Kleckner 1ece9fc806 [ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does
Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ.

Reviewers: timurrrr

CC: cfe-commits

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

llvm-svn: 190434
2013-09-10 20:43:12 +00:00
Hans Wennborg 24ffd63626 Remove Windows line-endings in two clang-cl test files.
llvm-svn: 190432
2013-09-10 20:35:58 +00:00
Rui Ueyama 5c532370d5 Use llvm::sys::Process::GetEnv() instead of ::getenv().
Process::GetEnv() uses GetEnvironmentVariableW, which is a Windows API
to get an environment variable and is preferable over getenv().

llvm-svn: 190431
2013-09-10 20:33:21 +00:00
Matt Arsenault 77d55f8abd Fix build after SCEV change
llvm-svn: 190429
2013-09-10 20:22:17 +00:00
Hans Wennborg f1a7425bd9 clang-cl: Support building DLLs (PR17083)
This adds driver support for building DLLs (the /LD and /LDd flags).
It basically does two things: runtime selection and passing -dll and
-implib to the linker.

llvm-svn: 190428
2013-09-10 20:18:04 +00:00
Reid Kleckner d8110b6558 [ms-cxxabi] Implement guard variables for static initialization
Static locals requiring initialization are not thread safe on Windows.
Unfortunately, it's possible to create static locals that are actually
externally visible with inline functions and templates.  As a result, we
have to implement an initialization guard scheme that is compatible with
TUs built by MSVC, which makes thread safety prohibitively difficult.

MSVC's scheme is that every function that requires a guard gets an i32
bitfield.  Each static local is assigned a bit that indicates if it has
been initialized, up to 32 bits, at which point a new bitfield is
created.  MSVC rejects inline functions with more than 32 static locals,
and the externally visible mangling (?_B) only allows for one guard
variable per function.

On Eli's recommendation, I used MangleNumberingContext to track which
bit each static corresponds to.

Implements PR16888.

Reviewers: rjmccall, eli.friedman

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

llvm-svn: 190427
2013-09-10 20:14:30 +00:00
Matt Arsenault 1cee407a9b Fix missing CHECK-LABELs
llvm-svn: 190426
2013-09-10 19:57:05 +00:00
Matt Arsenault a90a18e0ea Teach ScalarEvolution about pointer address spaces
llvm-svn: 190425
2013-09-10 19:55:24 +00:00
Matt Arsenault 305a22555a Fix typo
llvm-svn: 190424
2013-09-10 19:54:54 +00:00
Rui Ueyama 471d0c57e7 Add getenv() wrapper that works on multibyte environment variable.
On Windows, character encoding of multibyte environment variable varies
depending on settings. The only reliable way to handle it I think is to use
GetEnvironmentVariableW().

GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16
string. That's not ideal because we use UTF-8 as the internal encoding in LLVM.
This patch defines a wrapper function which takes and returns UTF-8 string for
GetEnvironmentVariableW().

The wrapper function does not do any conversion and just forwards the argument
to getenv() on Unix.

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

llvm-svn: 190423
2013-09-10 19:45:51 +00:00
Benjamin Kramer 934f6f39f4 LoopVectorize: PHI nodes are always at the beginning of a block, no need to scan the whole block.
llvm-svn: 190422
2013-09-10 18:46:15 +00:00
Manman Ren 2312ed35d2 Debug Info: create scope children DIEs when the scope DIE is not null.
We try to create the scope children DIEs after we create the scope DIE. But
to avoid emitting empty lexical block DIE, we first check whether a scope
DIE is going to be null, then create the scope children if it is not null.
From the number of children, we decide whether to actually create the scope DIE.

This patch also removes an early exit which checks for a special condition.
It also removes deletion of un-used children DIEs that are generated
because we used to generate children DIEs before the scope DIE.

Deletion of un-used children DIEs may cause problem because we sometimes keep
created DIEs in a member variable of a CU.

llvm-svn: 190421
2013-09-10 18:40:41 +00:00
Fariborz Jahanian c02bfb9a85 ObjectiveC migrator: rename inferred isXXX property,
with a suitable 'getter' attribute.

llvm-svn: 190420
2013-09-10 18:39:32 +00:00
Hans Wennborg bac9d13647 cmake: Install llvm-tblgen again
It was removed in r189130, but it turns out this makes life hard for
folks packaging LLVM and Clang and building the latter based on the
LLVM package.

Note that this only adds back the LLVM tblgen, and it's obviously
not included when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

llvm-svn: 190419
2013-09-10 18:35:14 +00:00
Manman Ren 34b3dcc3b5 Debug Info: define a DIRef template.
Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure
the Value is indeed a scope ref and a type ref.

Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef
for getContainingType and getClassType.

DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for
readability and type safety.

llvm-svn: 190418
2013-09-10 18:30:07 +00:00
Jim Grosbach 19ae779af1 ARM: Use the PICADD opcode calculated.
We were figuring out whether to use tPICADD or PICADD, then just using
tPICADD unconditionally anyway. Oops.

A testcase from someone familiar enough with ELF to produce one would
be appreciated. The existing PIC testcase correctly verifies the .s
generated, but that doesn't catch this bug, which only showed up in
direct-to-object mode.

http://llvm.org/bugs/show_bug.cgi?id=17180

llvm-svn: 190417
2013-09-10 17:21:39 +00:00
Ed Maste 0afb78a83e test: Add @expectedFailureFreeBSD decorators
llvm.org/pr17184 expression interpreter fails for crash/assert tests

llvm-svn: 190416
2013-09-10 17:15:05 +00:00
Ed Maste fcd4caac8c test: Add @expectedFailureFreeBSD decorators
http://llvm.org/pr17183 expression w/ varargs printf() fails
http://llvm.org/pr15302 'anonymous namespace' prefix missing

llvm-svn: 190415
2013-09-10 16:25:05 +00:00
Alexey Samsonov d397a9ba1d Fixup for r190410: use lazy initialization for symbolizer as some compilers emit global constructor to setup vptr
llvm-svn: 190414
2013-09-10 16:16:27 +00:00
Hans Wennborg 9f6581bb88 Allow _clang-format as alternative to .clang-format config filename
Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.

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

llvm-svn: 190413
2013-09-10 15:41:12 +00:00
Logan Chien d532cb6bed Remove unused private member in ARMAsmPrinter.cpp.
This commit removes the unused "AttributeItem" from
ObjectAttributeEmitter.

llvm-svn: 190412
2013-09-10 15:10:02 +00:00
Timur Iskhodzhanov 92702d8401 [ASan] Remove the explicit function prototypes for intercepted functions on Windows
llvm-svn: 190411
2013-09-10 14:42:15 +00:00
Alexey Samsonov 7a36e6126b [Sanitizer] Refactor symbolization interface: use class instead of several functions. Move some code around to get rid of extra source files
llvm-svn: 190410
2013-09-10 14:36:16 +00:00
Renato Golin 74c652eb3f Adding LZMA as dep for XML2 on 2.8.0 or higher
LibXML2 config doesn't specify lzma as a dependency, which breaks
cross-compilation builds using new linkers (ld 2.21 or higher).

There is a bug on libxml2 to fix that, but since it's going to take
a while for things to go round and back, so we should have a harmless
addition of the library until then.

llvm-svn: 190409
2013-09-10 14:24:17 +00:00
Alexander Kornienko d8d47fa504 Don't divide L and #x in macro definitions. Fixes http://llvm.org/PR17144
Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 190408
2013-09-10 13:41:43 +00:00
Kostya Serebryany 6805de5467 [asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. llvm part
llvm-svn: 190407
2013-09-10 13:16:56 +00:00
Kostya Serebryany 8fc35ca008 [asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. compiler-rt part
llvm-svn: 190406
2013-09-10 13:16:26 +00:00
Alexander Kornienko 917f9e04b5 Correctly calculate OriginalColumn after multi-line tokens.
Summary: This also unifies the handling of escaped newlines for all tokens.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 190405
2013-09-10 12:29:48 +00:00
Richard Sandiford 0e0498b288 [SystemZ] Update README.
llvm-svn: 190404
2013-09-10 12:22:45 +00:00
Evgeniy Stepanov 2b31d7186e [msan] Make all pointers in msan_interface "const volatile void *".
This way msan annotations can be used with both normal and volatile memory.

llvm-svn: 190403
2013-09-10 11:54:51 +00:00
Evgeniy Stepanov df96e863de [msan] bool -> int to make msan_interface.h C-compatible.
llvm-svn: 190402
2013-09-10 11:04:37 +00:00
Daniel Jasper 71665cd1fd clang-format: Understand function type typedefs with typeof.
Before:
  typedef typeof(int(int, int)) * MyFunc;
After:
  typedef typeof(int(int, int)) *MyFunc;

This fixes llvm.org/PR17178.

llvm-svn: 190401
2013-09-10 10:26:38 +00:00
Richard Sandiford a9eb9972e4 [SystemZ] Add TM and TMY
The main complication here is that TM and TMY (the memory forms) set
CC differently from the register forms.  When the tested bits contain
some 0s and some 1s, the register forms set CC to 1 or 2 based on the
value the uppermost bit.  The memory forms instead set CC to 1
regardless of the uppermost bit.

Until now, I've tried to make it so that a branch never tests for an
impossible CC value.  E.g. NR only sets CC to 0 or 1, so branches on the
result will only test for 0 or 1.  Originally I'd tried to do the same
thing for TM and TMY by using custom matching code in ISelDAGToDAG.
That ended up being very ugly though, and would have meant duplicating
some of the chain checks that the common isel code does.

I've therefore gone for the simpler alternative of adding an extra
operand to the TM DAG opcode to say whether a memory form would be OK.
This means that the inverse of a "TM;JE" is "TM;JNE" rather than the
more precise "TM;JNLE", just like the inverse of "TMLL;JE" is "TMLL;JNE".
I suppose that's arguably less confusing though...

llvm-svn: 190400
2013-09-10 10:20:32 +00:00
Daniel Sanders 3615c45d76 [mips][msa] Removed unsupported dot product instructions (dotp_[su].b).
The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190399
2013-09-10 10:10:39 +00:00
Daniel Sanders f561730af8 [mips][msa] Removed unsupported dot product instructions (dotp_[su].b)
The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190398
2013-09-10 09:51:43 +00:00
Vladimir Medic 65cd57445e Add test cases for Mips mthc1/mfhc1 instructions. Add check for odd value of register when PFU is 32 bit.
llvm-svn: 190397
2013-09-10 09:50:01 +00:00
Vladimir Medic 8826970632 Remove obsolete code from MipsAsmParser.cpp.
llvm-svn: 190396
2013-09-10 09:39:55 +00:00
Alexander Kornienko 39856b71a6 Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.
Summary:
This fixes various issues with mixed tabs and spaces handling, e.g.
when realigning block comments.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 190395
2013-09-10 09:38:25 +00:00
Alexey Samsonov 3767ccf318 Delete unused static class members
llvm-svn: 190394
2013-09-10 09:26:48 +00:00
Stepan Dyatkovskiy c250d23c06 Rejected 190391, due to failures on clang-x86_64-darwin11-nobootstrap-RAincremental.
llvm-svn: 190393
2013-09-10 08:37:22 +00:00
Timur Iskhodzhanov 190784b21b [ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID
Also make DescribeThread easier to use.
This was firing on Dr.ASan runs, not sure how to repro InvalidTID in a simple test.

llvm-svn: 190392
2013-09-10 08:36:21 +00:00
Stepan Dyatkovskiy f16ade7604 Fix for PR16752. Second commit.
PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.

Fixes:
1st Commit (Done): Add new methods for TargetInfo:
     getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.

llvm-svn: 190391
2013-09-10 08:18:44 +00:00