[llvm-commits] [llvm] r93630 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h include/llvm/CodeGen/MachineFunction.h include/llvm/Support/DebugLoc.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/MachineFunction.cpp lib/CodeGen/MachineInstr.cpp lib/ExecutionEngine/JIT/JITEmitter.cpp lib/Target/PIC16/PIC16DebugInfo.cpp

Chris Lattner clattner at apple.com
Mon Jan 18 17:28:41 PST 2010


On Jan 15, 2010, at 10:09 PM, Devang Patel wrote:

> Author: dpatel
> Date: Sat Jan 16 00:09:35 2010
> New Revision: 93630
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=93630&view=rev
> Log:
> Replace DebugLocTuple with DILocation.

Thanks Devang.

> +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Sat Jan 16 00:09:35 2010
> @@ -17,6 +17,7 @@
> #define LLVM_CODEGEN_ASMPRINTER_H
> 
> #include "llvm/CodeGen/MachineFunctionPass.h"
> +#include "llvm/Analysis/DebugInfo.h"

Please don't add this.  Please split the mutable state out to be a pointer to a struct (containing the relevant fields) which is not defined in the header.  This will also eliminate the need for mutable.

Alternatively, you could change PrevDLT to just be an MDNode*.

>   struct DebugLocTracker {
>     /// DebugLocations - A vector of unique DebugLocTuple's.
>     ///
> -    std::vector<DebugLocTuple> DebugLocations;
> +    std::vector<MDNode *> DebugLocations;
> 
>     /// DebugIdMap - This maps DebugLocTuple's to indices into the
>     /// DebugLocations vector.
> -    DenseMap<DebugLocTuple, unsigned> DebugIdMap;
> +    DenseMap<MDNode *, unsigned> DebugIdMap;

Wow, much nicer!

-Chris



More information about the llvm-commits mailing list