]>
granicus.if.org Git - clang/log
Anders Carlsson [Sun, 21 Nov 2010 18:34:21 +0000 (18:34 +0000)]
The 'X' printf type has a valid alternative form. Fixes PR8641.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119946
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 21 Nov 2010 18:33:34 +0000 (18:33 +0000)]
Update Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119945
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 21 Nov 2010 14:11:41 +0000 (14:11 +0000)]
Fix a bunch of IndirectFieldDecl-related warnings.
- Negative ChainingSize doesn't make sense, make it unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119943
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 21 Nov 2010 11:32:22 +0000 (11:32 +0000)]
Filename.rfind("/\\") won't give us the position of the last directory seperator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119939
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 21 Nov 2010 09:55:08 +0000 (09:55 +0000)]
remove old compatibility APIs, use StringRef versions instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119935
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 21 Nov 2010 09:50:16 +0000 (09:50 +0000)]
change the various getFile routines to use StringRef as their implementation form.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119934
91177308 -0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Sun, 21 Nov 2010 06:49:41 +0000 (06:49 +0000)]
Fix warning: enumeration value 'IndirectField' not handled in switch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119924
91177308 -0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Sun, 21 Nov 2010 06:22:53 +0000 (06:22 +0000)]
Compilation error: remove extra comma.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119921
91177308 -0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Sun, 21 Nov 2010 06:08:52 +0000 (06:08 +0000)]
Major anonymous union/struct redesign.
A new AST node is introduced:
def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119919
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 21 Nov 2010 00:09:52 +0000 (00:09 +0000)]
Forward the -fno-elide-constructor argument to clang -cc1. Fixes PR8652.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119915
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Sat, 20 Nov 2010 08:17:16 +0000 (08:17 +0000)]
Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119900
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhanyong Wan [Sat, 20 Nov 2010 07:52:48 +0000 (07:52 +0000)]
Fix a typo in EnvironmentManager::bindExprAndLocation(). Reviewed by kremenek.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119899
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Sat, 20 Nov 2010 06:53:12 +0000 (06:53 +0000)]
Handle CFGAutomaticObjDtor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119897
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 20 Nov 2010 02:04:01 +0000 (02:04 +0000)]
Revert r119838 "Don't warn for empty 'if' body if there is a macro that expands to nothing"
and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro.
Thanks to Abramo Bagnara for the hint!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119887
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 20 Nov 2010 01:29:55 +0000 (01:29 +0000)]
A bundle of whitespace changes, separated out from the functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119886
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 20 Nov 2010 00:09:34 +0000 (00:09 +0000)]
Implement a simple hash function for libclang cursors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119876
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 19 Nov 2010 23:44:15 +0000 (23:44 +0000)]
Implement clang_getCanonicalCursor() in libclang, which does the obvious thing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119874
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Silverstein [Fri, 19 Nov 2010 21:33:15 +0000 (21:33 +0000)]
Several PPCallbacks take an SourceLocation + IdentifierInfo, rather
than a Token that holds the same information all in one easy-to-use
package. There's no technical reason to prefer the former -- the
information comes from a Token originally -- and it's clumsier to use,
so I've changed the code to use tokens everywhere.
Approved by clattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119845
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 19 Nov 2010 21:02:06 +0000 (21:02 +0000)]
Check for gcc 4.3.4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119839
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 19 Nov 2010 20:54:25 +0000 (20:54 +0000)]
Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:
if (condition)
CALL(0); // empty macro but don't warn for empty body.
Fixes rdar://
8436021 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119838
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 19 Nov 2010 18:44:34 +0000 (18:44 +0000)]
Make sure to print cvr-qualifiers on function declarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119817
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 19 Nov 2010 18:17:09 +0000 (18:17 +0000)]
Minor cleanup. No change otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119814
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 19 Nov 2010 18:16:46 +0000 (18:16 +0000)]
objc_msgSend is not a builtin type in non-objc mode.
Fixes //rdar://
8686888
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119813
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 19 Nov 2010 17:51:40 +0000 (17:51 +0000)]
Driver/Darwin: Don't pass -demangle to an iOS linker, which may not understand
it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119809
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 19 Nov 2010 17:36:51 +0000 (17:36 +0000)]
Initialize StoredDiagnostic's members in order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119808
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Fri, 19 Nov 2010 17:26:57 +0000 (17:26 +0000)]
add support for the i686-pc-linux-gnu triple (used by Gentoo x86)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119807
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 19 Nov 2010 17:10:50 +0000 (17:10 +0000)]
When parsing something that looks like an ill-formed
protocol-qualifier list without a leading type (e.g., <#blah#>), don't
complain about it being an archaic protocol-qualifier list unless it
actually parses as one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119805
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 19 Nov 2010 16:23:35 +0000 (16:23 +0000)]
Driver: Ignore -force_cpusubtype_ALL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119803
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 19 Nov 2010 16:18:16 +0000 (16:18 +0000)]
Extend the libclang diagnostic API to provide information about the
option name, category ID, and category name corresponding to a diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119802
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 19 Nov 2010 00:19:20 +0000 (00:19 +0000)]
Remove Diagnostic's get/setNumErrors() and getNumErrorsSuppressed().
Anyone wanting to use it should probably use DiagnosticClient's getNumErrors() instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119766
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 19 Nov 2010 00:19:18 +0000 (00:19 +0000)]
getNumErrors() -> hasErrorOccurred()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119765
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 19 Nov 2010 00:19:15 +0000 (00:19 +0000)]
Refactoring. Get FunctionScopeInfo to use DiagnosticErrorTrap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119764
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 19 Nov 2010 00:19:12 +0000 (00:19 +0000)]
Refactoring.
Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119763
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 18 Nov 2010 22:39:16 +0000 (22:39 +0000)]
Fix a bug where write-barriers for assignment through reference
types was not being generated for objc pointers.
// rdar://
8681766 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119751
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 18 Nov 2010 21:51:10 +0000 (21:51 +0000)]
Use a signed vector type for the shift amount operand of unsigned shifts.
Neon shifts allow a mix of positive and negative shift amounts to shift
left or right, respectively, so the shift amount vector should always be
signed. PR8482 (Radar
8603521 ).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119748
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 21:47:07 +0000 (21:47 +0000)]
Use hasErrorOccurred() instead of getNumErrors() where it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119746
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 21:47:04 +0000 (21:47 +0000)]
Get the number of errors reported from the diagnostic client, in clang_parseTranslationUnit_Impl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119745
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 18 Nov 2010 21:19:52 +0000 (21:19 +0000)]
Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119741
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 21:13:57 +0000 (21:13 +0000)]
Remove the hack where, to get the return status, we had special case for VerifyDiagnosticsClient
and just check the number of errors from the DiagnosticClient.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119736
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 21:13:54 +0000 (21:13 +0000)]
Keep track of errors/warnings in FixItRewriter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119735
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 20:06:46 +0000 (20:06 +0000)]
Since multiple diagnostics can share one diagnostic client, have the client keeping track
of the total number of warnings/errors reported.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119731
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 20:06:41 +0000 (20:06 +0000)]
Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 20:06:30 +0000 (20:06 +0000)]
Copy the LangOptions in PrintingPolicy to avoid pointing to a LangOptions that is long gone.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119729
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Thu, 18 Nov 2010 19:01:18 +0000 (19:01 +0000)]
Add an assertion, fix a whole bunch of bugs, comment the assertion
out because there are still bugs left.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119722
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 18:51:03 +0000 (18:51 +0000)]
Remove the getDiagnosticLevel check since it doesn't buy us much.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119719
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 18 Nov 2010 12:46:39 +0000 (12:46 +0000)]
Fix a typo in the UTF-8 BOM (PR8645). Use a StringSwitch while at it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119698
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Silverstein [Thu, 18 Nov 2010 08:32:02 +0000 (08:32 +0000)]
In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (see
http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to
rjmccall for all the coaching!
Approved by rjmccall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119697
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Thu, 18 Nov 2010 06:31:45 +0000 (06:31 +0000)]
Calculate the value kind of an expression when it's created and
store it on the expression node. Also store an "object kind",
which distinguishes ordinary "addressed" l-values (like
variable references and pointer dereferences) and bitfield,
@property, and vector-component l-values.
Currently we're not using these for much, but I aim to switch
pretty much everything calculating l-valueness over to them.
For now they shouldn't necessarily be trusted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119685
91177308 -0d34-0410-b5e6-
96231b3b80d8
Marcin Swiderski [Thu, 18 Nov 2010 06:29:23 +0000 (06:29 +0000)]
Added method for handling CXXOperatorCallExpr differently from CallExpr if CXXOperatorCallExpr represents method call.
Also fixed returning ExpolodedNodeSet from VisitCXXMethodCallExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119684
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anton Yartsev [Thu, 18 Nov 2010 03:19:30 +0000 (03:19 +0000)]
comparison of AltiVec vectors now gives bool result (fix for 7533)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119678
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Nov 2010 00:42:18 +0000 (00:42 +0000)]
CursorVisitor: switch remaining expressions over
to the data-recursion algorithm. CursorVisitor
now no longer subclasses StmtVisitor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119596
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 18 Nov 2010 00:20:36 +0000 (00:20 +0000)]
-Rename -Wargument-larger-than -> -Wlarge-by-value-copy
-Improve the diagnostic message
-Add some comments
Suggestions by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119594
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Nov 2010 00:02:32 +0000 (00:02 +0000)]
CursorVisitor: migrate handling of
'DependentScopeDeclRefExpr' and
'CXXDependentScopeMemberExpr' to the
data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119591
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 23:24:11 +0000 (23:24 +0000)]
Make definition of CXTranslationUnitImpl private
to libclang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119585
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 17 Nov 2010 23:11:54 +0000 (23:11 +0000)]
Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).
Implements rdar://
8548050 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119583
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Nov 2010 22:26:15 +0000 (22:26 +0000)]
Implement -pie.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119577
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Nov 2010 22:13:25 +0000 (22:13 +0000)]
Don't warn about
clang -w -c foo.s
Helps with the gdb testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119574
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 17 Nov 2010 21:36:08 +0000 (21:36 +0000)]
Do not produce "purely informative" code completion results for
Objective-C message sends, which have only whitespace in their
TypedText chunk. Such results have no purpose.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119569
91177308 -0d34-0410-b5e6-
96231b3b80d8
Marcin Swiderski [Wed, 17 Nov 2010 21:27:36 +0000 (21:27 +0000)]
In EvalArguments allow for evaluation of first argument always as a lvalue. Will be used for CXXOperatorCallExpr that represents method call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119567
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Nov 2010 20:37:10 +0000 (20:37 +0000)]
Don't warn about -w not being used in a link. Necessary to get sane
results in the gdb testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119552
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 17 Nov 2010 19:41:23 +0000 (19:41 +0000)]
Warn if direct accessing synthesized ivar backing the property in
nonofragile-abi2. Fixes //rdar://
8673791
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119543
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 17 Nov 2010 19:18:19 +0000 (19:18 +0000)]
Don't emit warn_logical_and_in_logical_or for cases like "a && b || 0".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119540
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 17 Nov 2010 18:54:22 +0000 (18:54 +0000)]
Don't emit warn_logical_and_in_logical_or for macros. Fixes rdar://
8678458
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119537
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 17 Nov 2010 18:26:36 +0000 (18:26 +0000)]
Don't warn for parentheses for the '&&' inside '||' for cases like:
assert(a || b && "bad");
since this is safe. This way we avoid a big source of such warnings which in this case are practically useless.
Note that we don't handle *all* cases where precedence wouldn't matter because of constants since
this is a bit costly to check, and IMO clarifying precedence with parentheses is good for
readability in general.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119533
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 17 Nov 2010 18:26:33 +0000 (18:26 +0000)]
Put warn_logical_and_in_logical_or warning in new warning group "logical-op-parentheses" member of "parentheses".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119532
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Nov 2010 17:23:53 +0000 (17:23 +0000)]
Add a comment explaining why r117813 was needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119518
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Nov 2010 17:21:47 +0000 (17:21 +0000)]
Drop the warning about __attribute__((may_alias)) being used
on a non-type declaration, as GCC permits it on variables too.
This fixes PR8635.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119517
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 17 Nov 2010 17:15:08 +0000 (17:15 +0000)]
When libclang is walking a member access expression, don't walk into
an implicit "this"; it causes clang_getCursor() to find the implicit
"this" expression (which isn't written in the source!) rather than the
actual member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119516
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 17 Nov 2010 17:14:07 +0000 (17:14 +0000)]
When comparing the source range of a declaration against the region of
interest (e.g., as used by clang_getCursor()), count the
decl-specifier-seq as part of the source range, as we do for
clang_annotateTokens(). Makes clang_getCursor() work properly for the
result types of functions, for example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119514
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Nov 2010 15:16:14 +0000 (15:16 +0000)]
Silence warning for "clang -O2 -O0 -c foo.c -o foo.o.
Fixes PR8607.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119498
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Wed, 17 Nov 2010 09:16:19 +0000 (09:16 +0000)]
Add skeleton for handling various cfg dtors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119491
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 08:25:26 +0000 (08:25 +0000)]
When forming the !srcloc mdnode for an inline asm, add the SourceLocations
of all the lines of the inline asm. With the refactoring and enhancement
of the backend, we can now reports errors on the correct source line when
an asm contains multiple lines of text. For something like this:
void foo() {
asm("push %rax\n"
".code32\n");
}
we used to get this: (note that the line 4 in t.c isn't helpful)
t.c:4:7: error: warning: ignoring directive for now
asm("push %rax\n"
^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^
now we get:
t.c:5:8: error: warning: ignoring directive for now
".code32\n"
^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^
Note that we're pointing to line 5 properly now. This implements
rdar://
7839391 - inline asm errors should point to the right line in the asm
and makes the error message in PR8595 much less confusing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119489
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 08:13:04 +0000 (08:13 +0000)]
adjust for llvm mainline, yay type safety
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119487
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 07:37:15 +0000 (07:37 +0000)]
a metric ton of refactoring later, Sema::getLocationOfStringLiteralByte
no longer depends on Preprocessor, so we can move it out of Sema into
a nice new StringLiteral::getLocationOfByte method that can be used by
any AST client.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119481
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Wed, 17 Nov 2010 07:31:08 +0000 (07:31 +0000)]
do not do post checks. Because at this point we just enter the call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119480
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 07:26:20 +0000 (07:26 +0000)]
move getSpelling from Preprocessor to Lexer, which it is more conceptually related to.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119479
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Wed, 17 Nov 2010 07:21:49 +0000 (07:21 +0000)]
Remove comments. We are already doing actual method call by inlining it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119477
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 07:21:13 +0000 (07:21 +0000)]
propagate preprocessor out of StringLiteralParser. It is now
possible to create one without a preprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119476
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 07:12:42 +0000 (07:12 +0000)]
push the preprocessor out of EncodeUCNEscape
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119475
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 07:05:50 +0000 (07:05 +0000)]
move AdvanceToTokenCharacter and getLocForEndOfToken from
Preprocessor to Lexer where they make more sense.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119474
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 06:55:10 +0000 (06:55 +0000)]
add a static version of PP::AdvanceToTokenCharacter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119472
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 06:46:14 +0000 (06:46 +0000)]
push use of Preprocessor out farther.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119471
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 06:35:43 +0000 (06:35 +0000)]
push use of Preprocessor out of getOffsetOfStringByte
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119470
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 06:31:48 +0000 (06:31 +0000)]
add a static form of the efficient PP::getSpelling method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119469
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 06:26:08 +0000 (06:26 +0000)]
refactor the interface to StringLiteralParser::getOffsetOfStringByte,
pushing the dependency on the preprocessor out a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119468
91177308 -0d34-0410-b5e6-
96231b3b80d8
Marcin Swiderski [Wed, 17 Nov 2010 06:22:54 +0000 (06:22 +0000)]
Added mapping from 'this' to it's SymbolicRegion in BasicStoreManager::getInitialStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119467
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Nov 2010 05:58:54 +0000 (05:58 +0000)]
factor some code out to a helper function, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119464
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 02:18:35 +0000 (02:18 +0000)]
CursorVisitor: Migrate handling of
'SizeOfAlignOfExpr' and 'CXXSCalarValueInitExpr'
to data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119452
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 17 Nov 2010 01:03:52 +0000 (01:03 +0000)]
For an Objective-C @synthesize statement, e.g.,
@synthesize foo = _foo;
keep track of the location of the ivar ("_foo"). Teach libclang to
visit the ivar as a member reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119447
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:52 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of CXXUuidofExpr to
data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119444
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:50 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of UnaryTypeTraitExpr
to data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119443
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:47 +0000 (00:50 +0000)]
CursorVisitor: refactor visitation of
explicit template args within data-recursion
algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119442
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:45 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
AddrLabelExpr to data-recursion algorithm, and
unify that reasoning with GotoStmt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119441
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:43 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
VAArgExpr to data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119440
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:41 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
CXXTypeidExpr to data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119439
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:39 +0000 (00:50 +0000)]
CursorVisitor: migrate handling of
TypesCompatibleExpr to data-recursion algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119438
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:36 +0000 (00:50 +0000)]
CursorVisitor: Migrate CXXUnresolvedConstructExpr over to data-recursive algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119437
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Nov 2010 00:50:34 +0000 (00:50 +0000)]
Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119436
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Wed, 17 Nov 2010 00:44:53 +0000 (00:44 +0000)]
Re-enable test with modifications for Neon vector changes in clang.
I mistakenly thought that this was checking for vector name mangling, but
it is not. Since we're no longer wrapping Neon vectors in structs, this
test can just return a vector directly. There are already other tests for
that, so just to make this interesting, change the test to return a struct
of two vectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119434
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Nov 2010 00:25:26 +0000 (00:25 +0000)]
Add support for distros that like x86_64-unknown-linux-gnu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119425
91177308 -0d34-0410-b5e6-
96231b3b80d8