platform/upstream/llvm.git
12 years ago[asan] mention -fno-omit-frame-pointer in the docs
Kostya Serebryany [Fri, 6 Jan 2012 17:35:27 +0000 (17:35 +0000)]
[asan] mention -fno-omit-frame-pointer in the docs

llvm-svn: 147663

12 years agoWhen inferring a submodule ID during module creation, look up the
Douglas Gregor [Fri, 6 Jan 2012 17:19:32 +0000 (17:19 +0000)]
When inferring a submodule ID during module creation, look up the
include stack to find the first file that is known to be part of the
module. This copes with situations where the module map doesn't
completely specify all of the headers that are involved in the module,
which can come up when there are very strange #include_next chains
(e.g., with weird compiler/stdlib headers like stdarg.h or float.h).

llvm-svn: 147662

12 years ago[analyzer] Correct the c++-analyzer symlink
Anna Zaks [Fri, 6 Jan 2012 17:11:23 +0000 (17:11 +0000)]
[analyzer] Correct the c++-analyzer symlink

As Matt pointed out, this should be just a link to 'ccc-analyzer'.

llvm-svn: 147661

12 years agoStash Decl's TopLevelDeclInObjCContainer and ModulePrivate bits
Douglas Gregor [Fri, 6 Jan 2012 16:59:53 +0000 (16:59 +0000)]
Stash Decl's TopLevelDeclInObjCContainer and ModulePrivate bits
into the two unused lower bits of the NextDeclInContext link, dropping
the number of bits in Decl down to 32, and saving 8 bytes per
declaration on x86-64.

llvm-svn: 147660

12 years agoC++11 generalized constant expressions: implement checking and diagnostics for
Richard Smith [Fri, 6 Jan 2012 16:39:00 +0000 (16:39 +0000)]
C++11 generalized constant expressions: implement checking and diagnostics for
pointer-arithmetic-related undefined behavior and unspecified results. We
continue to fold such values, but now notice they aren't constant expressions.

llvm-svn: 147659

12 years agoIntroduce a "Hidden" bit into Decl, to track whether that declaration
Douglas Gregor [Fri, 6 Jan 2012 16:22:39 +0000 (16:22 +0000)]
Introduce a "Hidden" bit into Decl, to track whether that declaration
is hidden from name lookup. The previous hack of tweaking the
ModulePrivate bit when loading a declaration from a hidden submodule
was brittle.

Note that we now have 34 bits in Decl. I'll fix that next.

llvm-svn: 147658

12 years agoTeach DeclContext deserialization to pay attention to endianness, from
Douglas Gregor [Fri, 6 Jan 2012 16:09:53 +0000 (16:09 +0000)]
Teach DeclContext deserialization to pay attention to endianness, from
David Fang and Takumi Nakamura. Fixes many PCH failures on PowerPC.

llvm-svn: 147657

12 years agoIf we are compiling with -fno-builtin then don't do constant folding of
David Chisnall [Fri, 6 Jan 2012 12:20:19 +0000 (12:20 +0000)]
If we are compiling with -fno-builtin then don't do constant folding of
builtins.

This fixes PR11711.

llvm-svn: 147655

12 years agoFix typo in string
Eli Bendersky [Fri, 6 Jan 2012 07:49:17 +0000 (07:49 +0000)]
Fix typo in string

llvm-svn: 147654

12 years agoFix the mangling of class template arguments in a particular
John McCall [Fri, 6 Jan 2012 05:06:35 +0000 (05:06 +0000)]
Fix the mangling of class template arguments in a particular
dependent case.  Thanks to Jason Merrill for pointing this out.

llvm-svn: 147653

12 years agoImprovements to the uninitialized variable warning: Check if the constructor
Rafael Espindola [Fri, 6 Jan 2012 04:54:01 +0000 (04:54 +0000)]
Improvements to the uninitialized variable warning: Check if the constructor
call is elidable or if the constructor is trivial instead of checking if it
is user declared.

llvm-svn: 147652

12 years agoAs part of the ongoing work in finalizing the accelerator tables, extend
Eric Christopher [Fri, 6 Jan 2012 04:35:23 +0000 (04:35 +0000)]
As part of the ongoing work in finalizing the accelerator tables, extend
the debug type accelerator tables to contain the tag and a flag
stating whether or not a compound type is a complete type.

rdar://10652330

llvm-svn: 147651

