Commit Graph

17667 Commits

Author SHA1 Message Date
Douglas Gregor c25ca41254 Make a few headers parse standalone
llvm-svn: 88832
2009-11-15 06:34:37 +00:00
Mike Stump 4c808dfc58 Finish off support for typeinfo generation for classes.
llvm-svn: 88828
2009-11-15 03:28:10 +00:00
Daniel Dunbar 6499e9c625 Add a trivial example plugin, which prints the names of the top-level decls.
- The build scriptage is about twice as long as the code, which is nice. :)

llvm-svn: 88826
2009-11-15 00:27:43 +00:00
Daniel Dunbar 9b30eb721f Add examples dir, built with BUILD_EXAMPLES=1 (Makefiles, no CMake equivalent yet).
Move tools/wpa to examples/wpa, and unbreak its build.

llvm-svn: 88825
2009-11-15 00:22:33 +00:00
Daniel Dunbar d392dd0709 Add pluggable action support to clang-cc, via -plugin command line option.
- Expects the plugin has been loaded with -load.

 - Using this may require disabling TOOL_NO_EXPORTS in the clang-cc Makefile, this breaks the llvm::Registry way of working (static constructors are bad, kids). This should be replaced with a "real" plugin model that has explicit plugin interfaces.

llvm-svn: 88824
2009-11-15 00:12:04 +00:00
Mike Stump f5b2869b75 Finisgh off rest of class_type_info rtti generation.
llvm-svn: 88823
2009-11-14 23:32:21 +00:00
Anders Carlsson 6601057f41 When dumping implicit cast exprs, print out whether the cast is an lvalue cast or not.
llvm-svn: 88821
2009-11-14 22:35:18 +00:00
Daniel Dunbar 7fbd42f08a Move the program action enum to FrontendOptions.
--
ddunbar@giles:clang-cc (master)$ grep llvm:🆑:opt clang-cc.cpp  # Woot
ddunbar@giles:clang-cc (master)$
--

llvm-svn: 88820
2009-11-14 22:32:38 +00:00
Daniel Dunbar e13ada6a3b Add clang -mcpu=native support, patch by Roman Divacky, varioustweaks by me.
- We still need support for detecting the target features, since the name
   doesn't actually do a good job of decribing what the CPU supports (for LLVM).

llvm-svn: 88819
2009-11-14 22:04:54 +00:00
Anders Carlsson 6d41727a95 Add an internal CreateRecordDecl that will create a CXXRecordDecl when compiling C++ and a RecordDecl otherwise.
llvm-svn: 88816
2009-11-14 21:45:58 +00:00
Anders Carlsson 461a2c0640 Always build a builtin operator expression for the __extension__ unary operator.
llvm-svn: 88811
2009-11-14 21:26:41 +00:00
Anders Carlsson 50cb321fdc Handle CK_BitCast in EmitCastLValue.
llvm-svn: 88810
2009-11-14 21:21:42 +00:00
Sebastian Redl 7c353685bc - Have TryStaticImplicitCast set the cast kind to NoOp when binding a reference. CheckReferenceInit already inserts implicit casts to the necessary types. This fixes an assertion in CodeGen for some casts and brings a fix for PR5453 close, if I understand that bug correctly.
- Also, perform calculated implicit cast sequences if they're determined to work. This finally diagnoses static_cast to ambiguous or implicit bases and fixes two long-standing fixmes in the test case. For the C-style cast, this requires propagating the access check suppression pretty deep into other functions.
- Pass the expressions for TryStaticCast and TryStaticImplicitCast by reference. This should lead to a better AST being emitted for such casts, and also fixes a memory leak, because CheckReferenceInit and PerformImplicitConversion wrap the node passed to them. These wrappers were previously lost.

