Commit Graph

72873 Commits

Author SHA1 Message Date
Dan Gohman 580b80d6d9 Make ConstantFoldConstantExpression recursively visit the entire
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.

Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.

llvm-svn: 89659
2009-11-23 16:22:21 +00:00
Dan Gohman 1f522d98f8 Fix a use of an invalidated iterator in the case where there are multiple
adjacent uses of a dead basic block from the same user. This fixes PR5596.

llvm-svn: 89658
2009-11-23 16:13:39 +00:00
Sebastian Redl a6602e9e2a Let using directives refer to namespace aliases. Fixes PR5479.
llvm-svn: 89657
2009-11-23 15:34:23 +00:00
Douglas Gregor 378e1923b6 Require a class type to be complete before probing its conversion
functions for a switch condition's conversion to integral or
enumeration type. 

llvm-svn: 89656
2009-11-23 13:53:21 +00:00
Douglas Gregor d0c22e0d10 Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518.

llvm-svn: 89655
2009-11-23 13:46:08 +00:00
Douglas Gregor bd866c2985 Canonical template arguments that are template template parameters by
their template parameter depth and position, so that we can match
redeclarations appropriately. Fixes PR5527 and PR5528.

llvm-svn: 89654
2009-11-23 12:52:47 +00:00
Douglas Gregor 601f4f0b07 Improve type-checking of templates by distinguishing between members
of the current instantiation and members of an unknown specialization
when type-checking a qualified-if expression.

llvm-svn: 89653
2009-11-23 12:39:54 +00:00
Douglas Gregor 27381f3d93 Do not mark declarations as used when performing overload resolution. Fixes PR5541
llvm-svn: 89652
2009-11-23 12:27:39 +00:00
Douglas Gregor 65911498ef Tolerate extraneous "template<>" headers better, downgrading the
complaint to a warning and providing a helpful node in the case where
the "template<>" header is redundant because the corresponding
template-id refers to an explicit specialization. C++0x might still
change this behavior, and existing practice is all over the place on
the number of "template<>" headers actually needed.

llvm-svn: 89651
2009-11-23 12:11:45 +00:00
Douglas Gregor 1c3feb5b25 Fix CMake build
llvm-svn: 89650
2009-11-23 12:03:50 +00:00
Douglas Gregor ed6c744091 Centralize and complete the computation of value- and type-dependence for DeclRefExprs
llvm-svn: 89649
2009-11-23 11:41:28 +00:00
Duncan Sands 9d786d701d I forgot to update the prototype for LLVMBuildIntCast when correcting
the body to not pass the name for the isSigned parameter.  However it
seems that changing prototypes is a big-no-no, so here I revert the
previous change and pass "true" for isSigned, meaning this always does
a signed cast, which was the previous behaviour assuming the name was
not NULL!  Some other C function needs to be introduced for the general
case of signed or unsigned casts.  This hopefully unbreaks the ocaml
binding.

llvm-svn: 89648
2009-11-23 10:49:03 +00:00
Nick Lewycky 890a1d120f Start catching LLVMContext misuse in the verifier.
llvm-svn: 89646
2009-11-23 04:52:00 +00:00
Nick Lewycky 15a1287c1f Pull LLVMContext out of PromoteMemToReg.
llvm-svn: 89645
2009-11-23 03:50:44 +00:00
Nick Lewycky 621fe5614e Remove LLVMContext and its include.
llvm-svn: 89644
2009-11-23 03:34:29 +00:00
Zhongxing Xu 5f76620b53 UndefBranchChecker: more bug reporter helper information emit.
llvm-svn: 89643
2009-11-23 03:29:59 +00:00
Nick Lewycky 39dbfd3c58 Remove unused LLVMContext.
llvm-svn: 89642
2009-11-23 03:29:18 +00:00
Nick Lewycky 4e3b3f3d92 Remove dead LLVMContext argument.
llvm-svn: 89641
2009-11-23 03:26:09 +00:00
Zhongxing Xu 56dd5f0f70 Initial refactor of UndefBranchChecker. We still use GRBranchNodeBuilder
in the checker directly. But I don't have a better approach for now.

llvm-svn: 89640
2009-11-23 03:20:54 +00:00
Nick Lewycky 922d4ab574 Reapply r88830 with a bugfix: this transform only applies to icmp eq/ne. This
fixes part of PR5438.

llvm-svn: 89639
2009-11-23 03:17:33 +00:00
John McCall 6b51f28e82 Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class.  Use it pervasively throughout Sema.

My fingers hurt.

llvm-svn: 89638
2009-11-23 01:53:49 +00:00
Oscar Fuentes 1251697156 CMake: Updated library dependencies.
llvm-svn: 89637
2009-11-23 00:40:39 +00:00
Oscar Fuentes dea579fde3 CMake: Do not try to install a target before it is defined.
llvm-svn: 89636
2009-11-23 00:32:42 +00:00
Oscar Fuentes 0c2443a28d CMake: generate targets for tools and examples even when
LLVM_BUILD_TOOLS or LLVM_BUILD_EXAMPLES are OFF.

llvm-svn: 89635
2009-11-23 00:21:43 +00:00
Daniel Dunbar baa74770c9 Change Clang-Code-Compile tests to only -emit-llvm instead of running
codegen/as.

llvm-svn: 89634
2009-11-23 00:07:14 +00:00
Daniel Dunbar 785406bd19 Teach CodeGenFunction::EmitDecl to ignore Using and UsingShadow decls.
llvm-svn: 89633
2009-11-23 00:07:06 +00:00
Daniel Dunbar e1cd0152a9 x86_64, PR5582: Layout bases for C++ records.
- Ideally we would have an single iteration interface for this, but this works
   for now.

