Commit Graph

18372 Commits

Author SHA1 Message Date
Douglas Gregor f09935f16c Switch the clang-to-CIndex interface for code-completion to a binary format, for a massive speedup
llvm-svn: 90209
2009-12-01 05:55:20 +00:00
Eric Christopher c377c81dcf Update for llvm intrinsics change.
llvm-svn: 90208
2009-12-01 05:00:51 +00:00
Mike Stump 5406614be9 Much work on try/catch statement. WIP.
Highlights include:

  Fix __cxa_begin_catch so it now returns a value.
  Added getUnwindResumeOrRethrowFn helper to build up calls to
  _Unwind_Resume_or_Rethrow.
  Broke out object copying code into CopyObject from EmitCXXThrowExpr.
  Built up another version of CopyObject that can copy from memory for
  use in the catch parameter code.
  RTTI generation for type matching for catch.
  Code to check for the type match for catch.
  Code to generate the catch parameter, WIP, need make sure references
  and pointers and copy ctors work.

llvm-svn: 90205
2009-12-01 03:41:18 +00:00
Douglas Gregor 8f184a31d0 Eliminate warning in Release-Asserts mode. No functionality change
llvm-svn: 90204
2009-12-01 03:34:29 +00:00
Daniel Dunbar c70c39300f clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

llvm-svn: 90198
2009-12-01 03:16:53 +00:00
Daniel Dunbar 9110165da9 Add a very minimal README.txt for examples/PrintFunctionNames.
llvm-svn: 90197
2009-12-01 03:15:49 +00:00
Daniel Dunbar 079203fa16 CIndex: Normalize formatting some more.
llvm-svn: 90196
2009-12-01 03:14:51 +00:00
Zhongxing Xu 1bd5823300 Clean up BuiltinBug class.
llvm-svn: 90195
2009-12-01 03:06:19 +00:00
Daniel Dunbar 5442bfcd5a c-index-test: Split "function scanning" behavior into its own "filter" -- its
quite slow and doesn't really stress the APIs people should really use.
 - I'm not even sure if this mode is still useful given the other scanning mode;
   Steve?

llvm-svn: 90193
2009-12-01 02:35:37 +00:00
Daniel Dunbar 3e535d7efa Add c-index-test -test-load-source, which loads the translation unit from a source file (and other command line arguments).
llvm-svn: 90187
2009-12-01 02:03:10 +00:00
Ted Kremenek f8c12a3039 Allocate MultipleDC objects using the allocator associated with
ASTContext instead of malloc.  Besides reducing malloc traffic, this
also removes a source of memory leaks when using a BumpPtrAllocator
for the allocator of ASTContext.  There are still leaks when using
MallocAllocator because Decl::Destroy() isn't fully finished.

Fixes: <rdar://problem/7431556>
llvm-svn: 90174
2009-12-01 00:07:10 +00:00
John McCall f786fb13f5 Fix and test for a problem caught by the clang-on-clang buildbot: qualified
IDs in dependent contexts are not dependent if the context names a namespace.

llvm-svn: 90171
2009-11-30 23:50:49 +00:00
Anders Carlsson b1d3f7c909 Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.
llvm-svn: 90168
2009-11-30 23:41:22 +00:00
John McCall 132f3133ae Remove all of Sema's explicit uses of OverloadedFunctionDecl except for
those associated with TemplateNames.

llvm-svn: 90162
2009-11-30 22:55:35 +00:00
John McCall 10eae1851d Eliminate the use of OverloadedFunctionDecl in member expressions.
Create a new UnresolvedMemberExpr for these lookups.  Assorted hackery
around qualified member expressions;  this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.

llvm-svn: 90161
2009-11-30 22:42:35 +00:00
Fariborz Jahanian b0cd26ad21 Test for my last patch.
llvm-svn: 90159
2009-11-30 22:07:56 +00:00
Fariborz Jahanian be64149749 More support for virtual destructor calls.
Fixes pr5619

