[llvm-commits] [dragonegg] r90346 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Wed Dec 2 12:41:10 PST 2009
Author: baldrick
Date: Wed Dec 2 14:41:10 2009
New Revision: 90346
URL: http://llvm.org/viewvc/llvm-project?rev=90346&view=rev
Log:
In spite of what the gcc docs say, you can get a CONST_DECL here
when compiling C++. If this happens, simply grab the value out
of the CONST_DECL.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=90346&r1=90345&r2=90346&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Wed Dec 2 14:41:10 2009
@@ -531,6 +531,8 @@
if (TYPE_SIZE(type)) {
for (tree Link = TYPE_VALUES(type); Link; Link = TREE_CHAIN(Link)) {
tree EnumValue = TREE_VALUE(Link);
+ if (TREE_CODE(EnumValue) == CONST_DECL)
+ EnumValue = DECL_INITIAL(EnumValue);
int64_t Value = getINTEGER_CSTVal(EnumValue);
const char *EnumName = IDENTIFIER_POINTER(TREE_PURPOSE(Link));
Elements.push_back(DebugFactory.CreateEnumerator(EnumName, Value));
More information about the llvm-commits
mailing list