summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [frontend] Add support for disabling the "inline" keyword using Chad Rosier2012-03-142-9/+11
| | | | | | | | | | | -fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
* modern objective-c translator: section info.Fariborz Jahanian2012-03-141-6/+57
| | | | | | and metadata for "non-lazy" class and categories. llvm-svn: 152751
* Instantiating a class template should not instantiate the definition of anyRichard Smith2012-03-147-119/+296
| | | | | | | | scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. llvm-svn: 152750
* '#if 0' out a variable that's only used in other preprocessor-disabled code.Matt Beaumont-Gay2012-03-141-0/+2
| | | | | | | (Why are we keeping all of this code around anyway? Say the word and I'll start swinging the delete hammer.) llvm-svn: 152749
* Provide -Wnull-conversion separately from -Wconversion.David Blaikie2012-03-141-0/+1
| | | | | | | | | | | | | Like GCC, provide a NULL conversion to non-pointer conversion as a separate flag, on by default. GCC's flag is "conversion-null" which we provide for cross compatibility, but in the interests of consistency (with -Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called -Wnull-conversion. Patch by Lubos Lunak. Review feedback by myself, Chandler Carruth, and Chad Rosier. llvm-svn: 152745
* objective-c modern tranaltor. More section info.Fariborz Jahanian2012-03-141-3/+44
| | | | | | for misc. objc meta-data. llvm-svn: 152743
* No longer defining LP64 in 64-bit builds on platforms which are not LP64.Aaron Ballman2012-03-141-2/+4
| | | | llvm-svn: 152740
* When emitting a diagnostic about two-phase name lookup, don't do uselessNick Lewycky2012-03-141-0/+3
| | | | | | qualified name lookups into transparent contexts. llvm-svn: 152739
* Fix dereference of end iterator. Spotted by ASan.Matt Beaumont-Gay2012-03-141-1/+3
| | | | llvm-svn: 152738
* [analyzer] Diagnostics: Supply Caller information even if the bug occursAnna Zaks2012-03-142-7/+12
| | | | | | in the callee. llvm-svn: 152734
* objective-c modern translator.Fariborz Jahanian2012-03-141-10/+12
| | | | | | | Add the _class_ro_t.reserved field for 64bit targets. // rdar://11040024 llvm-svn: 152731
* [Analyser] Remove unnecessary recursive visits for ExprWithCleanups andErik Verbruggen2012-03-142-24/+19
| | | | | | MaterializeTemporaryExpr. llvm-svn: 152730
* Minor cleanup in attribute-related diagnostics, from Alexander Kornienko!Douglas Gregor2012-03-141-14/+11
| | | | llvm-svn: 152725
* Parse brace initializers as default arguments. PR12236.Sebastian Redl2012-03-142-2/+11
| | | | llvm-svn: 152721
* [Analyser] Removes more recursive visitations in ExprEngine that are noErik Verbruggen2012-03-141-86/+10
| | | | | | longer needed as the CFG is fully linearized. llvm-svn: 152720
* [Sema] Fix SemaDiagnosticBuilder to be inline.Daniel Dunbar2012-03-141-39/+32
| | | | | | | | | | - As with DiagnosticBuilder, it is very important that SemaDiagnosticBuilder be completely inline to ensure that the compiler can rip it apart and sink it to registers. This is good for another 30k reduction in code size. llvm-svn: 152708
* Add support to mangle templated member function names with templateEric Christopher2012-03-141-1/+14
| | | | | | | | args. Fixes rdar://11042577 llvm-svn: 152691
* objective-c modern rewriter. Do not add _class_ro_t.reserved Fariborz Jahanian2012-03-131-2/+4
| | | | | | field. // rdar://11040024 llvm-svn: 152685
* [driver] Clang should report an error for -faltivec on non-ppc.Chad Rosier2012-03-131-0/+8
| | | | | | rdar://10963572 llvm-svn: 152684
* When adding member functions to a class add any specializations ofEric Christopher2012-03-131-9/+22
| | | | | | | | | | | function templates as well. A future commit will mangle the added name with the template args like classes are mangled. Fixes rdar://10986010 llvm-svn: 152683
* [analyser] Refactor shouldInline logic into a helper.Anna Zaks2012-03-131-8/+19
| | | | llvm-svn: 152677
* [analyzer] Call enter/exit diagnostic should refer to caller/callee,Anna Zaks2012-03-131-8/+6
| | | | | | respectively. llvm-svn: 152676
* [Basic] Fix up DiagnosticBuilder::{FlushCounts,Emit} to be inline.Daniel Dunbar2012-03-131-23/+6
| | | | | | | | | | | | | | | | - This is much more important than it appears at first glance... The intended design of DiagnosticBuilder was that it never escape and that all its members would get lowered to registers by the compiler. By fixing Emit here, the compiler can completely eliminate the DiagnosticBuilder object and never need to push those registers back into it. Unfortunately, Sema has broken DiagnosticBuilder in other ways (by introducing SemaDiagnosticBuilder), so we don't get the fill impact of this, but it is still good for 30k reduction in code size. I'll work on fixing the SemaDiagnosticBuilder problems next. llvm-svn: 152669
* Allow vectors to be constructed from constexpr function arguments inRichard Smith2012-03-131-2/+2
| | | | | | constant expressions. llvm-svn: 152665
* [driver] Parse diagnostic args in the driver.Chad Rosier2012-03-132-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | Previously, only diagnostics thrown by the cc1 process were actually honoring the diagnostic options given on the command line, like -Werror. Reuse the existing code in Frontend currently used for cc1, adjusting it to not interpret -Wl, linker flags as warnings. Also fix a faulty test exposed by this change. It wasn't actually testing anything, and was giving this warning: clang-3: warning: argument unused during compilation: '-verify' Which -Werror didn't turn into an error because it was output by the driver, not the cc1 process, and diagnostic options weren't parsed by the driver. And you couldn't see the warning when running the test suite. Fixes PR12181. Patch by Dylan Noblesmith <nobled@dreamwidth.org>. llvm-svn: 152660
* [analyzer] Change the order in which we analyze the functions underAnna Zaks2012-03-131-7/+11
| | | | | | | | | | | inlining to be the reverse of their declaration. This optimizes running time under inlining up to 20% since we do not re-analyze the utility functions which are usually defined first in the translation unit if they have already been analyzed while inlined into the root functions. llvm-svn: 152653
* [analyzer] Use BFS over call graph when analysing functions.Anna Zaks2012-03-131-22/+38
| | | | | | | | | | | BFS should give slightly better performance. Ex: Suppose, we have two roots R1 and R2. A callee function C is reachable through both. However, C is not inlined when analyzing R1 due to inline stack depth limit. With DFS, C will be analyzed as top level even though it would be analyzed as inlined through R2. On the other hand, BFS could avoid analyzing C as top level. llvm-svn: 152652
* [analyzer] Refactor CallGraph to use Recursive AST visitor whenAnna Zaks2012-03-132-42/+37
| | | | | | collecting function Decls. llvm-svn: 152651
* [analyzer] Use recursive AST visitor to drive simple visitation order inAnna Zaks2012-03-131-106/+95
| | | | | | | | | | | | | AnalysisConsumer. As a result: - We now analyze the C++ methods which are defined within the class body. These were completely skipped before. - Ensure that AST checkers are called on functions in the order they are defined in the Translation unit. llvm-svn: 152650
* [analyzer] Minor: factor out logic for determining if we should skip aAnna Zaks2012-03-131-4/+13
| | | | | | function. llvm-svn: 152649
* [analyzer] Move the check for parser errors out of the loop over Decls.Anna Zaks2012-03-131-5/+5
| | | | llvm-svn: 152648
* Fix the long double to be of width/align 64. Rename va_list_test toRoman Divacky2012-03-131-2/+6
| | | | | | powerpc_types and add testing for the (long) double there. llvm-svn: 152647
* Spelling.Daniel Dunbar2012-03-131-1/+1
| | | | llvm-svn: 152644
* [Basic] Stop using a SmallVector<> for Diagnostic. This drops Clang binary sizeDaniel Dunbar2012-03-131-3/+6
| | | | | | | | | | by ~%.3/~100k in my build -- simply by eliminating the horrible code bloat coming from the .clear() of the SmallVector<FixItHint>, which does a std::~string, etc. - My understanding is we don't ever emit arbitrary numbers of fixits, so I just moved us to using a statically sized array like we do for arguments and ranges. llvm-svn: 152639
* Remove unused-but-set variable.Benjamin Kramer2012-03-131-5/+3
| | | | llvm-svn: 152633
* Long double is just double on FreeBSD/{PPC,PPC64}.Roman Divacky2012-03-131-0/+6
| | | | llvm-svn: 152632
* Tweak linkage order for solaris.David Chisnall2012-03-131-1/+2
| | | | llvm-svn: 152627
* Ensure that default arguments are handled correctly in sub scopes. For example:James Molloy2012-03-132-11/+22
| | | | | | | | | | | | | void f () { int g (int a, int b=4); { int g(int a, int b=5); } } should compile. llvm-svn: 152621
* Implement [temp.param]p5: the top-level cv-qualifiers on a non-type templateRichard Smith2012-03-131-2/+6
| | | | | | parameter's declaration are ignored when determining the parameter's type. llvm-svn: 152619
* PR11850 + duplicates: don't assume that a function parameter pack expansion isRichard Smith2012-03-131-11/+14
| | | | | | at the end of the parameter list. llvm-svn: 152618
* PR11925: A function can't have a variably-modified return type. Not even in C++.Richard Smith2012-03-131-11/+12
| | | | llvm-svn: 152615
* It never makes sense to do a lookup into a LinkageSpecDecl, so assert that weNick Lewycky2012-03-133-9/+9
| | | | | | | | | don't, and clean up the places that do it. The change to ASTWriter is surprising, but the deleted code is a no-op as of r152608. llvm-svn: 152609
* Fix PR10447: lazily building name lookup tables for DeclContexts was broken.Richard Smith2012-03-138-108/+76
| | | | | | | | | | | | | | | | | | | | | | | The deferred lookup table building step couldn't accurately tell which Decls should be included in the lookup table, and consequently built different tables in some cases. Fix this by removing lazy building of DeclContext name lookup tables. In practice, the laziness was frequently not worthwhile in C++, because we performed lookup into most DeclContexts. In C, it had a bit more value, since there is no qualified lookup. In the place of lazy lookup table building, we simply don't build lookup tables for function DeclContexts at all. Such name lookup tables are not useful, since they don't capture the scoping information required to correctly perform name lookup in a function scope. The resulting performance delta is within the noise on my testing, but appears to be a very slight win for C++ and a very slight loss for C. The C performance can probably be recovered (if it is a measurable problem) by avoiding building the lookup table for the translation unit. llvm-svn: 152608
* [libclang] When there's a file error when saving the PCH, make sure toArgyrios Kyrtzidis2012-03-131-1/+3
| | | | | | | | clear the error from raw_fd_ostream, otherwise we will crash. rdar://10976410 llvm-svn: 152605
* [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() ↵Argyrios Kyrtzidis2012-03-134-19/+14
| | | | | | | | | iterators instead of ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use even if the caller did not check that the interface is a definition. llvm-svn: 152597
* Fix crash at @implementation with a forward reference as base class.Argyrios Kyrtzidis2012-03-131-0/+2
| | | | | | rdar://11020003 llvm-svn: 152596
* Alternate fix to PR12248: put Sema in charge of special-casingJohn McCall2012-03-132-15/+37
| | | | | | | | | the diagnostic for assigning to a copied block capture. This has the pleasant side-effect of letting us special-case the diagnostic for assigning to a copied lambda capture as well, without introducing a new non-modifiable enumerator for it. llvm-svn: 152593
* [msvc] Honor %INCLUDE%. It should know essential search paths with ↵NAKAMURA Takumi2012-03-131-1/+17
| | | | | | | | | | | | | | | | | | | | | vcvarsall.bat. FYI, On VS10, %INCLUDE% contains; (VS10)\VC\INCLUDE (VS10)\VC\ATLMFC\INCLUDE (SDK70A)\include On VS11, (VS11)\VC\INCLUDE (VS11)\VC\ATLMFC\INCLUDE (SDK80)\include\shared (SDK80)\include\um (SDK80)\include\winrt FIXME: It may be enabled also on mingw. llvm-svn: 152589
* modern objective-c translator. @try/@catch translation. wip.Fariborz Jahanian2012-03-121-159/+10
| | | | llvm-svn: 152587
* Add new analyzer diagnostic mode where plists can have bugs that span ↵Ted Kremenek2012-03-121-2/+15
| | | | | | multiple files. llvm-svn: 152586
OpenPOWER on IntegriCloud