12 years agoMore lambda work. Fixes a minor bug Richard pointed out, makes lookup for lambda...
Eli Friedman [Fri, 6 Jan 2012 03:05:34 +0000 (03:05 +0000)]
More lambda work.  Fixes a minor bug Richard pointed out, makes lookup for lambda parameters work correctly, recording more information into the AST.

llvm-svn: 147650

12 years agoDavid Blaikie and Chandler would like us to diagnose
Richard Smith [Fri, 6 Jan 2012 02:30:50 +0000 (02:30 +0000)]
David Blaikie and Chandler would like us to diagnose

  int f();

in function scopes under -Wvexing-parse, so now we do.

llvm-svn: 147649

12 years ago[analyzer] c++-analyzer should be a symlink.
Anna Zaks [Fri, 6 Jan 2012 02:19:07 +0000 (02:19 +0000)]
[analyzer] c++-analyzer should be a symlink.

This fixes a regression from r147643.

llvm-svn: 147648

12 years ago[asan] move more stuff to OS-specific files
Kostya Serebryany [Fri, 6 Jan 2012 02:12:25 +0000 (02:12 +0000)]
[asan] move more stuff to OS-specific files

llvm-svn: 147647

12 years ago<rdar://problem/10652336>
Greg Clayton [Fri, 6 Jan 2012 02:01:06 +0000 (02:01 +0000)]
<rdar://problem/10652336>

Fixed a crasher when trying to load an expression prefix file:

% touch /tmp/carp.txt
% xcrun lldb
(lldb) settings set target.expr-prefix /tmp/carp.txt
Segmentation fault

llvm-svn: 147646

12 years ago[analyzer] Update the docs to reflect that gcc is not the only default
Anna Zaks [Fri, 6 Jan 2012 01:54:08 +0000 (01:54 +0000)]
[analyzer] Update the docs to reflect that gcc is not the only default
compiler option.

llvm-svn: 147645

12 years ago[analyzer] scan-build: If we are on MacOS, use clang as the default
Anna Zaks [Fri, 6 Jan 2012 01:54:05 +0000 (01:54 +0000)]
[analyzer] scan-build: If we are on MacOS, use clang as the default
compiler.

llvm-svn: 147644

12 years ago[analyzer] Skip --serialize-diagnostic when running scan-build.
Anna Zaks [Fri, 6 Jan 2012 01:54:02 +0000 (01:54 +0000)]
[analyzer] Skip --serialize-diagnostic when running scan-build.

Otherwise, the analyzer will try to analyze the serialized diagnostic
file as if it were a source file.

llvm-svn: 147643

12 years agoTweak to r147599 for PR10828: Move the check from the parser into sema, and use
Richard Smith [Fri, 6 Jan 2012 01:31:20 +0000 (01:31 +0000)]
Tweak to r147599 for PR10828: Move the check from the parser into sema, and use
the Semantic Powers to only warn on class types (or dependent types), where the
constructor or destructor could do something interesting.

llvm-svn: 147642

12 years agoMinor refactoring of sentinel warning on blocks. Add a test for this warning.
Eli Friedman [Fri, 6 Jan 2012 01:23:10 +0000 (01:23 +0000)]
Minor refactoring of sentinel warning on blocks.  Add a test for this warning.

llvm-svn: 147641

12 years ago<rdar://problem/10649734>
Greg Clayton [Fri, 6 Jan 2012 00:47:38 +0000 (00:47 +0000)]
<rdar://problem/10649734>

Fixed an issue where the python interpreter could deadlock LLDB.

llvm-svn: 147640

