Commit Graph

9455 Commits

Author SHA1 Message Date
Anders Carlsson da0e4560a1 Simplify the Objective-C exception handling.
llvm-svn: 64031
2009-02-07 21:26:04 +00:00
Mike Stump 56d2a15829 Format for 80-cols.
llvm-svn: 64030
2009-02-07 20:14:12 +00:00
Sebastian Redl 5822f08cd6 Move CheckPointerToMemberOperands to SemaExprCXX.cpp
llvm-svn: 64029
2009-02-07 20:10:22 +00:00
Mike Stump 6d8a617474 Ensure that we don't miscodegen if vlas creap into the top of the for.
This will allow us to generate break and continue even if vlas are
involved without worry that we'll silently generate bad code.

llvm-svn: 64028
2009-02-07 20:09:00 +00:00
Sebastian Redl 7b7cec6895 Fix pretty-printing of if conditions. Patch by Ben Lickly.
llvm-svn: 64027
2009-02-07 20:05:48 +00:00
Sebastian Redl 2175b6a767 Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

llvm-svn: 64025
2009-02-07 19:52:04 +00:00
Mike Stump dc0d6be7b9 Arrange to have the correct StackDepth for while statements.
llvm-svn: 64021
2009-02-07 18:08:12 +00:00
Mike Stump 1f8be1b9ac Fit into 80-col.
llvm-svn: 64020
2009-02-07 17:18:33 +00:00
Douglas Gregor dfa6ee53d7 Add a test case for some Objective-C behavior that will not be supported in Objective-C++
llvm-svn: 64019
2009-02-07 17:16:20 +00:00
Sebastian Redl f3b5e27fee Make const-initialized const integral variables I-C-Es in C++.
llvm-svn: 64015
2009-02-07 13:06:23 +00:00
Mike Stump 1d91dd98ad Fixup goto codegen in and around VLAs.
llvm-svn: 64014
2009-02-07 12:52:26 +00:00
Sebastian Redl 779dd9382d Fill in C++ status table for section 7 (declarations).
llvm-svn: 64013
2009-02-07 12:42:13 +00:00
Chris Lattner 6726d42059 remove two eroneous suffixes, these promote to int. Thanks to Neil
for pointing this out.

llvm-svn: 64011
2009-02-07 08:49:37 +00:00
Chris Lattner 04441a10a5 add note, weirdness.
llvm-svn: 64010
2009-02-07 07:13:51 +00:00
Chris Lattner a7cc1267cf fix some missing parens, thanks for Eli's review!
Obviously I make a miserable header developer :)

llvm-svn: 64009
2009-02-07 06:42:04 +00:00
Chris Lattner 14bc3528f5 fix a typo that Sebastian noticed!
llvm-svn: 64008
2009-02-07 06:38:41 +00:00
Chris Lattner 5455db4273 make sure that UINTMAX_MAX has an unsigned type. This assumes that
uintmax_t is unsigned long long, which is not optimal, but is assumed 
elsewhere already.

llvm-svn: 64007
2009-02-07 06:38:06 +00:00
Chris Lattner 6bda45cec0 make various MAX/MIN constants be preprocessor constants, not C constants.
Thanks to Eli for pointing this out.

llvm-svn: 64006
2009-02-07 06:33:44 +00:00
Mike Stump 1f36fb1de0 Ensure that we assert if given an unhandled value.
llvm-svn: 64004
2009-02-07 03:46:08 +00:00
Daniel Dunbar ee9e4c274b Set load/store alignment when doing ABI coercions.
- Currently, this is producing poor code, but we prefer correctness
   to performance for now. Eventually we should be able to generally
   avoid having to set the alignment when we control the alignment of
   the alloca.

 - This knocks out 33/1000 failures on my single argument ABI tests,
   down to 22/1000 and 18 of these appear to be gcc bugs. Woot.

llvm-svn: 64001
2009-02-07 02:46:03 +00:00
Ted Kremenek 0b41d6c43d Use 'Destroy(Context)' instead of 'Context.Deallocate()' (does recursive freeing of memory).
llvm-svn: 63998
2009-02-07 01:51:40 +00:00
Ted Kremenek 5a201951ca Overhaul of Stmt allocation:
- Made allocation of Stmt objects using vanilla new/delete a *compiler
  error* by making this new/delete "protected" within class Stmt.
- Now the only way to allocate Stmt objects is by using the new
  operator that takes ASTContext& as an argument.  This ensures that
  all Stmt nodes are allocated from the same (pool) allocator.
- Naturally, these two changes required that *all* creation sites for
  AST nodes use new (ASTContext&).  This is a large patch, but the
  majority of the changes are just this mechanical adjustment.
- The above changes also mean that AST nodes can no longer be
  deallocated using 'delete'.  Instead, one most do
  StmtObject->Destroy(ASTContext&) or do
  ASTContextObject.Deallocate(StmtObject) (the latter not running the
  'Destroy' method).

Along the way I also...
- Made CompoundStmt allocate its array of Stmt* using the allocator in
  ASTContext (previously it used std::vector).  There are a whole
  bunch of other Stmt classes that need to be similarly changed to
  ensure that all memory allocated for ASTs comes from the allocator
  in ASTContext.
- Added a new smart pointer ExprOwningPtr to Sema.h.  This replaces
  the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
  'delete' to free memory instead of a Stmt's 'Destroy' method.

Big thanks to Doug Gregor for helping with the acrobatics of making
'new/delete' private and the new smart pointer ExprOwningPtr!

