[llvm-commits] [hlvm] r38355 - /hlvm/trunk/hlvm/AST/Bundle.cpp
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:02:37 PDT 2007
Author: reid
Date: Sat Jul 7 19:02:37 2007
New Revision: 38355
URL: http://llvm.org/viewvc/llvm-project?rev=38355&view=rev
Log:
Make this code a little easier to read, no functional change.
Modified:
hlvm/trunk/hlvm/AST/Bundle.cpp
Modified: hlvm/trunk/hlvm/AST/Bundle.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Bundle.cpp?rev=38355&r1=38354&r2=38355&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/Bundle.cpp (original)
+++ hlvm/trunk/hlvm/AST/Bundle.cpp Sat Jul 7 19:02:37 2007
@@ -45,13 +45,13 @@
hlvmAssert(kid && "Null child!");
if (isa<Type>(kid))
types.insert(cast<Type>(kid)->getName(), cast<Type>(kid));
- else if (isa<Value>(kid)) {
- values.push_back(cast<Value>(kid));
+ else if (Constant* C = dyn_cast<Constant>(kid)) {
+ const std::string& name = C->getName();
+ values.push_back(C);
if (isa<ConstantValue>(kid)) {
- cvals.insert(cast<ConstantValue>(kid)->getName(),
- cast<ConstantValue>(kid));
+ cvals.insert(name, cast<ConstantValue>(kid));
} else if (isa<Linkable>(kid)) {
- linkables.insert(cast<Linkable>(kid)->getName(), cast<Linkable>(kid));
+ linkables.insert(name, cast<Linkable>(kid));
}
} else
hlvmAssert("Don't know how to insert that in a Bundle");
More information about the llvm-commits
mailing list