platform/upstream/llvm.git
11 years ago[ASan] fix compilation on Mac by adding a missing pwrite parameter.
Alexander Potapenko [Thu, 24 Jan 2013 09:15:08 +0000 (09:15 +0000)]
[ASan] fix compilation on Mac by adding a missing pwrite parameter.

llvm-svn: 173333

11 years agotsan: implement malloc stats querying
Dmitry Vyukov [Thu, 24 Jan 2013 09:08:03 +0000 (09:08 +0000)]
tsan: implement malloc stats querying

llvm-svn: 173332

11 years agoLift a cheap early exit test above loops and other complex early exit
Chandler Carruth [Thu, 24 Jan 2013 08:22:40 +0000 (08:22 +0000)]
Lift a cheap early exit test above loops and other complex early exit
tests. No need to pay the high cost when we're never going to do
anything.

No functionality changed.

llvm-svn: 173331

11 years agoclang/GlobalModuleIndex: Don't open the same file twice. Use raw_fd_ostream(fd, ...
NAKAMURA Takumi [Thu, 24 Jan 2013 08:20:11 +0000 (08:20 +0000)]
clang/GlobalModuleIndex: Don't open the same file twice. Use raw_fd_ostream(fd, ...) instead.

FIXME: PathV2::unique_file() is assumed to open the file with binary mode on win32.
llvm-svn: 173330

11 years agoSpiff up the comment on this method, making the example a bit more
Chandler Carruth [Thu, 24 Jan 2013 08:05:06 +0000 (08:05 +0000)]
Spiff up the comment on this method, making the example a bit more
pretty in doxygen, adding some of the details actually present in
a classic example where this matters (a loop from gzip and many other
compression algorithms), and a cautionary note about the risks inherent
in the transform. This has come up on the mailing lists recently, and
I suspect folks reading this code could benefit from going and looking
at the MI pass that can really deal with these issues.

llvm-svn: 173329

11 years agoasan/tsan: fix pwrite interceptors
Dmitry Vyukov [Thu, 24 Jan 2013 07:44:21 +0000 (07:44 +0000)]
asan/tsan: fix pwrite interceptors

llvm-svn: 173328

11 years agotsan: also test asan during presubmit checks, because sanitizer_common changes can...
Dmitry Vyukov [Thu, 24 Jan 2013 07:43:55 +0000 (07:43 +0000)]
tsan: also test asan during presubmit checks, because sanitizer_common changes can affect it

llvm-svn: 173327

11 years agoclang/test/Modules/global_index.m: XFAILing on win32 when investigating for now.
NAKAMURA Takumi [Thu, 24 Jan 2013 07:04:14 +0000 (07:04 +0000)]
clang/test/Modules/global_index.m: XFAILing on win32 when investigating for now.

llvm-svn: 173326

11 years agoMipsISelLowering.cpp: Fill unreachable paths to fix warnings. [-Wsometimes-uninitialized]
NAKAMURA Takumi [Thu, 24 Jan 2013 06:08:06 +0000 (06:08 +0000)]
MipsISelLowering.cpp: Fill unreachable paths to fix warnings. [-Wsometimes-uninitialized]

FIXME: Could they, unreachable(s), be removed?
FIXME: I could prefer the coding standards...
llvm-svn: 173325

11 years agoMipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]
NAKAMURA Takumi [Thu, 24 Jan 2013 05:54:23 +0000 (05:54 +0000)]
MipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]

...and fix a typo, s/#ifdef/#ifndef/

llvm-svn: 173324

11 years agoMipsISelLowering.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Thu, 24 Jan 2013 05:47:29 +0000 (05:47 +0000)]
MipsISelLowering.cpp: Fix a warning. [-Wunused-variable]

llvm-svn: 173323

11 years agoRemove trailing whitespace.
Craig Topper [Thu, 24 Jan 2013 05:22:40 +0000 (05:22 +0000)]
Remove trailing whitespace.

llvm-svn: 173322

11 years agoAdd asserts to SmallVector so that calls to front() and back() only succeed
Richard Trieu [Thu, 24 Jan 2013 04:29:24 +0000 (04:29 +0000)]
Add asserts to SmallVector so that calls to front() and back() only succeed
if the vector is not empty.  This will ensure that calls to these functions
will reference elements in the vector.