llvm-svn: 63997
2009-02-07 01:47:29 +00:00
Ted Kremenek 5d7662cfe0 GRExprEngine: When processing compound assignments, do a switch table lookup to get the non-compound opcode from the compound opcode instead of relying on the order of BinaryOperator::opcode values. This unbreaks the misc-ps.c test.
llvm-svn: 63991
2009-02-07 00:52:24 +00:00
Chris Lattner 19179ad680 start of tgmath, yuck.
llvm-svn: 63990
2009-02-07 00:47:29 +00:00
Sebastian Redl 9c3b4b1bc5 Add negative test cases and fix diagnostics for member pointer dereferencing.
llvm-svn: 63987
2009-02-07 00:41:42 +00:00
Daniel Dunbar d404862cf9 When making dummy file entries, the directory name should also be
non-empty.

llvm-svn: 63986
2009-02-07 00:40:41 +00:00
Sebastian Redl 1d8cb2e0d0 Use our new snazzy stdint.h to make a testcase 64-bit portable.
llvm-svn: 63985
2009-02-07 00:23:52 +00:00
Chris Lattner 01af63beb4 Apparently it is important to define intptr_t and uintptr_t to
long instead of int.  This is because system heaers like to redefine
typedefs and that is an error if they don't exactly match.  Use long
for intptr_t on all systems where long is the right size.

llvm-svn: 63984
2009-02-07 00:23:17 +00:00
Sebastian Redl 112a976616 Implement dereferencing of pointers-to-member.
llvm-svn: 63983
2009-02-07 00:15:38 +00:00
Sebastian Redl ad41b83816 Fix some errors in the new stdint.h.
llvm-svn: 63982
2009-02-06 23:57:52 +00:00
Fariborz Jahanian c76e741622 Fixed an objc2 nonfragile-abi code gen bug.
Now we can say 'hello world' objective-c style
in the nonfragile abi.

llvm-svn: 63981
2009-02-06 23:46:26 +00:00
Chris Lattner 6fbf3a07bc only define MB_LEN_MAX if the system <limits.h> doesn't.
don't typecast CHAR_MIN to char, this makes it not a PP constant
and gives it the wrong unpromoted type.  Thanks to Sebastian for
pointing this out!

llvm-svn: 63980
2009-02-06 23:29:39 +00:00
Chris Lattner 404c2fb9cc add a stdint.h header.
llvm-svn: 63977
2009-02-06 22:59:47 +00:00
Chris Lattner 0763cc6bfd Export __INT8_TYPE__ / __INT16_TYPE__ / __INT32_TYPE__ / __INT64_TYPE__
in a gcc 4.5 compatible way so that stdint.h can follow the compiler's 
notion of types.

llvm-svn: 63976
2009-02-06 22:59:26 +00:00
Douglas Gregor 706a6a9cbf Clean up an already-fixed FIXME
llvm-svn: 63975
2009-02-06 22:58:38 +00:00
Douglas Gregor cd72ba97e7 Semantic checking for class template declarations and
redeclarations. For example, checks that a class template
redeclaration has the same template parameters as previous
declarations.

Detangled class-template checking from ActOnTag, whose logic was
getting rather convoluted because it tried to handle C, C++, and C++
template semantics in one shot.

Made some inroads toward eliminating extraneous "declaration does not
declare anything" errors by adding an "error" type specifier.

llvm-svn: 63973
2009-02-06 22:42:48 +00:00
Ted Kremenek b586c293c8 Update comment.
llvm-svn: 63961
2009-02-06 21:15:34 +00:00
Fariborz Jahanian 6b7cd6e5f4 objc2's nonfragile abi API for messages sent to 'super'.
llvm-svn: 63959
2009-02-06 20:09:23 +00:00
Ted Kremenek 6b7ecf6819 Move StringLiteral to allocate its internal string data using the allocator in
ASTContext. This required changing all clients to pass in the ASTContext& to the
constructor of StringLiteral. I also changed all allocations of StringLiteral to
use new(ASTContext&).

Along the way, I updated a bunch of new()'s in StmtSerialization.cpp to use the
allocator from ASTContext& (not complete).

llvm-svn: 63958
2009-02-06 19:55:15 +00:00
Ted Kremenek 80954b7dc3 Add sub-testcase where we process Cocoa.h using --disable-free (i.e., test the usage of the BumpPtrAllocator in ASTContext).
llvm-svn: 63957
2009-02-06 19:36:35 +00:00
Daniel Dunbar 1a5f04dc66 ccc: Forward -dM to clang.
llvm-svn: 63955
2009-02-06 19:26:48 +00:00
Daniel Dunbar 421d40c22b ccc/Darwin: Add a missing Darwin argument translation, -shared becomes
-dynamiclib. Re-audited translations to make sure I didn't miss
something else.

llvm-svn: 63953
2009-02-06 19:18:58 +00:00
Daniel Dunbar fe2fb0af5a Use 'compile' instead of 'codegen' when reporting error to user.
llvm-svn: 63952
2009-02-06 19:18:03 +00:00
Ted Kremenek fab16c16a7 Added special versions of new[]/delete[] to complement the new/delete which uses ASTContext's allocator. Updated some comments along the way.
llvm-svn: 63949
2009-02-06 19:10:16 +00:00
Chris Lattner 0b0cfbcb62 correct description
llvm-svn: 63947
2009-02-06 18:45:59 +00:00
Chris Lattner 1cee17aa5f first hack at limits.h
llvm-svn: 63945
2009-02-06 18:34:27 +00:00
Chris Lattner a31829b5bc -funsigned-char sets __CHAR_UNSIGNED__
llvm-svn: 63942
2009-02-06 18:20:57 +00:00
Douglas Gregor 8af63e42e3 Diagnose attempts to define a namespace member out-of-line when no
matching member exists. Thanks to Piotr Rak for reporting the problem!

