Commit Graph

265 Commits

Author SHA1 Message Date
Devang Patel 98f217118f Fix context in class static variable's debugging information entry.
This fixes bunch of failures in gdb testsuite.

llvm-svn: 103745
2010-05-13 23:52:37 +00:00
Devang Patel c5ffabc94f If given location is invalid then use current location.
This fixes recent regressions reported by gdb testsuite. 
Tighter verification of debug info generated by FE found these regressions.

Refactor code to extract line number and column number from SourceLocation.

llvm-svn: 103678
2010-05-12 23:46:38 +00:00
Abramo Bagnara 6150c884df Merged Elaborated and QualifiedName types.
llvm-svn: 103517
2010-05-11 21:36:43 +00:00
Devang Patel 82bbfb58e3 Initialize Column.
llvm-svn: 103448
2010-05-10 23:48:38 +00:00
Devang Patel b319adec49 If variable location is invalid then use current location.
This fixes radar 7959934.

llvm-svn: 103408
2010-05-10 17:24:58 +00:00
Devang Patel 67eba80672 If there is not any debug info for type then do not emit debug info for this variable.
A recent change to tightly verify debug info prepared by FE caught this.
This fixes unittest build.

llvm-svn: 103320
2010-05-07 23:05:55 +00:00
Devang Patel ba4ad7f2fd Avoid use of DIDescriptor::getNode(). Use overloaded operators instead.
llvm-svn: 103273
2010-05-07 18:12:35 +00:00
Douglas Gregor c8be95274d When instantiating a function that was declared via a typedef, e.g.,
typedef int functype(int, int);
    functype func;

also instantiate the synthesized function parameters for the resulting
function declaration. 

With this change, Boost.Wave builds and passes all of its regression
tests.

llvm-svn: 103025
2010-05-04 18:18:31 +00:00
Devang Patel dfcd0661a1 Use clang::VarDecl name instead of llvm::GlobalVariable name.
llvm::GLobalVariable name may not match user visibile name for function static variables.

llvm-svn: 102644
2010-04-29 17:48:37 +00:00
John McCall 2408e32096 Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization.  That is to
say, in
  template <class T> class A { ... };
or
  template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context.  This allows us to track the
current instantiation appropriately even inside AST routines.  It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).

llvm-svn: 102407
2010-04-27 00:57:59 +00:00
Devang Patel 42fb6f8b9a Enable debug info for local variables at -O1+.
llvm-svn: 102398
2010-04-26 23:28:46 +00:00
Benjamin Kramer 20f2d4382f Fix pasto, add a comment.
llvm-svn: 102263
2010-04-24 20:26:20 +00:00
Benjamin Kramer bbb5deace6 Factor code. No functionality change.
llvm-svn: 102262
2010-04-24 20:19:58 +00:00
Devang Patel 8471593892 Revert accidental check-in.
llvm-svn: 102226
2010-04-24 00:49:16 +00:00
Devang Patel f8b55d478c Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.
llvm-svn: 102224
2010-04-24 00:40:35 +00:00
Devang Patel b9ab309650 Encode field accessibility.
llvm-svn: 102033
2010-04-21 23:12:37 +00:00
Anders Carlsson 11e5140db9 Vtable -> VTable renames across the board.
llvm-svn: 101666
2010-04-17 20:15:18 +00:00
Devang Patel a2c048eaf8 Emit debug info for objc getters and setters.
llvm-svn: 100462
2010-04-05 21:09:15 +00:00
Chris Lattner 18a584b56c NewDebugLoc got renamed to DebugLoc.
llvm-svn: 100219
2010-04-02 20:21:43 +00:00
Chris Lattner e675d0f924 adjust to IRBuilder change and use faster DebugLoc apis.
llvm-svn: 100093
2010-04-01 06:31:43 +00:00
Chris Lattner be49c03ff4 use the new optimized debug info metadata accessors. In
addition to the inherent win, this eliminates the pointless
cost of going through the name -> mdkind stringmap that we
were paying.

llvm-svn: 99983
2010-03-31 03:36:01 +00:00
Benjamin Kramer 9e649c3cfe Replace some constant-sized SmallVectors.
llvm-svn: 99884
2010-03-30 11:36:44 +00:00
Ted Kremenek dbb8cd1d34 Cache results computed by CGDebugInfo::getOrCreateFile() in a DenseMap.
This reduces '-c -g' time on one file in 403.gcc by 12%.

llvm-svn: 99857
2010-03-30 00:27:51 +00:00
Ted Kremenek 23c29f0cbe Change 'TypeCache' from being an std::map to a llvm::DenseMap. This reduces codegen time
on one .i file from 403.gcc by 0.5%.