llvm-svn: 173321

11 years agoThe next phase of Mips16 hard float implementation.
Reed Kotler [Thu, 24 Jan 2013 04:24:02 +0000 (04:24 +0000)]
The next phase of Mips16 hard float implementation.

Allow Mips16 routines to call Mips32 routines that have abi requirements
that either arguments or return values are passed in floating point
registers. This handles only the pic case. We have not done non pic
for Mips16 yet in any form.

The libm functions are Mips32, so with this addition we have a complete
Mips16 hard float implementation.

We still are not able to complete mix Mip16 and Mips32 with hard float.
That will be the next phase which will have several steps. For Mips32
to freely call Mips16 some stub functions must be created.

llvm-svn: 173320

11 years agoGive warn_redecl_library_builtin a flag name: -Wincompatible-library-redeclaration.
Nick Lewycky [Thu, 24 Jan 2013 03:43:15 +0000 (03:43 +0000)]
Give warn_redecl_library_builtin a flag name: -Wincompatible-library-redeclaration.

llvm-svn: 173319

11 years agoMachineScheduler: enable biasCriticalPath for all DAGs.
Andrew Trick [Thu, 24 Jan 2013 02:09:57 +0000 (02:09 +0000)]
MachineScheduler: enable biasCriticalPath for all DAGs.

llvm-svn: 173318

11 years agoMIsched: Added biasCriticalPath.
Andrew Trick [Thu, 24 Jan 2013 02:09:55 +0000 (02:09 +0000)]
MIsched: Added biasCriticalPath.

Allow schedulers to order DAG edges by critical path. This makes
DFS-based heuristics more stable and effective.

llvm-svn: 173317

11 years ago[ELF] Add R_X86_64_IRELATIVE.
Michael J. Spencer [Thu, 24 Jan 2013 02:08:25 +0000 (02:08 +0000)]
[ELF] Add R_X86_64_IRELATIVE.

llvm-svn: 173316

11 years agoStart checking nonnull (as well as format and argument_with_type_tag) on
Nick Lewycky [Thu, 24 Jan 2013 02:03:08 +0000 (02:03 +0000)]
Start checking nonnull (as well as format and argument_with_type_tag) on
overloaded binary operators.

llvm-svn: 173315

11 years agoFix some wonky formatting, remove spurious emacs major mode marker. No
Nick Lewycky [Thu, 24 Jan 2013 01:12:16 +0000 (01:12 +0000)]
Fix some wonky formatting, remove spurious emacs major mode marker. No
functionality change!

llvm-svn: 173314

11 years agoAdd a profile for uniquifying the AttributeSet with the AttributeSetNodes.
Bill Wendling [Thu, 24 Jan 2013 01:01:34 +0000 (01:01 +0000)]
Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.

llvm-svn: 173313

11 years agoCleanup the AttributeSetNodes that we create.
Bill Wendling [Thu, 24 Jan 2013 00:14:46 +0000 (00:14 +0000)]
Cleanup the AttributeSetNodes that we create.

llvm-svn: 173311

11 years agoCreate a new class: AttributeSetNode.
Bill Wendling [Thu, 24 Jan 2013 00:06:56 +0000 (00:06 +0000)]
Create a new class: AttributeSetNode.

This is a helper class for the AttributeSetImpl class. It holds a set of
attributes that apply to a single element: function, return type, or
parameter.

These are uniqued.

llvm-svn: 173310

11 years agoMicro cleanup: use an array of const char, rather than an array of char, as the
Richard Smith [Wed, 23 Jan 2013 23:38:20 +0000 (23:38 +0000)]
Micro cleanup: use an array of const char, rather than an array of char, as the
type of the string literal implicitly used for a raw user-defined literal call.
No test; this has no semantic impact.

llvm-svn: 173309

11 years agoCheck for NULL breakpoint option thread name & queue name before comparing their...
Jim Ingham [Wed, 23 Jan 2013 23:14:13 +0000 (23:14 +0000)]
Check for NULL breakpoint option thread name & queue name before comparing their values to the new value.

<rdar://problem/13065198>

llvm-svn: 173308

