aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
AgeCommit message (Collapse)Author
2012-10-15Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.Nico Weber
See PR14013. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15[ms-inline asm] Rework the front-end to use the API introduced in r165946.Chad Rosier
-The front-end now builds a single assembly string and feeds it to the AsmParser. The front-end iterates on a per statement basis by calling the ParseStatement() function. Please note, the calling of ParseStatement() and and any notion of MCAsmParsedOperands will be sunk into the MC layer in the near future. I plan to expose more basic APIs such as getClobbers, etc. -The enumeration of the AsmString expressions have been reworked to use SMLocs rather than assembly Pieces, which were being parsed in the front-end. -The test case, t8(), was modified due to r129223. I'll have to find a way to work around things such as these. Sorry for the large commit, but breaking this in multiple smaller commits proved too irritating. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-13Update for r165858.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165859 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12[ms-inline asm] Remove a bunch of parsing code from the front-end.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Make -mms-bitfields behave consistently.Eli Friedman
Patch by Jeremiah Zanin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Update for r165833.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165834 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Fix warnings introduced by r165826.DeLesley Hutchins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Thread-safety analysis: support multiple thread-safety attributes onDeLesley Hutchins
declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12[ms-inline asm] Remove a bunch of parsing code from the front-end, which will beChad Rosier
reimplemented in the AsmParser where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Fix typo correction of one qualified name to another.David Blaikie
When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken. This corrects that replacement in as many places as I could find & provides test cases for all those cases I could find a test case for. There are a couple that don't seem to be reachable (one looks entirely dead, the other just doesn't seem to ever get called with a namespace to namespace change). Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165817 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Change (!ptr != 0) to (!ptr) to make the code more readable.Richard Trieu
No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165811 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Remove unused variable.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Remove dead code introduced in r165751.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165772 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Provide a fixit when taking the address of an unqualified member function.David Blaikie
This only applies if the type has a name. (we could potentially do something crazy with decltype in C++11 to qualify members of unnamed types but that seems excessive) It might be nice to also suggest a fixit for "&this->i", "&foo->i", and "&foo.i" but those expressions produce 'bound' member functions that have a different AST representation & make error recovery a little trickier. Left as future work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165763 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11[ms-inline asm] Remove a bunch of parsing code from the front-end, which will beChad Rosier
reimplemented in the AsmParser where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11[ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove theChad Rosier
now unused static helper function. The test case needs to be remove temporarily until I can better filter memory operands that aren't actual variable reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165751 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Add null check for malformed code.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165733 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.Jordan Rose
Fix-up for r165718, should get the buildbots back online. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165723 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.Jordan Rose
This is a "safe" pattern, or at least one that cannot be helped by using a strong local variable. However, if the single read is within a loop, it should /always/ be treated as potentially dangerous. <rdar://problem/12437490> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165719 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11-Warc-repeated-use-of-weak: Check messages to property accessors as well.Jordan Rose
Previously, [foo weakProp] was not being treated the same as foo.weakProp. Now, for every explicit message send, we check if it's a property access, and if so, if the property is weak. Then for every assignment of a message, we have to do the same thing again. This is a potentially expensive increase because determining whether a method is a property accessor requires searching through the methods it overrides. However, without it -Warc-repeated-use-of-weak will miss cases from people who prefer not to use dot syntax. If this turns out to be too expensive, we can try caching the result somewhere, or even lose precision by not checking superclass methods. The warning is off-by-default, though. <rdar://problem/12407765> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165718 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Add codegen support for __uuidof().Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165710 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Minor cleanup for r165678; no functional change.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165679 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Make sure we perform the variadic method check correctly for calls to a ↵Eli Friedman
member operator(). PR14057. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10-Warc-repeated-use-of-weak: look through explicit casts on assigned values.Jordan Rose
Reading from a weak property, casting the result, and assigning to a strong pointer should still be considered safe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165629 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.Jordan Rose
Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl (the latter by name) over to findPropertyDecl. This actually makes -Wreceiver-is-weak a bit stronger than it was before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165628 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10Change Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.Jordan Rose
Old algorithm: 1. See if the name looks like a getter or setter. 2. Use the name to look up a property in the current ObjCContainer and all its protocols. 3. If the current container is an interface, also look in all categories and superclasses (and superclass categories, and so on). New algorithm: 1. See if the method is marked as a property accessor. If so, look through all properties in the current container and find one that has a matching selector. 2. Find all overrides of the method using ObjCMethodDecl's getOverriddenMethods. This collects methods in superclasses and protocols (as well as superclass categories, which isn't really necessary), and checks if THEY are accessors. This part is not done recursively, since getOverriddenMethods is already recursive. This lets us handle getters and setters that do not match the property names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165627 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.Jordan Rose
This more accurately reflects its use: this flag is set when a method matches the getter or setter name for a property in the same class, and does not actually specify whether or not the definition of the method will be synthesized (either implicitly or explicitly with @synthesize). This renames the setter and backing field as well, and changes the (soon-to-be-obsolete?) XML dump format to use 'property_accessor' instead of 'synthesized'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10Fix stack overflow when trying to create an implicit movingArgyrios Kyrtzidis
constructor with invalid code. rdar://12240916 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165623 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09If a macro has been #undef'd in a precompiled header, we still need toDouglas Gregor
write out the macro history for that macro. Similarly, we need to cope with reading a macro definition that has been #undef'd. Take advantage of this new ability so that global code-completion results can refer to #undef'd macros, rather than losing them entirely. For multiply defined/#undef'd macros, we will still get the wrong result, but it's better than getting no result. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165502 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09Clearing a SmallPtrSet is still expensive, split it out from ↵Benjamin Kramer
OverloadCandidateSet::clear and don't do it on destruction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165501 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09When storing the C++ overridden methods, store them once for theArgyrios Kyrtzidis
canonical method; avoid storing them again for an out-of-line definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165472 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08Use a single note diagnostic for all the precedent/parentheses warnings.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165384 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08StringRef-ify Binary/UnaryOperator::getOpcodeStrDavid Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165383 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about ↵Richard Smith
what's going on, per Sean Silva's suggestion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165286 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05Implement -Wshift-op-parentheses for: a << b + cDavid Blaikie
This appears to be consistent with GCC's implementation of the same warning under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user defined type for compatibility with C++ stream IO. Otherwise suggest parentheses around the addition or subtraction subexpression. (this came up when MSVC was complaining (incorrectly, so far as I can tell) about a perceived violation of this within the LLVM codebase, PR14001) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165283 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a moduleArgyrios Kyrtzidis
import declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165277 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04Egriegious hack to support libstdc++4.6's broken <atomic> header, which definesRichard Smith
a non-inline namespace, then reopens it as inline to try to add its symbols to the surrounding namespace. In this one special case, permit the namespace to be reopened as inline, and patch up the name lookup tables to match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165263 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04Fixed FunctionTypeLoc source range.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04Fixed instantiated operators source range.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04Fixed ParamDecl source range for implicit typed k&r parameters.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165256 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04Fix scope location when parsing GNU attributes.Michael Han
For GNU attributes, instead of reusing attribute source location for the scope location, use SourceLocation() since GNU attributes don not have scope tokens. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165234 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04Permanently end the whole "pragma got handled by the parser too early"Eli Friedman
mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165195 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03objective-C arc: Warn under arc about a use of an ivar inside a blockFariborz Jahanian
that doesn't have a 'self' as this implicitly captures 'self' and could create retain cycles. Provide fixit. // rdar://11194874 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165133 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03Improve C++11 attribute parsing.Michael Han
- General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST. - Add support to parse arguments of attributes that in 'gnu' namespace. - Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03Change how the SelfReferenceChecker handles MemberExpr. Instead of treatingRichard Trieu
each one separately, process a stack of MemberExpr's as a single unit so that static calls and member access will not be warned on. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02Revert 165058, per Jim request. This requires further discussion.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165070 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.Chad Rosier
A Sema lookup is used to determine the size of the variable, which is in turn used during wildcard matching. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02[ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with ↵Chad Rosier
pointer size directives (e.g., dword ptr [eax]). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165031 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02No need to call the InitializeAll* functions.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165025 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02Allowing individual targets to determine whether a given calling convention ↵Aaron Ballman
is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs. Fixes PR13782 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165015 91177308-0d34-0410-b5e6-96231b3b80d8