llvm-svn: 88809
2009-11-14 21:15:49 +00:00
Anders Carlsson 0acee6e0d7 Canonicalize the type before trying to create a debug type.
llvm-svn: 88808
2009-11-14 21:08:12 +00:00
Anders Carlsson 6037e78149 Have CGDebugInfo::getOrCreateType cache the QualType instead of having every ConvertType overload do it.
llvm-svn: 88807
2009-11-14 20:52:05 +00:00
Daniel Dunbar cf5be70032 Improve test to make sure -fixit is really working.
llvm-svn: 88801
2009-11-14 19:25:21 +00:00
Benjamin Kramer 5e738284d7 Move DISABLE_INLINE to the front of the decl so MSVC can parse it. Patch by Amine Khaldi!
llvm-svn: 88797
2009-11-14 16:36:57 +00:00
Mike Stump 1acec6a41a Build up more of the rtti info for a class. WIP.
llvm-svn: 88795
2009-11-14 15:55:18 +00:00
Mike Stump 14718425fa Add the name to the rtti data structure.
llvm-svn: 88792
2009-11-14 14:25:18 +00:00
Benjamin Kramer f4c511b026 Change *BugReport constructors to take StringRefs.
- Eliminates many calls to std::string.c_str()
- Fixes an invalid read in ReturnStackAddressChecker due to an unsafe call to
  StringRef.data() which doesn't guarantee null-termination.

llvm-svn: 88779
2009-11-14 12:08:24 +00:00
Daniel Dunbar ea956ddf0b clang-cc: Switch to using FrontendAction. Whee.
Please report any discrepancies you see in clang-cc, I'm not confident that our regression tests cover all the fun ways one can use clang-cc.

llvm-svn: 88776
2009-11-14 10:53:49 +00:00
Daniel Dunbar 883578060f Add FrontendActions for all preprocessor based clang-cc actions.
llvm-svn: 88774
2009-11-14 10:42:57 +00:00
Daniel Dunbar 02bd2d7281 Add FrontendActions, which provides a FrontendAction interface to all the existing AST consumer based clang-cc actions.
llvm-svn: 88773
2009-11-14 10:42:46 +00:00
Daniel Dunbar a0ff58dadf Add FrontendAction interface, for encapsulating a "clang-cc" style action.
llvm-svn: 88772
2009-11-14 10:42:35 +00:00
Eli Friedman 274ab904d0 Avoid assert-crash in a case where the expression passed to EmitConstantExpr
legitimately has side-effects (and needs to be generated as a non-constant).

llvm-svn: 88767
2009-11-14 08:51:33 +00:00
Eli Friedman b210fc598f Make __func__ and friends work correctly within the initializer for a static
local variable.

llvm-svn: 88766
2009-11-14 08:37:13 +00:00
Daniel Dunbar 1b39a2edff Shuffle VerifyDiagnosticsClient API to be less fragile.
llvm-svn: 88765
2009-11-14 07:53:24 +00:00
Daniel Dunbar 409e890f8d Add CompilerInstance::InitializeSourceManager.
llvm-svn: 88764
2009-11-14 07:53:04 +00:00
Eli Friedman a9ea959d04 PR5462: Don't run off the edge of the argument array for vararg handling
when there are more parameters in the prototype than arguments to the call.

llvm-svn: 88759
2009-11-14 04:43:10 +00:00
Daniel Dunbar 6c39d457fa Update FixIt tests to make it more obvious they use a separate mode.
llvm-svn: 88758
2009-11-14 04:39:42 +00:00
Daniel Dunbar 10563ea92e Turn -fixit it back into a mode, but make -fixit-at imply that mode this time
(instead of running it with arbitrary consumers).
 - Also, turn any -fixit-at lookup failure into an error.

llvm-svn: 88757
2009-11-14 04:39:29 +00:00
Eli Friedman b774685c08 Fix a couple of tests.
llvm-svn: 88756
2009-11-14 04:23:25 +00:00
Eli Friedman b572c92674 PR5483: Generate missing form of destructor when it is virtual. (Someone
more familiar with this stuff should double-check that there isn't some more
general rule; this is purely from inspecting g++ output.)