llvm-svn: 99823
2010-03-29 18:29:57 +00:00
Anders Carlsson a864caff8c Rename CGVtableInfo to CodeGenVTables in preparation of adding another VTableInfo class.
llvm-svn: 99250
2010-03-23 04:11:45 +00:00
Douglas Gregor 65f7a3f801 Comment the reasons for the strange little dance we do with the main file name for debug information
llvm-svn: 99215
2010-03-22 21:28:29 +00:00
John McCall 7ec5043c2c Change CodeGenModule to rely on the Module's symbol table instead of
shadowing it in the GlobalDeclMap.  Eliminates the string-uniquing
requirement for mangled names, which should help C++ codegen times a little.
Forces us to do string lookups instead of pointer lookups, which might hurt
codegen times a little across the board.  We'll see how it plays out.

Removing the string-uniquing requirement implicitly fixes any bugs like
PR6635 which arose from the fact that we had multiple uniquing tables for
different kinds of identifiers.

llvm-svn: 99012
2010-03-19 23:29:14 +00:00
Douglas Gregor fc7a4813ab Try to improve computation of the main file name for debug
information, to address recent gdb failures.

llvm-svn: 98959
2010-03-19 14:49:09 +00:00
Douglas Gregor c6b5a3df1e For debug information, get the main file name from the source manager
rather than from the -main-file-name flag, since the source manager
has proper path information. Fixes <rdar://problem/7769538>.

llvm-svn: 98898
2010-03-18 23:46:43 +00:00
Benjamin Kramer 69b3c43391 Use raw_ostream instead of sprintf.
llvm-svn: 98438
2010-03-13 12:06:51 +00:00
Devang Patel a42d3ea60e If main file name is empty then use "<unknown>".
llvm-svn: 98385
2010-03-12 21:04:27 +00:00
Devang Patel 01bb5ce932 Keep track of Record context to ensure that record elements are properly nested in debug info.
llvm-svn: 98283
2010-03-11 20:01:48 +00:00
Anders Carlsson 4cbe83cccb Rename getVirtualBaseOffsetIndex to getVirtualBaseOffsetOffset to reflect what it actually does.
llvm-svn: 98248
2010-03-11 07:15:17 +00:00
John McCall e78aac41de Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type;  the canonical type is still a template 
specialization type.  This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.     

llvm-svn: 98134
2010-03-10 03:28:59 +00:00
Devang Patel 05c37d2800 Use SmallString instead of alloca.
llvm-svn: 98112
2010-03-10 00:19:43 +00:00
Devang Patel 93f274c161 Fix file reference for derived and composite types. Now, dwarf writer uses strict verifier that ignores debug info for such types if their file info is unknown.
llvm-svn: 98096
2010-03-09 22:49:11 +00:00
Devang Patel 4f26205ba8 More then one anonymous aggregates on one line creates chaos when MDNode uniquness is combined with RAUW operation. Right solution is to avoid using RAUW.
This fixes PR 6554.

llvm-svn: 98083
2010-03-09 21:32:27 +00:00
Devang Patel f2aa707895 Use getLast() instead of getBasename().
llvm-svn: 98072
2010-03-09 19:14:07 +00:00
Devang Patel 408dcf60aa Start using DIFile. Corresponding llvm patch is r98020.
llvm-svn: 98021
2010-03-09 00:44:50 +00:00
Devang Patel d3cbaa1ddf Avoid using DIDescriptor.isNull().
llvm-svn: 97976
2010-03-08 20:53:17 +00:00
Devang Patel 9cf2705a5d Revert r97949.
llvm-svn: 97964
2010-03-08 19:20:58 +00:00
Devang Patel 4ce8ebb087 Avoid DIDescriptor.isNull() checks.
llvm-svn: 97949
2010-03-08 18:26:57 +00:00
Sanjiv Gupta 9ac3092d34 Targets (like pic16) may have mangled the name of global variables,
so get the name from Var rather than the original decl.

llvm-svn: 97114
2010-02-25 05:20:44 +00:00
Devang Patel b407338fe2 Emit debug info for VectorType.
llvm-svn: 96999
2010-02-23 22:59:39 +00:00
Devang Patel 7585580ccc Distinguish two lexical blocks at the same level.
llvm-svn: 96397
2010-02-16 21:41:20 +00:00
Devang Patel f4df65cf60 Do not ignore anonymous records.
llvm-svn: 95953
2010-02-12 01:31:06 +00:00
Devang Patel e003dd1721 Cache new compile unit.
llvm-svn: 95952
2010-02-12 01:30:31 +00:00
Douglas Gregor 0a5a2216e2 Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.

llvm-svn: 95836
2010-02-11 01:04:33 +00:00
Devang Patel 535fdaf020 Refactor code that generates debug info for variables that has BlocksAttr.
llvm-svn: 95786
2010-02-10 18:49:08 +00:00
Devang Patel 1b5330afe9 Use current location as the location of compiler generated arguments, e.g. self, _cmd etc.
llvm-svn: 95743
2010-02-10 01:09:50 +00:00