llvm-svn: 90158
2009-11-30 22:07:18 +00:00
Anders Carlsson 26a807d37a When we're trying to define an implicit virtual destructor, make sure that we have a valid delete operator.
llvm-svn: 90156
2009-11-30 21:24:50 +00:00
Daniel Dunbar 5b2f5cadbd Reindent buffer, switches in particular were totally out of style.
llvm-svn: 90155
2009-11-30 20:42:49 +00:00
Daniel Dunbar bbc569ce8d Strip trailing space.
llvm-svn: 90154
2009-11-30 20:42:43 +00:00
Mike Stump 21d68e2435 Add const to accessors that don't modify the object.
llvm-svn: 90153
2009-11-30 20:10:58 +00:00
Mike Stump e5311b0d79 Reflow comments and fix 80-col violation.
llvm-svn: 90152
2009-11-30 20:08:49 +00:00
Daniel Dunbar 441e3729a5 Add missing assignment operator to test, and add tests for while loops and for
loops (including temporaries inside the initializers).

llvm-svn: 90151
2009-11-30 20:00:35 +00:00
Anders Carlsson c920fa2a74 Fix an assert.
llvm-svn: 90149
2009-11-30 19:43:26 +00:00
Fariborz Jahanian 89b660c774 Fix a crash when ivar type is a __strong SEL. Fallout from
recent change to make SEL a builtin type (fixes radar 7425510).

llvm-svn: 90145
2009-11-30 18:43:52 +00:00
Daniel Dunbar 7bd1048f26 Add more sophisticated test for destruction order of C++ temporaries, please
feel free to extend!

llvm-svn: 90143
2009-11-30 18:17:34 +00:00
Benjamin Kramer 5f089128e9 Use StringRef in Attr constructors.
llvm-svn: 90140
2009-11-30 17:08:26 +00:00
Douglas Gregor 693ba203a1 Eliminate another VISIBILITY_HIDDEN
llvm-svn: 90139
2009-11-30 16:08:24 +00:00
Tobias Grosser 9fc223a6b1 Adapt to the DOTGraphTraits changes in LLVM.
llvm-svn: 90137
2009-11-30 14:16:05 +00:00
Daniel Dunbar bd74028095 clang-cc: Add code (currently disabled) for parsing arguments using clang -cc1 functionality instead of LLVM's CommandLine.
- It works and passes test suite, but I want to polish and test a wee bit more before making the switch.

llvm-svn: 90128
2009-11-30 08:42:10 +00:00
Daniel Dunbar a74f8ff15c Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.
llvm-svn: 90127
2009-11-30 08:42:00 +00:00
Daniel Dunbar 91dea8252a clang -cc1: Fix initialization of PreprocessorOptions::TokenCache.
llvm-svn: 90126
2009-11-30 08:41:42 +00:00
Daniel Dunbar 05762b1344 Add TextDiagnosticBuffer::FlushDiagnostics, for forwarding the buffered diagnostics to a different diagnostics engine.
llvm-svn: 90125
2009-11-30 08:41:34 +00:00
Daniel Dunbar 8c317acd2b clang -cc1: Fix -include-pch now that the test code is in clang-cc.
llvm-svn: 90124
2009-11-30 08:41:22 +00:00
Daniel Dunbar 599abb2d56 clang -cc1: Initialize LangOptions::{Optimize,NoInline}
llvm-svn: 90123
2009-11-30 08:41:13 +00:00
Daniel Dunbar 7c71b6b95b Use '-FOO' 'BAR' instead of '-FOO=BAR' in tests.
llvm-svn: 90122
2009-11-30 08:41:04 +00:00
Daniel Dunbar 84bb793718 Always pass -fmessage-length using separate arguments.
llvm-svn: 90121
2009-11-30 08:40:54 +00:00
Daniel Dunbar 0429c5ef3a clang -cc1: Initialize LangOptions::DollarIdents correctly.
llvm-svn: 90120
2009-11-30 08:40:46 +00:00
Daniel Dunbar 2c11cd156e Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
llvm-svn: 90119
2009-11-30 08:40:34 +00:00
Daniel Dunbar 8e70505692 Eliminate CodeGenOptions::TimePasses.
llvm-svn: 90118
2009-11-30 08:39:52 +00:00
Daniel Dunbar de18224d9c Eliminate CodeGenOptions::SimplifyLibCalls.
llvm-svn: 90117
2009-11-30 08:39:32 +00:00
Daniel Dunbar fe994279ad Simplify.
llvm-svn: 90115
2009-11-30 07:18:20 +00:00
Daniel Dunbar 1c39f3c89d Put CompilerInvocation testing code in clang-cc instead of clang for now, I can't bear to link all of clang into 'clang' yet. :)
- Still triggered by a magic leading -cc1 argument, as before.