llvm-svn: 88755
2009-11-14 04:19:37 +00:00
Eli Friedman c9827d1ad3 Fix for PR5489: don't skip the complete type requrirement for variable
definitions just because the type happens to be an array type.

llvm-svn: 88752
2009-11-14 03:40:14 +00:00
Douglas Gregor bf3f322034 When type-checking a static cast (or the static_cast part of a C-style
cast) that is converting to a class type, enumerate its constructors
as in any other direct initialization. This ensures that we get the
proper conversion sequence.

llvm-svn: 88751
2009-11-14 03:27:21 +00:00
Daniel Dunbar 50ec0da0e1 Switch -verify implementation to use VerifyDiagnosticClient.
- Not tested, but -verify with multiple inputs should work now.

llvm-svn: 88750
2009-11-14 03:24:39 +00:00
Daniel Dunbar 9d5118a69c Fix broken tests, exposed by improved -verify.
llvm-svn: 88749
2009-11-14 03:24:04 +00:00
Daniel Dunbar 348185548e Add VerifyDiagnosticsClient, to replace old -verify.
- This reimplements -verify as just another DiagnosticClient, which buffers the diagnostics and checks them when the source file is complete. There are some hacks to make this work, but they are all internal, and this exposes a better external interface.

 - This also tweaks a few things:
   o Errors are now just regular diagnostics.
   o Frontend diagnostics are now caught (for example, errors in command line arguments), although there isn't yet a way to specify that they are expected. That would be nice though.

 - Not yet used.

llvm-svn: 88748
2009-11-14 03:23:19 +00:00
Anders Carlsson 654e5c7cf8 Diagnose ambiguity of operator delete and operator delete[]. Sebastian, please review.
llvm-svn: 88747
2009-11-14 03:17:38 +00:00
Daniel Dunbar e598a56d30 Pass Preprocessor through DiagnosticClient::BeginSourceFile.
llvm-svn: 88744
2009-11-14 02:48:04 +00:00
Daniel Dunbar 56d9c293db Add ASTConsumer to CompilerInstance.
llvm-svn: 88743
2009-11-14 02:47:17 +00:00
Fariborz Jahanian da2efb091d Generate the old API when sending message to super
in a category implementation (objc 32bit api related).

llvm-svn: 88741
2009-11-14 02:18:31 +00:00
Anders Carlsson 52ce3bbf57 Handle CXXDefaultArgExprs in EmitLValue. Fixes PR5484.
llvm-svn: 88735
2009-11-14 01:51:50 +00:00
Douglas Gregor ffe14e3712 If we attempt to add a constructor template specialization that looks
like a copy constructor to the overload set, just ignore it. This
ensures that we don't try to use such a constructor as a copy
constructor *without* triggering diagnostics at the point of
declaration.

Note that we *do* diagnose such copy constructors when explicitly
written by the user (e.g., as an explicit specialization).

llvm-svn: 88733
2009-11-14 01:20:54 +00:00
Daniel Dunbar bf410c6fc2 Add static version of Preprocessor::getSpelling.
llvm-svn: 88732
2009-11-14 01:20:48 +00:00
Daniel Dunbar e01dc86d2a Move CompilerInstance::set* methods out-of-line.
llvm-svn: 88731
2009-11-14 01:20:40 +00:00
Ted Kremenek 1a0dd2e30b Move definition of GRExprEngine::ProcessEndPath() out-of-line.
llvm-svn: 88729
2009-11-14 01:05:20 +00:00
Mike Stump 2ec5dd7160 Mangling support for typeinfo names.
llvm-svn: 88726
2009-11-14 00:14:13 +00:00
Douglas Gregor ff7028a55e Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this
llvm-svn: 88724
2009-11-13 23:59:09 +00:00
Mike Stump c5a332cefb Handle descructor printing better.
llvm-svn: 88723
2009-11-13 23:45:53 +00:00