llvm-svn: 63939
2009-02-06 17:46:57 +00:00
Zhongxing Xu 4bdb124036 Put the region store specific test in a separate file.
llvm-svn: 63930
2009-02-06 08:56:58 +00:00
Zhongxing Xu e42755334c SymbolicRegions really have unknown sizes.
llvm-svn: 63929
2009-02-06 08:51:30 +00:00
Zhongxing Xu dec48a50df Create ElementRegion when the base is SymbolicRegion. This is like what we do
for FieldRegion. This enables us to track more values.

Simplify SymbolicRegion::getRValueType(). We assume the symbol always has
pointer type.

llvm-svn: 63928
2009-02-06 08:44:27 +00:00
Chris Lattner 1630c3c4f0 Add an implementation of -dM that follows GCC closely enough to permit
diffing the output of:
  clang -dM -o - -E -x c foo.c | sort

llvm-svn: 63926
2009-02-06 06:45:26 +00:00
Chris Lattner 5c7cd6043e add interface for walking macro table.
llvm-svn: 63925
2009-02-06 06:26:42 +00:00
Chris Lattner f302000e5c add support for -x c++-header, update comment.
llvm-svn: 63924
2009-02-06 06:19:20 +00:00
Chris Lattner fc001b04f8 factor some code out into a helper function.
llvm-svn: 63922
2009-02-06 05:56:11 +00:00
Chris Lattner 4c72665bca file gone.
llvm-svn: 63921
2009-02-06 05:18:06 +00:00
Chris Lattner bba531ce99 get __WCHAR_TYPE__ from the targetinfo hook
llvm-svn: 63920
2009-02-06 05:06:07 +00:00
Chris Lattner a91c30fdb0 simplify and refactor a bunch of type definition code in Preprocessor
predefines buffer initialization.

llvm-svn: 63919
2009-02-06 05:04:11 +00:00
Chris Lattner 61898606dc remove some ad-hocery and use DefineTypeSize for more things.
Now you too can have a 47 bit long long!

llvm-svn: 63918
2009-02-06 04:55:18 +00:00
Chris Lattner a3dc5d8423 refactor some code into a DefineTypeSize function.
llvm-svn: 63917
2009-02-06 04:50:25 +00:00
Chris Lattner fa81669354 default diag::err_pp_file_not_found to mapping to fatal,
implementing PR3492: #include failures should be a fatal error

llvm-svn: 63915
2009-02-06 04:16:41 +00:00
Chris Lattner 9e03119446 don't emit any diagnostics after a fatal one.
llvm-svn: 63914
2009-02-06 04:16:02 +00:00
Chris Lattner b05f49e7fd handle fatal errors, rely on warnings to point out missing cases.
llvm-svn: 63913
2009-02-06 03:57:44 +00:00
Ted Kremenek fe7a9601e9 Use ASTContext's allocator to deallocate Stmt objects instead of using 'delete'. This fixes <rdar://problem/6561143>.
llvm-svn: 63905
2009-02-06 01:42:09 +00:00
Daniel Dunbar ba3325af7b ccc: Give explicit error on @ style argument lists (not yet supported).
llvm-svn: 63903
2009-02-06 01:28:59 +00:00
Daniel Dunbar 724167c280 ccc: Implement special language recognition handling for -.
- <rdar://problem/6551577> [ccc] require -x with -

llvm-svn: 63901
2009-02-05 23:44:44 +00:00
Douglas Gregor eff93e0401 Improve the representation of template type parameters. We now
canonicalize by template parameter depth, index, and name, and the
unnamed version of a template parameter serves as the canonical.

TemplateTypeParmDecl no longer needs to inherit from
TemplateParmPosition, since depth and index information is present
within the type.

llvm-svn: 63899
2009-02-05 23:33:38 +00:00
Ted Kremenek 686a09d7b8 Updated checker build.
llvm-svn: 63897
2009-02-05 23:19:12 +00:00
Chris Lattner 6be3cd1073 allow mapping errors to fatal.
llvm-svn: 63896
2009-02-05 22:56:06 +00:00
Chris Lattner 9d6c4408d1 document fatal
llvm-svn: 63895
2009-02-05 22:49:08 +00:00
Chris Lattner fbe2272fc8 add support to the diagnostics machinery for mapping warnings and
errors to 'fatal' error severity.

llvm-svn: 63894
2009-02-05 22:47:05 +00:00
Ted Kremenek 0ca23d3f73 Add 'AppendValue' to the list of magic CF function names that cause a tracked object to escape. Fixes <rdar://problem/6560661>.
llvm-svn: 63891
2009-02-05 22:34:53 +00:00
Fariborz Jahanian 33f66e640a objc2's nonfragile-abi - API selection for when receiver is a class
llvm-svn: 63881
2009-02-05 20:41:40 +00:00
Anders Carlsson 31f8649f83 Follow Eli's advice and store the VLA size with the native size_t type. Fixes PR3491.
llvm-svn: 63879
2009-02-05 19:43:10 +00:00
Fariborz Jahanian 4f9d349e07 More objc2's API chanes.
llvm-svn: 63878
2009-02-05 19:35:43 +00:00
Douglas Gregor 700792c4e4 Improvements and fixes for name lookup with using directives, from Piotr Rak!
Also, put Objective-C protocols into their own identifier
namespace. Otherwise, we find protocols when we don't want to in C++
(but not in C).