11 years agoDon't check lines beginning with '#', since they could contain a path with the unexpe...
Bill Wendling [Wed, 23 Jan 2013 23:07:21 +0000 (23:07 +0000)]
Don't check lines beginning with '#', since they could contain a path with the unexpected word in them.

llvm-svn: 173307

11 years agoDon't check lines beginning with '#', since they could contain a path with the unexpe...
Bill Wendling [Wed, 23 Jan 2013 23:06:28 +0000 (23:06 +0000)]
Don't check lines beginning with '#', since they could contain a path with the unexpected word in them.

llvm-svn: 173306

11 years agoThe diagnostic is now a warning instead of an error. Also don't check lines beginning...
Bill Wendling [Wed, 23 Jan 2013 23:04:29 +0000 (23:04 +0000)]
The diagnostic is now a warning instead of an error. Also don't check lines beginning with '#', since they could contain a path with the unexpected word in them.

llvm-svn: 173305

11 years agoPush down the conversion of the alignment from the bit mask to a real number into...
Bill Wendling [Wed, 23 Jan 2013 23:00:05 +0000 (23:00 +0000)]
Push down the conversion of the alignment from the bit mask to a real number into the attribute implementation class.

llvm-svn: 173304

11 years agoFix for case-sensitive file systems. Ugh
Douglas Gregor [Wed, 23 Jan 2013 22:45:24 +0000 (22:45 +0000)]
Fix for case-sensitive file systems. Ugh

llvm-svn: 173303

11 years agoRemove dead methods.
Bill Wendling [Wed, 23 Jan 2013 22:38:33 +0000 (22:38 +0000)]
Remove dead methods.

llvm-svn: 173302

11 years agoImplement the writer side of the global module index.
Douglas Gregor [Wed, 23 Jan 2013 22:38:11 +0000 (22:38 +0000)]
Implement the writer side of the global module index.

The global module index is a "global" index for all of the module
files within a particular subdirectory in the module cache, which
keeps track of all of the "interesting" identifiers and selectors
known in each of the module files. One can perform a fast lookup in
the index to determine which module files will have more information
about entities with a particular name/selector. This information can
help eliminate redundant lookups into module files (a serious
performance problem) and help with creating auto-import/auto-include
Fix-Its.

The global module index is created or updated at the end of a
translation unit that has triggered a (re)build of a module by
scraping all of the .pcm files out of the module cache subdirectory,
so it catches everything. As with module rebuilds, we use the file
system's atomicity to synchronize.

llvm-svn: 173301

11 years agoAdd SectionPosition and OrderPass
Nick Kledzik [Wed, 23 Jan 2013 22:32:56 +0000 (22:32 +0000)]
Add SectionPosition and OrderPass

llvm-svn: 173300

11 years ago[ELF] Read IFUNC symbols correctly as typeResolver.
Michael J. Spencer [Wed, 23 Jan 2013 22:08:46 +0000 (22:08 +0000)]
[ELF] Read IFUNC symbols correctly as typeResolver.

llvm-svn: 173299

11 years agoFix small typo
Eli Bendersky [Wed, 23 Jan 2013 22:05:19 +0000 (22:05 +0000)]
Fix small typo

llvm-svn: 173298

11 years agoR600: Add a llvm.R600.store.swizzle intrinsics
Tom Stellard [Wed, 23 Jan 2013 21:39:49 +0000 (21:39 +0000)]
R600: Add a llvm.R600.store.swizzle intrinsics

This intrinsic is translated to ALLOC_EXPORT_WORD1_SWIZ, hence its
name. It is used to store vs/fs outputs

Patch by: Vincent Lejeune

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

11 years agoR600: Simplify stream outputs intrinsic
Tom Stellard [Wed, 23 Jan 2013 21:39:47 +0000 (21:39 +0000)]
R600: Simplify stream outputs intrinsic

Patch by: Vincent Lejeune

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

11 years agoAdd a test case for 'analyzer_noreturn' on category methods.
Ted Kremenek [Wed, 23 Jan 2013 21:29:13 +0000 (21:29 +0000)]
Add a test case for 'analyzer_noreturn' on category methods.

llvm-svn: 173295

11 years agoAlways process an index.html file if we have HTML output. Patch by Justin Bogner.
Ted Kremenek [Wed, 23 Jan 2013 21:22:14 +0000 (21:22 +0000)]
Always process an index.html file if we have HTML output.  Patch by Justin Bogner.