llvm-svn: 90114
2009-11-30 07:18:13 +00:00
Chris Lattner 710bb87147 Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails.  In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'

instead of "cannot find file".

llvm-svn: 90110
2009-11-30 04:18:44 +00:00
Eli Friedman 03aa2f1262 Minor cleanup (no functionality change).
llvm-svn: 90105
2009-11-30 01:19:33 +00:00
Daniel Dunbar 0ac66427a9 clang -cc1: Use proper diagnostics for all parsing errors.
llvm-svn: 90100
2009-11-29 21:52:53 +00:00
Daniel Dunbar c76493a65d Don't pass false (default) for isVolatile parameter to CreateLoad.
llvm-svn: 90098
2009-11-29 21:23:36 +00:00
Daniel Dunbar 1dd0164bbe Explicitly use setVolatile instead of extra IRBuilder argument.
llvm-svn: 90095
2009-11-29 21:11:47 +00:00
Daniel Dunbar dacbe6bdcd Don't pass false (default) for isVolatile parameter to CreateStore.
llvm-svn: 90094
2009-11-29 21:11:41 +00:00
Daniel Dunbar fcb9caa772 Change CompilerInvocation::CreateFromArgs to report errors using a proper diagnostic engine.
- Clients that care about having the diagnostics output honor the user-controllable diagnostic options can buffer the diagnostics and issue them later.

llvm-svn: 90092
2009-11-29 20:58:50 +00:00
Daniel Dunbar ecd0444e8c Simplify.
llvm-svn: 90091
2009-11-29 20:58:39 +00:00
Daniel Dunbar 65ca1c6f02 Change CompilerInvocation::CreateFromArgs to take Argv0 and the address of main (or something in the main executable) so it can find the builtin compiler files.
llvm-svn: 90090
2009-11-29 20:58:32 +00:00
Benjamin Kramer b33a97c384 Remove useless c_str() calls in SemaCodeComplete.
llvm-svn: 90088
2009-11-29 20:18:50 +00:00
Benjamin Kramer ba9fd986eb Simplify code. No functionality change.
llvm-svn: 90087
2009-11-29 19:51:45 +00:00
Benjamin Kramer 6341553c93 Port BugReporter and BugType to StringRef.
llvm-svn: 90086
2009-11-29 18:27:55 +00:00
Benjamin Kramer ff3750f306 Kill some unnecessary calls to c_str().
llvm-svn: 90084
2009-11-29 18:03:28 +00:00
Kovarththanan Rajaratnam d6ee467473 Kill off clang/win32 which contains the hand generated Visual Studio project files. These files are severely out of date and have been superseded by the CMake build system. RIP.
llvm-svn: 90081
2009-11-29 17:13:54 +00:00
Nuno Lopes 0e5d13e025 remove stall comment
llvm-svn: 90080
2009-11-29 17:07:16 +00:00
Kovarththanan Rajaratnam 130f7f9629 Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No functionality change.
llvm-svn: 90078
2009-11-29 14:54:35 +00:00
Kovarththanan Rajaratnam 09282c91d9 Don't call Decl::CollectingStats(false) and Stmt::CollectingStats(false). When called with false these functions return whether statistics are enabled. They don't change any state. Since we're not using the return value avoid calling them in the first place.
llvm-svn: 90077
2009-11-29 14:50:29 +00:00
Kovarththanan Rajaratnam 5505dff8af This patch moves the frontend timer from clang-cc into CompilerInstance.
CompilerInstance already contains various objects that are used
throughout the entire run.