llvm-svn: 63877
2009-02-05 19:25:20 +00:00
Chris Lattner df52dc7a6f I didn't mean to change this.
llvm-svn: 63875
2009-02-05 19:05:56 +00:00
Torok Edwin c6853c1531 Add Debian gcc 4.3 header search directories.
llvm-svn: 63872
2009-02-05 18:12:45 +00:00
Fariborz Jahanian 9065541262 #ifdef'out out objc2 API selection which is not done in gcc (unlike
the documentation to the contrary).

llvm-svn: 63871
2009-02-05 18:00:27 +00:00
Ted Kremenek cc41c07227 Update checker build.
llvm-svn: 63869
2009-02-05 15:48:51 +00:00
Sebastian Redl 0fb63471de Fix the symptom of the regression, by having the CXXConditionDeclExpr not destroy its Decl.
However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted.

llvm-svn: 63868
2009-02-05 15:12:41 +00:00
Sebastian Redl 726a0d9524 Put the invalid flag of OwningResult into the Action pointer.
This shrinks OwningResult by one pointer. Since it is no longer larger than OwningPtr, merge the two.
This leads to simpler client code and speeds up my benchmark by 2.7%.
For some reason, this exposes a previously hidden bug, causing a regression in SemaCXX/condition.cpp.

llvm-svn: 63867
2009-02-05 15:02:23 +00:00
Sebastian Redl 16d307d8d0 Remove some non-ASCII in comment.
llvm-svn: 63866
2009-02-05 12:33:33 +00:00
Daniel Dunbar 3b2dd4368a Add bare bones test that parameter passing is consistent for
scalar/complex/aggregate cases.
 - Currently disabled for x86_64, triggering a misoptimization
   (PR3489).

llvm-svn: 63864
2009-02-05 11:21:33 +00:00
Daniel Dunbar 5d3dbd64e1 Implement Direct ABIInfo semantics.
- No intended functionality change, this is essentially enabling
   direct passing of complex and aggregate values, which no ABI is
   using.

llvm-svn: 63863
2009-02-05 11:13:54 +00:00
Daniel Dunbar cea3af4e54 Simplify test for whether we need an alloca to hold an indirect return
value.
 - No functionality change.

llvm-svn: 63859
2009-02-05 09:24:53 +00:00
Daniel Dunbar 747865af0c Implement ABI Indirect sematics for arguments.
- No intended functionality change, all current ABI implementations
   were only using indirect for complex/aggregate types, which were
   being passed indirectly with the Direct ABIInfo kind.

llvm-svn: 63858
2009-02-05 09:16:39 +00:00
Daniel Dunbar b8b1c679c4 Merge ABIInfo StructRet/ByVal into Indirect.
- No (intended) functionality change, the semantic changes are to come.

llvm-svn: 63850
2009-02-05 08:00:50 +00:00
Chris Lattner d0a79b2eb8 make clang agree with gcc 4.2's x86-64 predefines and settings.
llvm-svn: 63849
2009-02-05 07:32:46 +00:00
Chris Lattner fafd8d1be9 correct and generalize computation of __INTMAX_MAX__.
llvm-svn: 63848
2009-02-05 07:27:41 +00:00
Chris Lattner 6e5ca6bff9 privatize some stuff.
llvm-svn: 63847
2009-02-05 07:27:29 +00:00
Chris Lattner 8181312251 fix some differences between apple gcc and clang on darwin/x86-32.
llvm-svn: 63846
2009-02-05 07:19:24 +00:00
Daniel Dunbar c79407fc40 Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.
llvm-svn: 63845
2009-02-05 07:09:07 +00:00
Zhongxing Xu 9103df1688 Make SymbolicRegion subclass TypedRegion, for symbols usually have types, so
do the symblic regions associated with them and we need them to be typed.

Current SymbolicRegion::getRValueType() method is very restricting. It may be
modified when we are more clear about what could be the types of symblic
regions.

BasicConstraintManager::Assume() is changed due to that now SymblicRegion is a
subclass of SubRegion.
 

llvm-svn: 63844
2009-02-05 06:57:29 +00:00
Ted Kremenek 400aae7fa4 Remove a bunch of obscene double-buffering of BugReports in the retain/release
checker. This was previously needed because BugReport objects were previously
allocated on the stack and not owned by BugReporter. Now we can just issue them
on the fly. This change was motivated because we were seeing some weird cases
where some really long paths would get issued for bugs (particularly leaks)
because of some double-caching.

llvm-svn: 63840
2009-02-05 06:50:21 +00:00
Daniel Dunbar e7dffe39ff ccc: Translate -O to -O1 for clang, and only pass last -O option.
llvm-svn: 63816
2009-02-05 02:43:38 +00:00
Dale Johannesen 621c3512a3 Reapply Daniel's patch to match up with llvm 63765.
Untested, Daniel or Nate please review.