llvm-svn: 173294

11 years agoConstantFolding: Tweak r173289, it should evaluate in the intptr type, not the index...
Benjamin Kramer [Wed, 23 Jan 2013 21:21:24 +0000 (21:21 +0000)]
ConstantFolding: Tweak r173289, it should evaluate in the intptr type, not the index type.

llvm-svn: 173293

11 years agoAdd missing null check. Not sure why my tests passed before.
Ted Kremenek [Wed, 23 Jan 2013 21:12:49 +0000 (21:12 +0000)]
Add missing null check.  Not sure why my tests passed before.

llvm-svn: 173292

11 years agoHonor attribute 'analyzer_noreturn' on Objective-C methods.
Ted Kremenek [Wed, 23 Jan 2013 21:00:27 +0000 (21:00 +0000)]
Honor attribute 'analyzer_noreturn' on Objective-C methods.

This isn't likely a full solution, but it catches the common cases
and can be refined over time.

Fixes <rdar://problem/11634353>.

llvm-svn: 173291

11 years agoAdd extra indent for nested calls inside if's.
Daniel Jasper [Wed, 23 Jan 2013 20:41:06 +0000 (20:41 +0000)]
Add extra indent for nested calls inside if's.

Before:
if (aaaaaaaaaa(
    aaaaaaaaaa)) {}

After:
if (aaaaaaaaaa(
        aaaaaaaaaa)) {}

llvm-svn: 173290

11 years agoConstantFolding: Evaluate GEP indices in the index type.
Benjamin Kramer [Wed, 23 Jan 2013 20:41:05 +0000 (20:41 +0000)]
ConstantFolding: Evaluate GEP indices in the index type.

This fixes some edge cases that we would get wrong with uint64_ts.
PR14986.

llvm-svn: 173289

11 years agoAdd instruction encodings / disassembly support for l6r instructions.
Richard Osborne [Wed, 23 Jan 2013 20:08:11 +0000 (20:08 +0000)]
Add instruction encodings / disassembly support for l6r instructions.

llvm-svn: 173288

11 years agoAdd PassManager.
Michael J. Spencer [Wed, 23 Jan 2013 20:03:10 +0000 (20:03 +0000)]
Add PassManager.

It owns and manages passes.

llvm-svn: 173287

11 years agoImplement -Wvla correctly
Dmitri Gribenko [Wed, 23 Jan 2013 20:02:51 +0000 (20:02 +0000)]
Implement -Wvla correctly

GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA,
for example, if they are forbidden by coding guidelines).  Currently Clang
implements -Wvla as "warn on VLA when it is an extension".

The attached patch makes our behavior match GCC.  The existing vla extwarn is
moved under -Wvla-extension and is still included into -Wgnu.

This fixes PR5953.

llvm-svn: 173286

11 years agoInitialize SSPBufferSize. PR14999. Patch by Vinson Lee.
Chad Rosier [Wed, 23 Jan 2013 19:32:37 +0000 (19:32 +0000)]
Initialize SSPBufferSize. PR14999. Patch by Vinson Lee.

llvm-svn: 173285

11 years agoRemove unused methods and ivars.
Bill Wendling [Wed, 23 Jan 2013 19:06:01 +0000 (19:06 +0000)]
Remove unused methods and ivars.

llvm-svn: 173284

11 years agoFactor the trait for lookup into the on-based hash table of
Douglas Gregor [Wed, 23 Jan 2013 18:53:14 +0000 (18:53 +0000)]
Factor the trait for lookup into the on-based hash table of
identifiers into two parts: the part that involves dealing with the
key (which can be re-used) and the ASTReader-specific part that
creates the IdentifierInfos. While I'm at it, StringRef'ify this code,
which was using pair<const char*, unsigned>. No functionality change.

llvm-svn: 173283

11 years agodocs: clear up ambiguity
Sean Silva [Wed, 23 Jan 2013 18:28:48 +0000 (18:28 +0000)]
docs: clear up ambiguity

Anybody using clang is a "developer".

llvm-svn: 173282

11 years ago[PCH] Temporarily disable the "ambiguous macro" warning that is currently bogus with...
Argyrios Kyrtzidis [Wed, 23 Jan 2013 18:21:56 +0000 (18:21 +0000)]
[PCH] Temporarily disable the "ambiguous macro" warning that is currently bogus with a PCH
that redefined a macro without undef'ing it first.