llvm-svn: 89632
2009-11-22 23:01:23 +00:00
Daniel Dunbar fd29d88605 FileCheck, PR5239: Try to find the intended match on failures, but looking for a
good nearby fuzzy match. Frequently the input is nearly correct, and just
showing the user the a nearby sensible match is enough to diagnose the problem.
 - The "fuzzyness" is pretty simple and arbitrary, but worked on my three test
   cases. If you encounter problems, or places you think FileCheck should have
   guessed but didn't, please add test cases to PR5239.

For example, previously FileCheck would report this:
--
t.cpp:21:55: error: expected string not found in input
// CHECK: define void @_Z2f25f2_s1([[i64_i64_ty]] %a0)
                                                      ^
<stdin>:19:30: note: scanning from here
define void @_Z2f15f1_s1(%1) nounwind {
                             ^
<stdin>:19:30: note: with variable "i64_i64_ty" equal to "%0"
--

and now it also reports this:
--
<stdin>:27:1: note: possible intended match here
define void @_Z2f25f2_s1(%0) nounwind {
^
--

which makes it clear that the CHECK just has an extra ' %a0' in it, without
having to check the input.

llvm-svn: 89631
2009-11-22 22:59:26 +00:00
Daniel Dunbar 180f1fe4ce Recognize .hpp as a C++ header.
llvm-svn: 89630
2009-11-22 22:08:27 +00:00
Daniel Dunbar f5835ea2e7 Add clang -cc1 parsing of analyzer options.
llvm-svn: 89629
2009-11-22 22:08:20 +00:00
Daniel Dunbar e0ef65aba4 FileCheck: When a string using variable references fails to match, print
additional information about the current definitions of the variables used in
the string.

llvm-svn: 89628
2009-11-22 22:08:06 +00:00
Daniel Dunbar 5a308f5399 SourceMgr: Add ShowLine argument to PrintMessage, to allow suppressing the source line output.
llvm-svn: 89627
2009-11-22 22:08:00 +00:00
Daniel Dunbar 57cb733b46 Allow '_' in FileCheck variable names, it is nice to have at least one
separate character.
 - Chris, OK?

llvm-svn: 89626
2009-11-22 22:07:50 +00:00
Daniel Dunbar 7b8fcadf68 CMake: Add support for running tests with valgrind.
llvm-svn: 89625
2009-11-22 21:55:22 +00:00
John McCall dc7b6079eb Fix LookupResult's sanity-check to handle shadow decls.
llvm-svn: 89624
2009-11-22 20:57:36 +00:00
Ted Kremenek 12b64959ce Change CheckDeadStores to use Expr::isNullPointerConstant, which will correctly determine whether an expression is a null pointer constant.
Patch by Kovarththanan Rajaratnam!

llvm-svn: 89621
2009-11-22 20:26:21 +00:00
Jim Grosbach bf6d35893f Add getFrameIndexReference() to TargetRegisterInfo, which allows targets to
tell debug info which base register to use to reference a frame index on a
per-index basis. This is useful, for example, in the presence of dynamic
stack realignment when local variables are indexed via the stack pointer and
stack-based arguments via the frame pointer.

llvm-svn: 89620
2009-11-22 20:14:00 +00:00
Jim Grosbach fd963e11f5 Move default FrameReg val to getFrameIndexReference(). Otherwise, debug info can get bogus values.
llvm-svn: 89618
2009-11-22 20:05:32 +00:00
Anders Carlsson 5838108317 Use EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.
llvm-svn: 89613
2009-11-22 19:25:33 +00:00
Jim Grosbach 00e9c6103b 80-column cleanup
llvm-svn: 89612
2009-11-22 19:20:36 +00:00
Anders Carlsson ba958400a2 When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.
llvm-svn: 89611
2009-11-22 19:13:51 +00:00
Anders Carlsson 1299f36af1 Update a test to FileCheck.
llvm-svn: 89610
2009-11-22 18:56:40 +00:00
Ken Dyck 65da2db736 Use intptr_t from stdint.h (in freestanding mode) instead of redefining it here
with __INTPTR_TYPE__.

llvm-svn: 89609
2009-11-22 18:29:06 +00:00
Jakob Stoklund Olesen 8a3fdae0aa Teach MachineBasicBlock::updateTerminator() to handle a failing TII->ReverseBranchCondition(Cond) call.
This fixes the MallocBench/cfrac test case regression.

llvm-svn: 89608
2009-11-22 18:28:04 +00:00
Daniel Dunbar 43bff37afb Update doc re: LLVM_BUILD_EXAMPLES.
llvm-svn: 89607
2009-11-22 18:27:51 +00:00
Daniel Dunbar f606951546 Use ExtractElementInst::Create instead of new; patch by Artur Pietrek!
llvm-svn: 89606
2009-11-22 18:27:43 +00:00
David Chisnall 27033c9171 Test case for bug fixed in r89457.
llvm-svn: 89605
2009-11-22 17:42:02 +00:00
Anders Carlsson 072094407d Move bit-field layout out into a separate function. No functionality change.
llvm-svn: 89604
2009-11-22 17:37:31 +00:00
Edward O'Callaghan 0825f09306 Fix for PR5233.
llvm-svn: 89603
2009-11-22 16:21:47 +00:00
Chris Lattner a13c9d1a5e add fixme for dubious code. Duncan, what do you think?
llvm-svn: 89602
2009-11-22 16:16:48 +00:00