llvm-svn: 63814
2009-02-05 01:50:47 +00:00
Daniel Dunbar 70245be397 x86-32: Use Ignore to avoid passing empty structs (instead of Expand).
llvm-svn: 63813
2009-02-05 01:50:07 +00:00
Daniel Dunbar 0103574d55 Honor ByVal alignment. Patch by Nate Begeman!
llvm-svn: 63811
2009-02-05 01:31:19 +00:00
Fariborz Jahanian 4e87c834d3 This patch generates messaging code for objc2's non-fragile abi.
llvm-svn: 63810
2009-02-05 01:13:09 +00:00
Daniel Dunbar 8045343ca2 Initialize alignment field for ByVal ABIInfo correctly.
llvm-svn: 63809
2009-02-05 01:01:30 +00:00
Ted Kremenek fb379b2660 Fix regression: Leak (BugType) object should have 'isLeak()' return true.
llvm-svn: 63803
2009-02-05 00:38:00 +00:00
Daniel Dunbar fff09f335d Unbreak CGFunctionInfo::Profile method and reenable caching of ABI
information.

llvm-svn: 63799
2009-02-05 00:00:23 +00:00
Ted Kremenek fc5d067ea0 Overhaul BugReporter interface and implementation. The new interface cleans up
the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes,
and BugTypes are owned by the BugReporter object.

The major functionality change in this patch is that reports are not immediately
emitted by a call to BugReporter::EmitWarning (now called EmitReport), but
instead of queued up in report "equivalence classes". When
BugReporter::FlushReports() is called, it emits one diagnostic per report
equivalence class. This provides a nice cleanup with the caching of reports as
well as enables the BugReporter engine to select the "best" path for reporting a
path-sensitive bug based on all the locations in the ExplodedGraph that the same
bug could occur.

Along with this patch, Leaks are now coalesced into a common equivalence class
by their allocation site, and the "summary" diagnostic for leaks now reports the
allocation site as the location of the bug (this may later be augmented to also
provide an example location where the leak occurs).

llvm-svn: 63796
2009-02-04 23:49:09 +00:00
Daniel Dunbar 400c040e01 Chase LLVM TOT in circles (i.e., revert r63773 to match revert of
r63765).

llvm-svn: 63795
2009-02-04 23:40:00 +00:00
Daniel Dunbar 56e7552c73 Add ABIArgInfo::dump()
llvm-svn: 63794
2009-02-04 23:24:38 +00:00
Douglas Gregor fc4f8a1834 Implement semantic analysis for the GNU flexible array initialization
extension. The interaction with designated initializers is a
bit... interesting... but we follow GNU's lead and don't permit too
much crazy code in this area.

Also, make the "excess initializers" error message a bit more
informative.

Addresses PR2561: http://llvm.org/bugs/show_bug.cgi?id=2561

llvm-svn: 63785
2009-02-04 22:46:25 +00:00
Mike Stump 82f071faa7 Add support for blocks with explicit return types.
llvm-svn: 63784
2009-02-04 22:31:32 +00:00
Daniel Dunbar 46353ece18 Use correct signature for calling enumeration mutation function.
llvm-svn: 63782
2009-02-04 22:00:33 +00:00
Daniel Dunbar fb5fdf1f14 Temporarily disable caching of ABI results; this is going horribly
wrong in some cases.

llvm-svn: 63780
2009-02-04 21:36:22 +00:00
Sebastian Redl 18f8ff62a3 Implement taking address of member functions, including overloaded ones.
llvm-svn: 63779
2009-02-04 21:23:32 +00:00
Daniel Dunbar ed9309ef46 ccc: Forward -femit-all-decls to clang and use an option group to
simplify handling of -f options clang recognizes.