Also addresses Daniels review comments in:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/024508.html

llvm-svn: 90073
2009-11-29 09:57:35 +00:00
Daniel Dunbar e97582406b Use '-FOO' 'BAR' instead of '-FOO=BAR' for FOO in -stack-protector, -fvisibility, and -fconstant-string-class.
llvm-svn: 90072
2009-11-29 09:33:20 +00:00
Daniel Dunbar 4e7596cc3a Normalize options to use '-FOO' instead of '--FOO'.
llvm-svn: 90071
2009-11-29 09:33:10 +00:00
Daniel Dunbar be95682389 Remove unnecessary -fblocks=0.
llvm-svn: 90070
2009-11-29 09:32:38 +00:00
Daniel Dunbar f4a72b06c2 Use '-x' 'foo' instead of '-x=foo'.
llvm-svn: 90069
2009-11-29 09:32:31 +00:00
Daniel Dunbar 21749853bf clang -cc1: Allow -triple= as an alias for -triple, -code-compiletion-at= as an alias for -code-completion-at, and spell "-std=" option correctly.
llvm-svn: 90068
2009-11-29 09:32:20 +00:00
Daniel Dunbar a12113c789 Use '-o' '-' instead of '-o=-' in tests.
llvm-svn: 90067
2009-11-29 09:32:12 +00:00
Daniel Dunbar 7427fe28dc Remove unnecessary -fms-extensions=0 from tests (this command line syntax is going away).
llvm-svn: 90066
2009-11-29 09:31:53 +00:00
Alexis Hunt 3d221f2fce Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.

llvm-svn: 90064
2009-11-29 07:34:05 +00:00
Daniel Dunbar a1b02a2380 Move LLVM backend options to explicit clang-cc / clang -cc1 options, which we then manually pass to the command line library; eventually the latter grossness should be fixed by a real API when creating the target machine.
llvm-svn: 90063
2009-11-29 07:18:39 +00:00
Ted Kremenek 8404b5485a Update checker build.
llvm-svn: 90062
2009-11-29 06:48:25 +00:00
Ted Kremenek 33e88a7be7 Fix null dereference in UndefResultChecker identified by running the analyzer over Postgresql.
llvm-svn: 90060
2009-11-29 06:37:44 +00:00
Daniel Dunbar 0317c4c5b7 Add clang -cc1 parsing for LangOptions.
- This is the last major parsing piece, main FIXMEs remain.

llvm-svn: 90059
2009-11-29 05:52:21 +00:00
Daniel Dunbar 34c82c5695 clang-cc: Tweak LangOptions parsing to make it a bit more obvious what depends on what.
llvm-svn: 90058
2009-11-29 03:18:48 +00:00
Alexis Hunt 8818b42db0 Fix 80-cols violations
llvm-svn: 90057
2009-11-29 03:04:53 +00:00
Daniel Dunbar 5fe0866b9d clang-cc: Change -fsigned-char=0 to -fno-unsigned-char and pass -pic-level using separate args.
llvm-svn: 90054
2009-11-29 02:39:08 +00:00
Daniel Dunbar 6e227ca836 Add missing accessors.
llvm-svn: 90053
2009-11-29 02:38:55 +00:00
Daniel Dunbar 75fa84ebc6 Change LangOptions::ObjCConstantStringClass to an std::string to avoid worrying about the lifetime.
llvm-svn: 90052
2009-11-29 02:38:47 +00:00
Daniel Dunbar 9eac065e67 Move MainFileName option variable into CodeGenOptions instead of LangOptions.
llvm-svn: 90051
2009-11-29 02:38:34 +00:00
Benjamin Kramer 337e3a5fea Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
llvm-svn: 90044
2009-11-28 19:45:26 +00:00
Benjamin Kramer 26222b666c Remove VISIBILITY_HIDDEN from lib/AST.
llvm-svn: 90043
2009-11-28 19:03:38 +00:00
Kovarththanan Rajaratnam 7632da4b8a This patch adds a PUNCTUATOR macro (specialization of TOK) in TokenKinds.def and makes use of it in tok::getTokenSimpleSpelling.
llvm-svn: 90042
2009-11-28 16:09:28 +00:00
Kovarththanan Rajaratnam 930de0aeaf Cleanup llvm/Support/Compiler.h include in header files
llvm-svn: 90040
2009-11-28 16:08:10 +00:00
Nuno Lopes baa1bc44af cleanup parsing of MS integer suffixes a little. this fixes PR5616
btw, I believe that isMicrosoftInteger can go away; it's not read anywhere

