Commit Graph

10158 Commits

Author SHA1 Message Date
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
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 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
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 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 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 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 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
Anders Carlsson f942ee0297 Don't build the entire vtable when all we want is the index of a virtual method.
llvm-svn: 90017
2009-11-27 20:47:55 +00:00
Eli Friedman 7eb0ccaa58 Add case for CK_DerivedToBaseMemberPointer cast kind to
AggExprEmitter::VisitCastExpr.

llvm-svn: 89988
2009-11-27 04:46:20 +00:00
Eli Friedman e96f1d3b2f More work on ScalarExprEmitter::EmitCastExpr: for every cast kind, either
implement it explicitly or assert that it doesn't make sense for a scalar.
This caught a couple interesting issues: one, CK_BaseToDerivedMemberPointer
casts were getting silently miscompiled, and two, Sema was constructing some
strange implicit casts of type CK_UserDefinedConversion.

The change in SemaExprCXX makes sure the cast kinds are getting set correctly.

llvm-svn: 89987
2009-11-27 04:41:50 +00:00
Eli Friedman 0dfc6804ff Cleanup for ScalarExprEmitter::EmitCastExpr; no functional changes.
llvm-svn: 89986
2009-11-27 02:07:44 +00:00
Eli Friedman 250534cf9a Fix for PR5594: use EmitGlobalDefinition instead of EmitCXXDestructor so that
we check whether the vtable needs to be generated.

llvm-svn: 89984
2009-11-27 01:42:12 +00:00
Anders Carlsson 5a4f772bc8 Fix thinko.
llvm-svn: 89983
2009-11-27 01:26:58 +00:00
Anders Carlsson 859d7bf2f5 When adding an implicit destructor, make sure to mark it as virtual if it overrides existing destructors.
llvm-svn: 89967
2009-11-26 21:25:09 +00:00
Anders Carlsson e985faea49 Correctly find overridden destructors.
llvm-svn: 89966
2009-11-26 20:50:40 +00:00
Anders Carlsson 323bb04ef4 Lazily create the __cxa_pure_virtual reference.
llvm-svn: 89965
2009-11-26 19:54:33 +00:00
Anders Carlsson d420a31fe9 Use the new CovariantThunkAdjustment in the vtable builder.
Make the pure virtual methods map a set instead.

llvm-svn: 89961
2009-11-26 19:32:45 +00:00
Gabor Greif d2add35d9d typo
llvm-svn: 89949
2009-11-26 15:18:50 +00:00
Gabor Greif 40762fec73 issue a friendlier error if someone tries to send precompiled header to '-' (stdout)
this brings the error on
  clang -c foo.h -o -
closer to
  clang -c foo.h -o /dev/null

llvm-svn: 89948
2009-11-26 14:35:28 +00:00
Benjamin Kramer 334af99964 Remove dead forward declaration. Fix struct/class mismatch. Remove trailing whitespace.
llvm-svn: 89947
2009-11-26 13:09:03 +00:00
Daniel Dunbar 7ab5c491c1 Remove header which is bringing libAST in (on MSVC).
llvm-svn: 89946
2009-11-26 09:57:25 +00:00
Eli Friedman 4907c6f2ed Remove unused variable.
llvm-svn: 89945
2009-11-26 07:48:44 +00:00
Eli Friedman ffc066f4b9 Shortcut explicit calls to a trivial copy assignment operator.
llvm-svn: 89944
2009-11-26 07:45:48 +00:00
Eli Friedman 84a7e347bf Simplify and fix up the handling of implicit constructors, copy assignment
operators, and destructors.  Avoids generating declarations/definitions of
trivial constructors/destructors, and makes sure the trivial copy assignment
operator is generated when necessary.

llvm-svn: 89943
2009-11-26 07:40:08 +00:00
Ted Kremenek 2350e0c3ba Improve diagnostics in ReturnStackAddressChecker for returning a stack-allocated block. Implements the rest of <rdar://problem/7387385>.
llvm-svn: 89940
2009-11-26 07:14:50 +00:00
Eli Friedman d15eb34d4b Implement IRGen for MemberExpr referring to static member function.
llvm-svn: 89938
2009-11-26 06:08:14 +00:00
Anders Carlsson 6d771bcd09 Add a Thunk struct to the vtable builder.
llvm-svn: 89935
2009-11-26 03:25:13 +00:00
Eli Friedman cb422f1dbe Use the more general Evaluate infrastructure for folding constant DeclRefs
instead of checking explicitly for an EnumConstantDecl.  This folds references
to constant integer VarDecls, which has two benefits:

1. Slightly smaller emitted code from emitting a constant instead of a load,
and skipping emitting some constant globals.
2. Some code forgets to define static constant member variables; emitting a
load instead of the value in that case leads to a link error. (Such programs
are technically not well-formed, but in practice build with g++.)

llvm-svn: 89934
2009-11-26 03:22:21 +00:00
Anders Carlsson 2f87c4f1a5 Add a CovariantThunkAdjustment struct that represents the adjustments needed for a covariant thunk.
llvm-svn: 89933
2009-11-26 03:09:37 +00:00