llvm-svn: 63778
2009-02-04 21:21:08 +00:00
Daniel Dunbar fa803cd260 Test case for -femit-all-decls.
llvm-svn: 63777
2009-02-04 21:20:25 +00:00
Daniel Dunbar 1e8052b36d Add -femit-all-decls codegen option.
- Emits all declarations, even unused (static) ones.
 - Useful when doing minimization of codegen problems (otherwise
   problems localized to a static function aren't minimized well).

llvm-svn: 63776
2009-02-04 21:19:06 +00:00
Daniel Dunbar a45bdbbb6a Add asserts that the function signature matches the other arguments provide
to CGCall functions.

llvm-svn: 63775
2009-02-04 21:17:21 +00:00
Daniel Dunbar 91b73d441e (llvm up) Update for intrinsic lookup changes.
llvm-svn: 63773
2009-02-04 21:09:15 +00:00
Fariborz Jahanian e4dc35deb9 Some early code for objc2's nonfragile abi messaging.
llvm-svn: 63770
2009-02-04 20:42:28 +00:00
Fariborz Jahanian b73a23e47e Patch fixes messaging for GNU runtime.
Patch by David Chisnall

llvm-svn: 63769
2009-02-04 20:31:19 +00:00
Chris Lattner 2e731e369c smaller header.
llvm-svn: 63766
2009-02-04 19:47:38 +00:00
Chris Lattner 022923a22a Fix PR3464 by searching for headers from the predefines
buffer as if the #include happened from the main file.

llvm-svn: 63764
2009-02-04 19:45:07 +00:00
Chris Lattner 7ead0396f6 Ok, we need a system header for this test to pass in the clang/test directory as well as from the pp directory.
llvm-svn: 63763
2009-02-04 19:44:14 +00:00
Chris Lattner 988dff84f1 fix test
llvm-svn: 63762
2009-02-04 19:40:02 +00:00
Chris Lattner 2f7bb79c86 rename again
llvm-svn: 63761
2009-02-04 19:38:30 +00:00
Chris Lattner 4a82a24108 rename some tests
llvm-svn: 63759
2009-02-04 19:38:12 +00:00
Chris Lattner 3b04af73f1 include smaller header for test.
llvm-svn: 63758
2009-02-04 19:37:49 +00:00
Chris Lattner 29321443f6 add DeclTemplate.h/cpp
llvm-svn: 63757
2009-02-04 19:21:34 +00:00
Douglas Gregor ec6e1893d7 Improve documentation for Sema::getTypeName. Also, it's return type is
DeclTy*, not TypeTy*.

llvm-svn: 63756
2009-02-04 19:16:12 +00:00
Douglas Gregor 4ab311dc30 Note the Radar number that corresponds to PR3137
llvm-svn: 63754
2009-02-04 19:10:27 +00:00
Ted Kremenek 77de9885f8 Update checker build.
llvm-svn: 63753
2009-02-04 19:09:38 +00:00
Douglas Gregor ded2d7b021 Basic representation of C++ class templates, from Andrew Sutton.
llvm-svn: 63750
2009-02-04 19:02:06 +00:00
Eli Friedman cddff7fd62 Test for PR3137.
llvm-svn: 63749
2009-02-04 18:50:00 +00:00
Douglas Gregor 2ada048975 Some name-lookup-related fixes, from Piotr Rak!
- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.

llvm-svn: 63739
2009-02-04 17:27:36 +00:00
Steve Naroff 189d41f625 Fix <rdar://problem/6552648> error: redefinition of 'XCElementAnchorDelegate' as different kind of symbol.
At first glance, this looked like a recent regression (possibly created by http://llvm.org/viewvc/llvm-project?view=rev&revision=63354, which was the only recent change to this section of Sema::ActOnStartClassInterface()). After more investigation, it looks like an edge case bug that we didn't cover in our tests.

llvm-svn: 63738
2009-02-04 17:14:05 +00:00
Douglas Gregor 8a6be5ec64 Diagnose ambiguities in getTypeName. Fixes http://llvm.org/bugs/show_bug.cgi?id=3475
llvm-svn: 63737
2009-02-04 17:00:24 +00:00
Douglas Gregor 94eabf3355 Bring operator name lookup (as required for C++ operator overloading)
into the general name-lookup fold. This cleans up some ugly,
not-quite-working code in the handling of operator overloading.

llvm-svn: 63735
2009-02-04 16:44:47 +00:00
Douglas Gregor 7bad6d1d32 Argument Dependent Lookup is done (for now). Also, update the status
for a few other name-lookup sections.

llvm-svn: 63734
2009-02-04 15:07:16 +00:00
Douglas Gregor b8a9a41dd6 Fix our semantic analysis of
unqualified-id '('

in C++. The unqualified-id might not refer to any declaration in our
current scope, but declarations by that name might be found via
argument-dependent lookup. We now do so properly.

As part of this change, CXXDependentNameExpr, which was previously
designed to express the unqualified-id in the above constructor within
templates, has become UnresolvedFunctionNameExpr, which does
effectively the same thing but will work for both templates and
non-templates.

Additionally, we cope with all unqualified-ids, since ADL also applies
in cases like

  operator+(x, y)

llvm-svn: 63733
2009-02-04 15:01:18 +00:00
Douglas Gregor 82b7372941 An idea for limiting diagnostic output, from David Abrahams
llvm-svn: 63732
2009-02-04 13:07:56 +00:00
Daniel Dunbar 3ba943ed7a ccc: -ObjC and -ObjC++ change default language, but only for "source
files".

llvm-svn: 63727
2009-02-04 08:01:01 +00:00
Daniel Dunbar 6e3b7df125 Handle demotion of coerced arguments (as in void a(x) short x; { ... }).
llvm-svn: 63726
2009-02-04 07:22:24 +00:00
Chris Lattner 1c967784f3 Implement handling of file entry/exit notifications from GNU
line markers, including maintenance of the virtual include stack.

For something like this:

# 42 "bar.c" 1
# 142 "bar2.c" 1

#warning zappa
# 92 "bar.c" 2
#warning gonzo
# 102 "foo.c" 2
#warning bonkta


we now produce these three warnings:

#1:
In file included from foo.c:3:
In file included from bar.c:42:
bar2.c:143:2: warning: #warning zappa
#warning zappa
 ^

#2:
In file included from foo.c:3:
bar.c:92:2: warning: #warning gonzo
#warning gonzo
 ^

#3:
foo.c:102:2: warning: #warning bonkta
#warning bonkta
 ^

llvm-svn: 63722
2009-02-04 06:25:26 +00:00
Chris Lattner e7bfe52046 # 42 doesn't change system header state either, add test.
llvm-svn: 63721
2009-02-04 05:36:14 +00:00
Chris Lattner 95d9c5e778 make getFileCharacteristic linetable aware. line markers that
play around with the 'is system header' bit now function correctly.

llvm-svn: 63720
2009-02-04 05:33:01 +00:00
Chris Lattner 0a1a8d8514 propagate linemarker flags down into the the line table, currently
ignoring include stack push/pop info though.

llvm-svn: 63719
2009-02-04 05:21:58 +00:00
Chris Lattner 334a2ada06 replace gimpy linear search with svelte binary search ;-)
llvm-svn: 63717
2009-02-04 04:46:59 +00:00
Zhongxing Xu 6d5fe08e1b Remove dead code.
llvm-svn: 63715
2009-02-04 02:30:11 +00:00
Chris Lattner 8411e168f8 make my atrocious linear search at least search in the order that is
more likely to hit.

llvm-svn: 63714
2009-02-04 02:29:52 +00:00
Chris Lattner 7941b81498 Add simple #line directive test.
llvm-svn: 63713
2009-02-04 02:17:09 +00:00
Chris Lattner 20c50ba26c add comment
llvm-svn: 63712
2009-02-04 02:15:40 +00:00
Chris Lattner e508c36338 spelling change.
llvm-svn: 63711
2009-02-04 02:15:34 +00:00
Chris Lattner c1219ff7cc add the difference in the line marker phys line number and the
query point to the returned presumed location.  We now produce:

foo.h:92:2: warning: #warning blarg!
#warning blarg!
 ^
foo.h:93:2: warning: #warning blarg!
#warning blarg!
 ^
foo.h:94:2: warning: #warning blarg!
#warning blarg!
 ^

for:

#line 92 "foo.h"
#warning blarg!
#warning blarg!
#warning blarg!

blarg indeed!

llvm-svn: 63710
2009-02-04 02:00:59 +00:00
Chris Lattner d429392285 add really really trivial #line support, where #line now makes every
location below it report as coming from the #line location.  For example,
with:

#line 92 "foo.h"
#warning blarg!
#warning blarg!

we now emit:

foo.h:92:2: warning: #warning blarg!
#warning blarg!
 ^
foo.h:92:2: warning: #warning blarg!
#warning blarg!
 ^

llvm-svn: 63709
2009-02-04 01:55:42 +00:00
Chris Lattner 5177d3ee8f simplify.
llvm-svn: 63708
2009-02-04 01:54:28 +00:00
Chris Lattner 88ea93e6b4 lower the interface to getLineNumber like we did for
getColumnNumber.  This fixes a FIXME in 
SourceManager::getPresumedLoc because we now just decompose
the sloc once.

llvm-svn: 63701
2009-02-04 01:06:56 +00:00
Daniel Dunbar aa64e6807d Force triple for this test case.
llvm-svn: 63699
2009-02-04 00:58:28 +00:00
Chris Lattner e4ad417664 make SM::getColumnNumber take a predecomposed FileID/offset, which
makes it clear to clients that they have to pick an instantiation
or spelling location before calling it and allows optimization based
on that.

llvm-svn: 63698
2009-02-04 00:55:58 +00:00
Daniel Dunbar 310c5b1ab1 Update passing of _Bool values to match what function was declared to take.
llvm-svn: 63697
2009-02-04 00:55:44 +00:00
Daniel Dunbar 4d22e4975a Change construction of common ObjC functions to use CGCall
infrastructure to construct function type.
 - For consistencty, we should probably always use this to construct
   function types, but these are absolutely necessary to ensure that
   we can emit calls to these functions.

llvm-svn: 63695
2009-02-04 00:44:42 +00:00
Chris Lattner 153a0f1f52 build per-fid linetable entries.
llvm-svn: 63694
2009-02-04 00:40:31 +00:00
Douglas Gregor e254f90d94 Initial implementation of argument dependent lookup (a.k.a. ADL,
a.k.a. Koenig lookup) in C++. Most of the pieces are in place, but for
two:

  - In an unqualified call g(x), even if the name does not refer to
    anything in the current scope, we can still find functions named
    "g" based on ADL. We don't yet have this ability.
  - ADL will need updating for friend functions and templates.

llvm-svn: 63692
2009-02-04 00:32:51 +00:00
Fariborz Jahanian 3d9296e6f5 Some function stub added for new abi messaging.
llvm-svn: 63691
2009-02-04 00:22:57 +00:00
Daniel Dunbar eb39504426 Use -fnext-runtime for this test.
llvm-svn: 63688
2009-02-04 00:03:15 +00:00
Fariborz Jahanian 4193308b2a -x language fix.
Patch by David Chisnall

llvm-svn: 63686
2009-02-03 23:59:32 +00:00
Daniel Dunbar 84388bf397 Use CGCall infrastructure to call enumeration mutation function.
llvm-svn: 63685
2009-02-03 23:55:40 +00:00
Fariborz Jahanian 82c72e1ee4 Several new declarations for objc2 nonfragile
abi messaging.

llvm-svn: 63684
2009-02-03 23:49:23 +00:00
Daniel Dunbar 1ef7373ee8 Fix return type for calls to objc_setProperty.
llvm-svn: 63683
2009-02-03 23:43:59 +00:00
Daniel Dunbar a33461150d Use ConvertTypeForMem when creating alloca for scalar argument.
llvm-svn: 63681
2009-02-03 23:04:57 +00:00
Daniel Dunbar c41a0b8a3c Force -triple/-fnext-runtime for a few more test cases.
llvm-svn: 63679
2009-02-03 23:04:31 +00:00
Daniel Dunbar ee3da87ce7 Add CodeGenFunction::ConvertTypeForMem forwarding function.
llvm-svn: 63678
2009-02-03 23:03:55 +00:00
Chris Lattner 6e0e1f49a5 more plumbing for #line propagation. Use happy bit #3
out of FileInfo :)