Proper reconstruction of the macro info history from modules will properly fix this in subsequent commits.

rdar://13016031

llvm-svn: 173281

11 years agoDocumentation: add a note that -cc1 options are not guaranteed to be stable
Dmitri Gribenko [Wed, 23 Jan 2013 18:02:28 +0000 (18:02 +0000)]
Documentation: add a note that -cc1 options are not guaranteed to be stable

llvm-svn: 173280

11 years agoRevert "InstCombine: Clean up weird code that talks about a modulus that's long gone."
Benjamin Kramer [Wed, 23 Jan 2013 17:52:29 +0000 (17:52 +0000)]
Revert "InstCombine: Clean up weird code that talks about a modulus that's long gone."

This causes crashes during the build of compiler-rt during selfhost. Add a
testcase for coverage.

llvm-svn: 173279

11 years agolibclang: change return type of getCursorDecl() to 'const Decl *'
Dmitri Gribenko [Wed, 23 Jan 2013 17:25:27 +0000 (17:25 +0000)]
libclang: change return type of getCursorDecl() to 'const Decl *'

llvm-svn: 173278

11 years agoUse 'const Decl *' throughout code completion in Sema
Dmitri Gribenko [Wed, 23 Jan 2013 17:21:11 +0000 (17:21 +0000)]
Use 'const Decl *' throughout code completion in Sema

llvm-svn: 173277

11 years agoInstCombine: Clean up weird code that talks about a modulus that's long gone.
Benjamin Kramer [Wed, 23 Jan 2013 17:16:22 +0000 (17:16 +0000)]
InstCombine: Clean up weird code that talks about a modulus that's long gone.

This does the right thing unless the multiplication overflows, but the old code
didn't handle that case either.

llvm-svn: 173276

11 years agoFix powerpc test failure - forgot to initialize stack slot size for PPCLinuxMCAsmInfo
Eli Bendersky [Wed, 23 Jan 2013 17:12:15 +0000 (17:12 +0000)]
Fix powerpc test failure - forgot to initialize stack slot size for PPCLinuxMCAsmInfo

llvm-svn: 173275

11 years agoAdd constness for NestedNameSpecifier::Create parameter
Dmitri Gribenko [Wed, 23 Jan 2013 17:06:56 +0000 (17:06 +0000)]
Add constness for NestedNameSpecifier::Create parameter

llvm-svn: 173274

11 years agoDon't try to align builder-type continuations on assignments.
Daniel Jasper [Wed, 23 Jan 2013 16:58:21 +0000 (16:58 +0000)]
Don't try to align builder-type continuations on assignments.

Before:
int aaaa = aaaaa().aaaaa() // force break
           .aaaaa();
After:
int aaaa = aaaaa().aaaaa() // force break
    .aaaaa();

The other indent is just wrong and confusing.

llvm-svn: 173273

11 years agoConstify some getters in RedeclarableTemplateDecl
Dmitri Gribenko [Wed, 23 Jan 2013 16:52:57 +0000 (16:52 +0000)]
Constify some getters in RedeclarableTemplateDecl

llvm-svn: 173272

11 years agoClean up assignment of CalleeSaveStackSlotSize: get rid of the default and explicitly...
Eli Bendersky [Wed, 23 Jan 2013 16:22:04 +0000 (16:22 +0000)]
Clean up assignment of CalleeSaveStackSlotSize: get rid of the default and explicitly set this in every target that needs to change it from the default.

llvm-svn: 173270

11 years agoRemove uneeded casts
Dmitri Gribenko [Wed, 23 Jan 2013 15:56:07 +0000 (15:56 +0000)]
Remove uneeded casts

llvm-svn: 173269

11 years agoDon't try to do a hanging ident after assignments.
Daniel Jasper [Wed, 23 Jan 2013 15:55:19 +0000 (15:55 +0000)]
Don't try to do a hanging ident after assignments.

Before:
bool aaaa = aaaaaaaaaaa(
                aaaaaaaaaaaaaaaaa);

After:
bool aaaa = aaaaaaaaaaa(
    aaaaaaaaaaaaaaaaa);