llvm-svn: 90036
2009-11-28 13:37:52 +00:00
Benjamin Kramer 92096cb11f Missed a forward declaration.
llvm-svn: 90035
2009-11-28 12:08:44 +00:00
Benjamin Kramer 4e75cd063f Cleanup includes and forward decls.
llvm-svn: 90034
2009-11-28 10:50:44 +00:00
Benjamin Kramer 16634c2c5a Remove VISIBILITY_HIDDEN from anonymous namespaces in libFrontend.
llvm-svn: 90033
2009-11-28 10:07:24 +00:00
Benjamin Kramer 435ef9b383 Remove unneeded includes.
llvm-svn: 90032
2009-11-28 09:41:31 +00:00
Kovarththanan Rajaratnam b1034f7a24 Don't call exit(). llvm::llvm_report_error() will do just that
llvm-svn: 90031
2009-11-28 09:11:46 +00:00
Alexis Hunt ed0530f694 Fix test and handle IK_LiteralOperatorId in a few more places.
llvm-svn: 90030
2009-11-28 08:58:14 +00:00
Kovarththanan Rajaratnam 15e9a9df83 Move program actions implications to clang::InitializeFrontendOptions which already contains such logic.
llvm-svn: 90029
2009-11-28 07:52:34 +00:00
Kovarththanan Rajaratnam 65c6566b5b lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespace
llvm-svn: 90028
2009-11-28 06:07:30 +00:00
Alexis Hunt 344585006c Add Parser support for C++0x literal operators ('operator "" i').
DeclarationName can't handle them yet, so right now Parser just errors out on them.

llvm-svn: 90027
2009-11-28 04:44:28 +00:00
Eli Friedman c9e3e6ff29 Tests now pass with the assertion.
llvm-svn: 90026
2009-11-28 03:35:45 +00:00
Eli Friedman 78910a508a Add a much more thorough test of casts to virtual bases, and fix
GetCXXBaseClassOffset to actually pass the test.

llvm-svn: 90025
2009-11-28 03:31:34 +00:00
Anders Carlsson 548cc9d143 We always want to create a virtual function pointer entry if the path from the derived return value to the base overridden return value contains a virtual base class.
llvm-svn: 90024
2009-11-28 03:03:52 +00:00
Anders Carlsson 182498df65 Add an iterator for walking the primary base chain.
llvm-svn: 90023
2009-11-28 00:50:23 +00:00
Anders Carlsson d598850203 Move the vtable builder to an anonymous namespace.
llvm-svn: 90021
2009-11-27 22:21:51 +00:00
Anders Carlsson a30c0d3ace Use a PointerIntPair for the PrimaryBaseInfo. Yay for clever LLVM data structures!
llvm-svn: 90020
2009-11-27 22:14:40 +00:00
Anders Carlsson 03ff379911 Add a new PrimaryBaseInfo struct that combines the record decl of a primary base with whether it's virtual or not.
llvm-svn: 90018
2009-11-27 22:05:05 +00:00