12 years agohttp://llvm.org/bugs/show_bug.cgi?id=11619
Johnny Chen [Fri, 6 Jan 2012 00:46:12 +0000 (00:46 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=11619
Allow creating SBData values from arrays or primitives in Python

Patch submitted by Enrico Granata.

llvm-svn: 147639

12 years ago<rdar://problem/10647191>
Greg Clayton [Fri, 6 Jan 2012 00:43:54 +0000 (00:43 +0000)]
<rdar://problem/10647191>

Removed an extra call to close that was causing problems and also
now use the Host::File class to open the file.

llvm-svn: 147638

12 years agohttp://llvm.org/bugs/show_bug.cgi?id=11618
Johnny Chen [Fri, 6 Jan 2012 00:35:38 +0000 (00:35 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=11618
lldb::SBValue::AddressOf does not work on dereferenced registers in synthetic children provider

Patch submitted by Enrico Granata.

llvm-svn: 147637

12 years agoobjc++: sythesize a helper function to be used
Fariborz Jahanian [Fri, 6 Jan 2012 00:29:35 +0000 (00:29 +0000)]
objc++: sythesize a helper function to be used
for copying atomic properties of c++ objects
with non-trivial copy assignment in setters/getters.
Not yet used. // rdar://6137845

llvm-svn: 147636

12 years agoFix a memory leak of PragmaNamespaces, rdar://10611796.
Argyrios Kyrtzidis [Fri, 6 Jan 2012 00:22:09 +0000 (00:22 +0000)]
Fix a memory leak of PragmaNamespaces, rdar://10611796.

llvm-svn: 147635

12 years agoWe finalized on the new .apple_types accelerator table format where we don't
Greg Clayton [Fri, 6 Jan 2012 00:17:16 +0000 (00:17 +0000)]
We finalized on the new .apple_types accelerator table format where we don't
emit fully qualified names, so now we make sure the DW_TAG values match and
still lookup using the basename.

llvm-svn: 147634

12 years agohttp://llvm.org/bugs/show_bug.cgi?id=11715
Johnny Chen [Fri, 6 Jan 2012 00:05:01 +0000 (00:05 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=11715
comma at end of enumerator list

llvm-svn: 147633

12 years agoFix build on minix. Patch by Ben Gras!
Rafael Espindola [Thu, 5 Jan 2012 23:59:42 +0000 (23:59 +0000)]
Fix build on minix. Patch by Ben Gras!

llvm-svn: 147632

12 years agoAddress Richard's review comments on r147561 (Evaluate support for address-of-label...
Eli Friedman [Thu, 5 Jan 2012 23:59:40 +0000 (23:59 +0000)]
Address Richard's review comments on r147561 (Evaluate support for address-of-label differences).

llvm-svn: 147631

12 years agoFix SpeculativelyExecuteBB to either speculate all or none of the phis
Dan Gohman [Thu, 5 Jan 2012 23:58:56 +0000 (23:58 +0000)]
Fix SpeculativelyExecuteBB to either speculate all or none of the phis
present in the bottom of the CFG triangle, as the transformation isn't
ever valuable if the branch can't be eliminated.

Also, unify some heuristics between SimplifyCFG's multiple
if-converters, for consistency.

This fixes rdar://10627242.

llvm-svn: 147630

12 years agoFix indentation.
Johnny Chen [Thu, 5 Jan 2012 23:51:37 +0000 (23:51 +0000)]
Fix indentation.

llvm-svn: 147629

12 years ago[asan] use dl_iterate_phdr for pre-symbolization on linux instead of parsing /proc...
Kostya Serebryany [Thu, 5 Jan 2012 23:50:34 +0000 (23:50 +0000)]
[asan] use dl_iterate_phdr for pre-symbolization on linux instead of parsing /proc/self/maps

llvm-svn: 147628

12 years agoAdd back the file I wrongly deleted in r147613.
Johnny Chen [Thu, 5 Jan 2012 23:50:14 +0000 (23:50 +0000)]
Add back the file I wrongly deleted in r147613.

llvm-svn: 147627

12 years agoAlways allocate an extra 8 bytes for a deserialized declaration, since
Douglas Gregor [Thu, 5 Jan 2012 23:49:36 +0000 (23:49 +0000)]
Always allocate an extra 8 bytes for a deserialized declaration, since
some code in Clang expects 8-byte alignment of declarations.

llvm-svn: 147626

12 years agoPR11705, part 2: globalopt shouldn't put inttoptr/ptrtoint operations into global...
Eli Friedman [Thu, 5 Jan 2012 23:03:32 +0000 (23:03 +0000)]
PR11705, part 2: globalopt shouldn't put inttoptr/ptrtoint operations into global initializers if there's an implied extension or truncation.

llvm-svn: 147625

12 years agoLink symbols with different visibilities according to the rules in the
Rafael Espindola [Thu, 5 Jan 2012 23:02:01 +0000 (23:02 +0000)]
Link symbols with different visibilities according to the rules in the
System V Application Binary Interface. This lets us use
-fvisibility-inlines-hidden with LTO.
Fixes PR11697.

llvm-svn: 147624

12 years agoRevert r56315. When the instruction to speculate is a load, this
Dan Gohman [Thu, 5 Jan 2012 22:54:35 +0000 (22:54 +0000)]
Revert r56315. When the instruction to speculate is a load, this
code can incorrectly move the load across a store. This never
happens in practice today, but only because the current
heuristics accidentally preclude it.

llvm-svn: 147623

12 years agoAfter further discussion, rename attribute 'objc_disable_automatic_synthesis' to...
Ted Kremenek [Thu, 5 Jan 2012 22:47:47 +0000 (22:47 +0000)]
After further discussion, rename attribute 'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'.

llvm-svn: 147622

12 years agoFixed a problem in our local Clang's method for
Sean Callanan [Thu, 5 Jan 2012 22:35:40 +0000 (22:35 +0000)]
Fixed a problem in our local Clang's method for
performing Objective-C instance variable lookup.
Previously, it only completed the derived class
that was the beginning of the search.  Now, as
it walks up the superclass chain looking for the
ivar, it completes each superclass in turn.

Also added a testcase covering this issue.

llvm-svn: 147621

12 years agoTweak the fix to PR8977: an empty expression-list represents value initialization...
Eli Friedman [Thu, 5 Jan 2012 22:34:08 +0000 (22:34 +0000)]
Tweak the fix to PR8977: an empty expression-list represents value initialization, not default initialization.  Fixes PR11712.

llvm-svn: 147620

12 years agoDon't seed the ASTWriter's declaration -> ID mapping with the IDs of
Douglas Gregor [Thu, 5 Jan 2012 22:33:30 +0000 (22:33 +0000)]
Don't seed the ASTWriter's declaration -> ID mapping with the IDs of
each deserialized declaration, since that information is already
available in each declaration.

llvm-svn: 147619

12 years agoKill ObjectCodeEmitter and BinaryObject, they were unused and superseded by MC.
Benjamin Kramer [Thu, 5 Jan 2012 22:31:37 +0000 (22:31 +0000)]
Kill ObjectCodeEmitter and BinaryObject, they were unused and superseded by MC.

llvm-svn: 147618

12 years agoWhen we deserialize a declaration from a module file, allocate extra
Douglas Gregor [Thu, 5 Jan 2012 22:27:05 +0000 (22:27 +0000)]
When we deserialize a declaration from a module file, allocate extra
storage for the global declaration ID. Declarations that are parsed
(rather than deserialized) are unaffected, so the number of
declarations that pay this cost tends to be relatively small (since
relatively few declarations are ever deserialized).

This replaces a largish DenseMap within the AST reader. It's not
strictly a win in terms of memory use---not every declaration was
added to that DenseMap in the first place---but it's cleaner to have
this information available for every deserialized declaration, so that
future clients can rely on it.

llvm-svn: 147617

12 years agoSCCCaptured is trivially false on entry to this loop and not modified inside it.
Nick Lewycky [Thu, 5 Jan 2012 22:21:45 +0000 (22:21 +0000)]
SCCCaptured is trivially false on entry to this loop and not modified inside it.
Eliminate the dead test for it on each loop iteration. No functionality change.

llvm-svn: 147616

12 years agoRemove the old ELF writer.
Rafael Espindola [Thu, 5 Jan 2012 22:07:43 +0000 (22:07 +0000)]
Remove the old ELF writer.

llvm-svn: 147615

12 years agoWhen creating declarations that are deserialized from an module file,
Douglas Gregor [Thu, 5 Jan 2012 21:55:30 +0000 (21:55 +0000)]
When creating declarations that are deserialized from an module file,
go through a central allocation routine
Decl::AllocateDeserializedDecl(). No actual functionality change (yet).

llvm-svn: 147614

12 years agoFix incomplete commit of http://llvm.org/viewvc/llvm-project?rev=147609&view=rev:
Johnny Chen [Thu, 5 Jan 2012 21:48:15 +0000 (21:48 +0000)]
Fix incomplete commit of llvm.org/viewvc/llvm-project?rev=147609&view=rev:

This patch combines common code from Linux and FreeBSD into
a new POSIX platform.  It also contains fixes for 64bit FreeBSD.

The patch is based on changes by Mark Peek <mp@FreeBSD.org> and
"K. Macy" <kmacy@freebsd.org> in their github repo located at
https://github.com/fbsd/lldb.

llvm-svn: 147613

12 years agoWhen loading an AST file, set SourceManager::MainFileID to the main file of the AST...
Argyrios Kyrtzidis [Thu, 5 Jan 2012 21:36:25 +0000 (21:36 +0000)]
When loading an AST file, set SourceManager::MainFileID to the main file of the AST file,
as suggested by Tom Honermann.

llvm-svn: 147612

12 years agoA small re-factored JIT/MCJIT::getPointerToNamedFunction(), so it could be called...
Danil Malyshev [Thu, 5 Jan 2012 21:16:14 +0000 (21:16 +0000)]
A small re-factored JIT/MCJIT::getPointerToNamedFunction(), so it could be called with the base class.

llvm-svn: 147610

12 years agoThis patch combines common code from Linux and FreeBSD into
Johnny Chen [Thu, 5 Jan 2012 19:17:38 +0000 (19:17 +0000)]
This patch combines common code from Linux and FreeBSD into
a new POSIX platform.  It also contains fixes for 64bit FreeBSD.

The patch is based on changes by Mark Peek <mp@FreeBSD.org> and
"K. Macy" <kmacy@freebsd.org> in their github repo located at
https://github.com/fbsd/lldb.

llvm-svn: 147609

12 years agorevert r147542 after comments from Joerg Sonnenberger
Sebastian Pop [Thu, 5 Jan 2012 18:28:46 +0000 (18:28 +0000)]
revert r147542 after comments from Joerg Sonnenberger

llvm-svn: 147608

12 years agoallow clients of SmallSet to specify their own comparison function for the set.
Chris Lattner [Thu, 5 Jan 2012 17:35:07 +0000 (17:35 +0000)]
allow clients of SmallSet to specify their own comparison function for the set.
Patch by Stepan Dyatkovskiy!

llvm-svn: 147607

12 years agoRemove an unused variable.
Chandler Carruth [Thu, 5 Jan 2012 11:25:47 +0000 (11:25 +0000)]
Remove an unused variable.

llvm-svn: 147605

12 years agoPrevent a DAGCombine from firing where there are two uses of
Chandler Carruth [Thu, 5 Jan 2012 11:05:55 +0000 (11:05 +0000)]
Prevent a DAGCombine from firing where there are two uses of
a combined-away node and the result of the combine isn't substantially
smaller than the input, it's just canonicalized. This is the first part
of a significant (7%) performance gain for Snappy's hot decompression
loop.

llvm-svn: 147604

12 years agoCleanup and FileCheck-ize a test.
Chandler Carruth [Thu, 5 Jan 2012 11:05:47 +0000 (11:05 +0000)]
Cleanup and FileCheck-ize a test.

llvm-svn: 147603

12 years agoMark scalar FMA4 instructions as ignoring the VEX.L bit.
Craig Topper [Thu, 5 Jan 2012 08:56:10 +0000 (08:56 +0000)]
Mark scalar FMA4 instructions as ignoring the VEX.L bit.

llvm-svn: 147602

12 years agoPeephole optimization of ptest-conditioned branch in X86 arch. Performs instruction...
Victor Umansky [Thu, 5 Jan 2012 08:46:19 +0000 (08:46 +0000)]
Peephole optimization of ptest-conditioned branch in X86 arch. Performs instruction combining of sequences generated by ptestz/ptestc intrinsics to ptest+jcc pair for SSE and AVX.

Testing: passed 'make check' including LIT tests for all sequences being handled (both SSE and AVX)

Reviewers: Evan Cheng, David Blaikie, Bruno Lopes, Elena Demikhovsky, Chad Rosier, Anton Korobeynikov
llvm-svn: 147601

12 years agotest commit (verifyiing commit access)
Eli Bendersky [Thu, 5 Jan 2012 08:18:41 +0000 (08:18 +0000)]
test commit (verifyiing commit access)

llvm-svn: 147600

12 years agoPR10828: Produce a warning when a no-arguments function is declared in block
Richard Smith [Thu, 5 Jan 2012 04:12:21 +0000 (04:12 +0000)]
PR10828: Produce a warning when a no-arguments function is declared in block
scope, when no other indication is provided that the user intended to declare a
function rather than a variable.

Remove some false positives from the existing 'parentheses disambiguated as a
function' warning by suppressing it when the declaration is marked as 'typedef'
or 'extern'.

Add a new warning group -Wvexing-parse containing both of these warnings.

The new warning is enabled by default; despite a number of false positives (and
one bug) in clang's test-suite, I have only found genuine bugs with it when
running it over a significant quantity of real C++ code.

llvm-svn: 147599

12 years agoBumped Xcode project versions for lldb-101 and debugserver-160.
Greg Clayton [Thu, 5 Jan 2012 04:00:49 +0000 (04:00 +0000)]
Bumped Xcode project versions for lldb-101 and debugserver-160.

llvm-svn: 147597

12 years agoAdded code in the Host layer that can report system log messages
Greg Clayton [Thu, 5 Jan 2012 03:57:59 +0000 (03:57 +0000)]
Added code in the Host layer that can report system log messages
so that we don't have "fprintf (stderr, ...)" calls sprinkled everywhere.
Changed all needed locations over to using this.

For non-darwin, we log to stderr only. On darwin, we log to stderr _and_
to ASL (Apple System Log facility). This will allow GUI apps to have a place
for these error and warning messages to go, and also allows the command line
apps to log directly to the terminal.

llvm-svn: 147596

12 years agoMore lambda work. Tweak the Sema interface slightly. Start adding the pieces to...
Eli Friedman [Thu, 5 Jan 2012 03:35:19 +0000 (03:35 +0000)]
More lambda work. Tweak the Sema interface slightly.  Start adding the pieces to build the lambda class and its call operator.  Create an actual scope for the lambda body.

llvm-svn: 147595

12 years agoMinor postra scheduler cleanup. It could result in more precise antidependence latenc...
Andrew Trick [Thu, 5 Jan 2012 02:52:11 +0000 (02:52 +0000)]
Minor postra scheduler cleanup. It could result in more precise antidependence latency on ARM in exceedingly rare cases.

llvm-svn: 147594

12 years agoReplace the uint64_t -> double convertion algorithm with one that's more efficient.
Bill Wendling [Thu, 5 Jan 2012 02:13:20 +0000 (02:13 +0000)]
Replace the uint64_t -> double convertion algorithm with one that's more efficient.

This small bit of ASM code is sufficient to do what the old algorithm did:

     movq       %rax,  %xmm0
     punpckldq  (c0),  %xmm0  // c0: (uint4){ 0x43300000U, 0x45300000U, 0U, 0U }
     subpd      (c1),  %xmm0  // c1: (double2){ 0x1.0p52, 0x1.0p52 * 0x1.0p32 }
   #ifdef __SSE3__
     haddpd   %xmm0, %xmm0
   #else
     pshufd   $0x4e, %xmm0, %xmm1
     addpd    %xmm1, %xmm0
   #endif

It's arguably faster. One caveat, the 'haddpd' instruction isn't very fast on
all processors.
<rdar://problem/7719814>

llvm-svn: 147593

12 years agoFixed a potential hang while trying to execute
Sean Callanan [Thu, 5 Jan 2012 02:00:14 +0000 (02:00 +0000)]
Fixed a potential hang while trying to execute
a function in the inferior.

llvm-svn: 147592

12 years ago[driver] Add support for passing -lazy_framework/-lazy_library to the linker.
Chad Rosier [Thu, 5 Jan 2012 01:56:11 +0000 (01:56 +0000)]
[driver] Add support for passing -lazy_framework/-lazy_library to the linker.
rdar://10630328

llvm-svn: 147591

12 years agoAdd comment explaining the default constructor (ArchSpec) used in CreateTarget().
Johnny Chen [Thu, 5 Jan 2012 01:26:01 +0000 (01:26 +0000)]
Add comment explaining the default constructor (ArchSpec) used in CreateTarget().

llvm-svn: 147590

12 years agoChange casting slightly to avoid warnings about casting away const.
Eli Friedman [Thu, 5 Jan 2012 01:16:29 +0000 (01:16 +0000)]
Change casting slightly to avoid warnings about casting away const.

llvm-svn: 147589

12 years agoWhen we're performing name lookup for a tag, we still allow ourselves
Douglas Gregor [Thu, 5 Jan 2012 01:11:47 +0000 (01:11 +0000)]
When we're performing name lookup for a tag, we still allow ourselves
to see hidden declarations because every tag lookup is effectively a
redeclaration lookup. For example, image that

  struct foo;

is declared in a submodule that is known but hasn't been imported. If
someone later writes

  struct foo *foo_p;

then "struct foo" is either a reference or a redeclaration. To keep
the redeclaration chains sound, we treat it like a redeclaration for
name-lookup purposes.

llvm-svn: 147588

12 years agoFixed a dangling pointer bug associated with the
Sean Callanan [Thu, 5 Jan 2012 01:11:09 +0000 (01:11 +0000)]
Fixed a dangling pointer bug associated with the
result variable on a "finish" statement.  The
ownership of the result value was not being properly
assigned to the newly-created persistent result
variable; now it is.

llvm-svn: 147587

12 years ago[asan] move {linux,mac}-specific code from asan_thread.cc to asan_{linux,mac}.cc...
Kostya Serebryany [Thu, 5 Jan 2012 01:07:27 +0000 (01:07 +0000)]
[asan] move {linux,mac}-specific code from asan_thread.cc to asan_{linux,mac}.cc; also add asan_procmaps.h which I forgot to add on previous commit.

llvm-svn: 147586

12 years agocomment cleanup
Andrew Trick [Thu, 5 Jan 2012 01:01:01 +0000 (01:01 +0000)]
comment cleanup

llvm-svn: 147585

12 years agoDo not hard code asm variant number.
Devang Patel [Thu, 5 Jan 2012 00:51:28 +0000 (00:51 +0000)]
Do not hard code asm variant number.

llvm-svn: 147583

12 years agoMinor cleanup; no functional change.
Eli Friedman [Thu, 5 Jan 2012 00:49:17 +0000 (00:49 +0000)]
Minor cleanup; no functional change.

llvm-svn: 147582

12 years ago[asan] implement our own /proc/self/maps reader and use it on linux instead of sysinfo.h
Kostya Serebryany [Thu, 5 Jan 2012 00:44:33 +0000 (00:44 +0000)]
[asan] implement our own /proc/self/maps reader and use it on linux instead of sysinfo.h

llvm-svn: 147581

12 years agoFileCheck hygiene.
Benjamin Kramer [Thu, 5 Jan 2012 00:43:34 +0000 (00:43 +0000)]
FileCheck hygiene.

llvm-svn: 147580

12 years agoReapply r146997, "Heed spill slot alignment on ARM."
Jakob Stoklund Olesen [Thu, 5 Jan 2012 00:26:57 +0000 (00:26 +0000)]
Reapply r146997, "Heed spill slot alignment on ARM."

Now that canRealignStack() understands frozen reserved registers, it is
safe to use it for aligned spill instructions.

It will only return true if the registers reserved at the beginning of
register allocation allow for dynamic stack realignment.

<rdar://problem/10625436>

llvm-svn: 147579

12 years agoAvoid reserving an ARM base pointer during register allocation.
Jakob Stoklund Olesen [Thu, 5 Jan 2012 00:26:52 +0000 (00:26 +0000)]
Avoid reserving an ARM base pointer during register allocation.

Once register allocation has started the reserved registers are frozen.

Fix the ARM canRealignStack() hook to respect the frozen register state.
Now the hook returns false if register allocation was started with frame
pointer elimination enabled.

It also returns false if register allocation started without a reserved
base pointer, and stack realignment would require a base pointer.  This
bug was breaking oggenc on armv6.

No test case, an upcoming patch will use this functionality to realign
the stack for spill slots when possible.

llvm-svn: 147578

12 years agoFreeze reserved registers before starting register allocation.
Jakob Stoklund Olesen [Thu, 5 Jan 2012 00:26:49 +0000 (00:26 +0000)]
Freeze reserved registers before starting register allocation.

The register allocators don't currently support adding reserved
registers while they are running.  Extend the MRI API to keep track of
the set of reserved registers when register allocation started.

Target hooks like hasFP() and needsStackRealignment() can look at this
set to avoid reserving more registers during register allocation.

llvm-svn: 147577

12 years agoSanity checks in SourceManager::getFileEntryForID() and SourceManager::getFileEntryFo...
Argyrios Kyrtzidis [Thu, 5 Jan 2012 00:19:03 +0000 (00:19 +0000)]
Sanity checks in SourceManager::getFileEntryForID() and SourceManager::getFileEntryForSLocEntry()
to make sure we do not crash. rdar://10594186

llvm-svn: 147576

12 years agoThe value of a const weak variable is not an integer constant.
John McCall [Thu, 5 Jan 2012 00:13:19 +0000 (00:13 +0000)]
The value of a const weak variable is not an integer constant.

llvm-svn: 147575

12 years agoIf we already have a definition for a top-level module that we deserialized from...
Douglas Gregor [Thu, 5 Jan 2012 00:12:00 +0000 (00:12 +0000)]
If we already have a definition for a top-level module that we deserialized from a module file, don't bother parsing a new definition

llvm-svn: 147574

12 years agoFixes a code gen bug for setter code for a property of
Fariborz Jahanian [Thu, 5 Jan 2012 00:10:16 +0000 (00:10 +0000)]
Fixes a code gen bug for setter code for a property of
c++ object reference type with trivial copy constructor.
This causes an assert crash and bad code gen. when assert
is off. // rdar://6137845

llvm-svn: 147573

12 years agoWhen generating includes for all of the headers we found in an
Douglas Gregor [Thu, 5 Jan 2012 00:04:05 +0000 (00:04 +0000)]
When generating includes for all of the headers we found in an
umbrella directory, skip includes for any headers that are part of an
unavailable module.

llvm-svn: 147572

12 years agoSupport more Atom attributes. Add more test cases to lld-core
Nick Kledzik [Wed, 4 Jan 2012 23:58:17 +0000 (23:58 +0000)]
Support more Atom attributes.  Add more test cases to lld-core

llvm-svn: 147571

12 years ago[analyzer] Add another tests to taint tester.
Anna Zaks [Wed, 4 Jan 2012 23:54:04 +0000 (23:54 +0000)]
[analyzer] Add another tests to taint tester.

llvm-svn: 147570

12 years ago[analyzer] Be less pessimistic about invalidation of global variables
Anna Zaks [Wed, 4 Jan 2012 23:54:01 +0000 (23:54 +0000)]
[analyzer] Be less pessimistic about invalidation of global variables
as a result of a call.

Problem:
Global variables, which come in from system libraries should not be
invalidated by all calls. Also, non-system globals should not be
invalidated by system calls.

Solution:
The following solution to invalidation of globals seems flexible enough
for taint (does not invalidate stdin) and should not lead to too
many false positives. We split globals into 3 classes:

* immutable - values are preserved by calls (unless the specific
global is passed in as a parameter):
     A :  Most system globals and const scalars

* invalidated by functions defined in system headers:
     B: errno

* invalidated by all other functions (note, these functions may in
turn contain system calls):
     B: errno
     C: all other globals (which are not in A nor B)

llvm-svn: 147569

12 years ago[analyzer] Correct the error message in the testing infrastructure.
Anna Zaks [Wed, 4 Jan 2012 23:53:50 +0000 (23:53 +0000)]
[analyzer] Correct the error message in the testing infrastructure.

llvm-svn: 147568

12 years agoRename attribute 'objc_suppress_autosynthesis' to 'objc_disable_automatic_synthesis'.
Ted Kremenek [Wed, 4 Jan 2012 23:51:09 +0000 (23:51 +0000)]
Rename attribute 'objc_suppress_autosynthesis' to 'objc_disable_automatic_synthesis'.

llvm-svn: 147567

12 years agoFix 80 col violations.
Ted Kremenek [Wed, 4 Jan 2012 23:48:37 +0000 (23:48 +0000)]
Fix 80 col violations.

llvm-svn: 147566

12 years agoFix test on Release builds.
Eli Friedman [Wed, 4 Jan 2012 23:41:09 +0000 (23:41 +0000)]
Fix test on Release builds.

llvm-svn: 147565

12 years agoStore the submodules of a module in source order, as they are stored
Douglas Gregor [Wed, 4 Jan 2012 23:32:19 +0000 (23:32 +0000)]
Store the submodules of a module in source order, as they are stored
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.

llvm-svn: 147564

12 years agoTest case for my previous patch.
Fariborz Jahanian [Wed, 4 Jan 2012 23:16:48 +0000 (23:16 +0000)]
Test case for my previous patch.

llvm-svn: 147563

12 years agoobjc: When issuing warning for missing synthesis for
Fariborz Jahanian [Wed, 4 Jan 2012 23:16:13 +0000 (23:16 +0000)]
objc: When issuing warning for missing synthesis for
properties in classes declared with objc_suppress_autosynthesis
attribute, pinpoint location of the said class in a note.

llvm-svn: 147562

12 years agoAdd an APValue representation for the difference between two address-of-label express...
Eli Friedman [Wed, 4 Jan 2012 23:13:47 +0000 (23:13 +0000)]
Add an APValue representation for the difference between two address-of-label expressions.  Add support to Evaluate and CGExprConstant for generating/handling them.  Remove the special-case for such differences in Expr::isConstantInitializer.

With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary.

Fixes PR11705.

llvm-svn: 147561

12 years agoGeneralize isSafeToSpeculativelyExecute to work on arbitrary
Dan Gohman [Wed, 4 Jan 2012 23:01:09 +0000 (23:01 +0000)]
Generalize isSafeToSpeculativelyExecute to work on arbitrary
Values, rather than just Instructions, since it's interesting
for ConstantExprs too.

llvm-svn: 147560

12 years ago<rdar://problem/10507811>
Greg Clayton [Wed, 4 Jan 2012 22:56:43 +0000 (22:56 +0000)]
<rdar://problem/10507811>

Be better at detecting when DWARF changes and handle this more
gracefully than asserting and exiting.

Also fixed up a bunch of system calls that weren't properly checking
for EINTR.

llvm-svn: 147559