The other indentation was a nice attempt but doesn't work in many cases.
Not sure what the right long term solution is as the "After: " is still
not nice. We either need to figure out what to do in the cases where it
"doesn't work" or come up with a third solution, e.g. falling back to:

bool aaaa =
    aaaaaaaaaaa(
        aaaaaaaaaaaaaaaaa);

which should always work and nicely highlight the structure.

llvm-svn: 173268

11 years agoNVPTX: Stop leaking memory by using a managed constant instead of a new Argument.
Benjamin Kramer [Wed, 23 Jan 2013 15:21:44 +0000 (15:21 +0000)]
NVPTX: Stop leaking memory by using a managed constant instead of a new Argument.

This is still an egregious hack since we don't have a nice interface for this
kind of thing but should help the valgrind leak check buildbot to become green.

llvm-svn: 173267

11 years agochange from using 2 bits to 4 bits, as 2 bits arent enough to hold the enumeration...
Shankar Easwaran [Wed, 23 Jan 2013 15:11:22 +0000 (15:11 +0000)]
change from using 2 bits to 4 bits, as 2 bits arent enough to hold the enumeration OutputKind

llvm-svn: 173266

11 years agoMake sure metarenamer won't rename special stuff (intrinsics and explicitly renamed...
Anton Korobeynikov [Wed, 23 Jan 2013 15:03:08 +0000 (15:03 +0000)]
Make sure metarenamer won't rename special stuff (intrinsics and explicitly renamed stuff).
Otherwise this might hide the problems.

llvm-svn: 173265

11 years agoFix handling of macro definitions.
Manuel Klimek [Wed, 23 Jan 2013 14:37:36 +0000 (14:37 +0000)]
Fix handling of macro definitions.

Now correctly formats:
 #define A (1)

llvm-svn: 173264

11 years ago[msan] Allow waitpid while in __msan_init().
Evgeniy Stepanov [Wed, 23 Jan 2013 14:22:05 +0000 (14:22 +0000)]
[msan] Allow waitpid while in __msan_init().

This is used in symbolizer init.

llvm-svn: 173263

11 years agoFixes layouting regression and invalid-read.
Manuel Klimek [Wed, 23 Jan 2013 14:08:21 +0000 (14:08 +0000)]
Fixes layouting regression and invalid-read.

Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.

Also fixes an invalid-read found by the valgrind bot.

llvm-svn: 173262

11 years ago[sanitizer] increase the minimal mmap size in allocator to 2^16; fix the asan Mac...
Kostya Serebryany [Wed, 23 Jan 2013 14:07:17 +0000 (14:07 +0000)]
[sanitizer] increase the minimal mmap size in allocator to 2^16; fix the asan Mac build

llvm-svn: 173261

11 years ago[asan] initialize kHighMemEnd at startup (instead of at compile time) to simplify...
Kostya Serebryany [Wed, 23 Jan 2013 13:27:43 +0000 (13:27 +0000)]
[asan] initialize kHighMemEnd at startup (instead of at compile time) to simplify further changes for various address space layouts. Fix asan_allocator2 for PowerPC (tested on 44-bit address space)

llvm-svn: 173260

11 years agoFix the formatting of pointer/reference types in range-based for loops.
Daniel Jasper [Wed, 23 Jan 2013 12:58:14 +0000 (12:58 +0000)]
Fix the formatting of pointer/reference types in range-based for loops.

Before: for (int & a : Values) {}
After:  for (int &a : Values) {}
llvm-svn: 173259

11 years ago[asan] use ADD instead of OR when applying shadow offset of PowerPC. See http://gcc...
Kostya Serebryany [Wed, 23 Jan 2013 12:54:55 +0000 (12:54 +0000)]
[asan] use ADD instead of OR when applying shadow offset of PowerPC. See gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details

llvm-svn: 173258

11 years agoRemoving the penalty for breaking after "=".
Daniel Jasper [Wed, 23 Jan 2013 12:27:43 +0000 (12:27 +0000)]
Removing the penalty for breaking after "=".

Having seen more cases, this actually was not a good thing to do in the
first place. We can still improve on what we do now, but breaking after
the "=" is good in many cases.

Before:
aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa(
                    aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaa =
    aa->aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

llvm-svn: 173257

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