llvm-svn: 63672
2009-02-03 22:13:05 +00:00
Daniel Dunbar 25bd032084 Force triple for codegen tests which have expectations on output
types.

llvm-svn: 63669
2009-02-03 21:54:49 +00:00
Chris Lattner a4e0d1d177 codegen is much farther along than when this was first written.
llvm-svn: 63668
2009-02-03 21:54:08 +00:00
Chris Lattner 1eaa70a612 stub out basic #line handling calls.
llvm-svn: 63667
2009-02-03 21:52:55 +00:00
Fariborz Jahanian e80f317886 GNUStep fast enumeration.
Patch by David Chisnall.

llvm-svn: 63666
2009-02-03 21:52:35 +00:00
Chris Lattner ab5d0ca71a update a couple entries, add a new idea
llvm-svn: 63665
2009-02-03 21:51:37 +00:00
Chris Lattner 1927267b9d silence some warnings.
llvm-svn: 63662
2009-02-03 21:29:32 +00:00
Daniel Dunbar ed1ba4fc12 Use /usr/bin/env to run Python for increased portability. Patch by
David Chisnall.

llvm-svn: 63661
2009-02-03 21:25:26 +00:00
Steve Naroff fcc6fd5c39 Fix <rdar://problem/6521757> clang ObjC rewriter: Mixed Mac and Windows line endings after rewrite.
llvm-svn: 63657
2009-02-03 20:39:18 +00:00
Sebastian Redl 3d3f75a995 Allow taking the address of data members, resulting in a member pointer.
Pointers to functions don't work yet, and pointers to overloaded functions even less. Also, far too much illegal code is accepted.

llvm-svn: 63655
2009-02-03 20:19:35 +00:00
Daniel Dunbar fc7c76159c x86_64 ABI: Initial implementation of ABI compliant parameter passing.
- Now only 27/500 failures on ABITest single argument tests; from
   350/500. :)
 - As with return types, a large percentage of these are likely to be
   gcc bugs, not yet reviewed.

Also, fix bug in handling of Ignore ABI type in argument lists.

llvm-svn: 63654
2009-02-03 20:00:13 +00:00
Douglas Gregor 9554952264 Remove a fixed FIXME
llvm-svn: 63648
2009-02-03 19:26:44 +00:00
Douglas Gregor 4489e9465f When looking for a tag name via unqualified name lookup, only look in
scopes where the name would be considered a redeclaration if we know
that we're declaring or defining that tag.

llvm-svn: 63647
2009-02-03 19:26:08 +00:00
Douglas Gregor 889ceb752d Semantic analysis, ASTs, and unqualified name lookup support for C++
using directives, from Piotr Rak!

llvm-svn: 63646
2009-02-03 19:21:40 +00:00
Daniel Dunbar 2f219b0770 ABI handling: Implement coercion for argument types (in addition to
return types).

llvm-svn: 63645
2009-02-03 19:12:28 +00:00
Fariborz Jahanian 712bfa6478 ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).
llvm-svn: 63644
2009-02-03 19:03:09 +00:00
Sanjiv Gupta c1b58d40e6 Targets that don't have stack use global address space for parameters.
Specify external linkage for such globals so that llvm optimizer do
not assume there values initialized as zero.

llvm-svn: 63636
2009-02-03 18:07:49 +00:00
Fariborz Jahanian ebc4c9d2a3 Minor objc2 bug fix.
llvm-svn: 63635
2009-02-03 17:34:34 +00:00
Sanjiv Gupta 3cac613eb8 Fixed the typo in comment.
llvm-svn: 63634
2009-02-03 17:23:12 +00:00
Chris Lattner 9be4f6d6c7 reclaim my precious bit in FileInfo by ensuring that ContentCache objects
are 8-byte aligned.

llvm-svn: 63630
2009-02-03 07:41:46 +00:00
Chris Lattner c8233df64b switch SourceManager from using an std::map and std::list of
ContentCache objects to using a densemap and list, and allocating
the ContentCache objects from a bump pointer.  This does not speed
up or slow down things substantially, but gives us control over 
their alignment.

llvm-svn: 63628
2009-02-03 07:30:45 +00:00
Chris Lattner 79f6de0fd0 true is pass, false is success.
llvm-svn: 63627
2009-02-03 07:28:12 +00:00
Chris Lattner 96960c82db disable this test too
llvm-svn: 63626
2009-02-03 07:25:43 +00:00
Chris Lattner a8be8de596 make this fail faster.
llvm-svn: 63625
2009-02-03 07:24:53 +00:00
Chris Lattner a77cad1012 add #include to make more self-contained.
llvm-svn: 63624
2009-02-03 07:20:54 +00:00
Daniel Dunbar 32931eb21d Change ABIInfo to compute information for a full signature at a time
(the main point of this restructing).

llvm-svn: 63619
2009-02-03 06:51:18 +00:00
Daniel Dunbar 0136282a9c Remove ABIArgInfo::Default kind, ABI is now responsible for specifying
acceptable kind with more precise semantics.

llvm-svn: 63617
2009-02-03 06:30:17 +00:00
Daniel Dunbar 67dace890f Add ABIArgInfo::Direct kind, which passes arguments using whatever the
native IRgen type is. This is like Default, but without any extra
semantics (like automatic tweaking of structures or void).

llvm-svn: 63615
2009-02-03 06:17:37 +00:00
Chris Lattner 5b0de55045 remove some overly-crazy ideas.
llvm-svn: 63614
2009-02-03 06:05:34 +00:00
Daniel Dunbar 5a0acdc982 Add two FIXMEs.
llvm-svn: 63613
2009-02-03 06:02:10 +00:00
Daniel Dunbar b52d077d8b Always use CGFunctionInfo to access ABI information.
llvm-svn: 63612
2009-02-03 05:59:18 +00:00